00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 #ifndef Fennel_InstructionArgs_Included
00028 #define Fennel_InstructionArgs_Included
00029 
00030 #include <string>
00031 #include "fennel/calculator/Calculator.h"
00032 #include "fennel/calculator/RegisterReference.h"
00033 #include "fennel/tuple/StandardTypeDescriptor.h"
00034 
00035 FENNEL_BEGIN_NAMESPACE
00036 
00037 
00038 
00039 
00040 class FENNEL_CALCULATOR_EXPORT InstructionArgs
00041 {
00042 public:
00043     explicit
00044     InstructionArgs(const vector<RegisterReference*> o)
00045         : operands(o),
00046           pcSet(false)
00047     {
00048     }
00049 
00050     explicit
00051     InstructionArgs(
00052         const vector<RegisterReference*> o,
00053         TProgramCounter p)
00054         : operands(o),
00055           pc(p),
00056           pcSet(true)
00057     {
00058     }
00059 
00060     const TProgramCounter
00061     getPC()
00062     {
00063         assert(pcSet);
00064         return pc;
00065     }
00066 
00067     const vector<RegisterReference*>&
00068     getOperands()
00069     {
00070         return operands;
00071     }
00072 
00073     const RegisterReference*
00074     operator[] (int i)
00075     {
00076         return operands[i];
00077     }
00078 
00079 private:
00080     vector<RegisterReference*> operands;
00081     TProgramCounter pc;
00082     bool pcSet;
00083 };
00084 
00085 
00086 
00087 
00088 FENNEL_END_NAMESPACE
00089 
00090 #endif
00091 
00092 
00093