Public Types | |
enum | ERegisterCheck { EINVALID = -1, ENULL = 0, EVALID = 1 } |
Public Member Functions | |
RegisterTestInfo (string desc, TProgramCounter pc) | |
RegisterTestInfo (string desc, T v, TProgramCounter pc) | |
RegisterTestInfo (string desc, T *pV, TProgramCounter pc) | |
void | setTupleDatum (TupleDatum &datum) |
bool | checkTupleDatum (TupleDatum &datum) |
string | toString () |
~RegisterTestInfo () | |
Public Attributes | |
string | mDesc |
T | mValue |
ERegisterCheck | mCheckValue |
TProgramCounter | mPC |
Definition at line 50 of file CalcAssemblerTest.cpp.
enum RegisterTestInfo::ERegisterCheck |
RegisterTestInfo< T >::RegisterTestInfo | ( | string | desc, | |
TProgramCounter | pc | |||
) | [inline, explicit] |
Definition at line 60 of file CalcAssemblerTest.cpp.
00060 : 00061 mDesc(desc), mCheckValue(EINVALID), mPC(pc) 00062 { 00063 }
RegisterTestInfo< T >::RegisterTestInfo | ( | string | desc, | |
T | v, | |||
TProgramCounter | pc | |||
) | [inline, explicit] |
Definition at line 66 of file CalcAssemblerTest.cpp.
00066 : 00067 mDesc(desc), mValue(v), mCheckValue(EVALID), mPC(pc) 00068 { 00069 }
RegisterTestInfo< T >::RegisterTestInfo | ( | string | desc, | |
T * | pV, | |||
TProgramCounter | pc | |||
) | [inline, explicit] |
Definition at line 72 of file CalcAssemblerTest.cpp.
References RegisterTestInfo< T >::ENULL, RegisterTestInfo< T >::EVALID, RegisterTestInfo< T >::mCheckValue, and RegisterTestInfo< T >::mValue.
00072 : 00073 mDesc(desc), mPC(pc) 00074 { 00075 if (pV == NULL) { 00076 mCheckValue = ENULL; 00077 } else { 00078 mValue = *pV; 00079 mCheckValue = EVALID; 00080 } 00081 }
RegisterTestInfo< T >::~RegisterTestInfo | ( | ) | [inline] |
void RegisterTestInfo< T >::setTupleDatum | ( | TupleDatum & | datum | ) | [inline] |
Definition at line 83 of file CalcAssemblerTest.cpp.
References RegisterTestInfo< T >::EINVALID, RegisterTestInfo< T >::ENULL, RegisterTestInfo< T >::EVALID, RegisterTestInfo< T >::mCheckValue, RegisterTestInfo< T >::mValue, and TupleDatum::pData.
00084 { 00085 switch (mCheckValue) { 00086 case EINVALID: 00087 // Nothing to set 00088 break; 00089 case ENULL: 00090 // Set to NULL 00091 datum.pData = NULL; 00092 break; 00093 case EVALID: 00094 assert(datum.pData != NULL); 00095 (*reinterpret_cast<T*>(const_cast<PBuffer>(datum.pData))) = mValue; 00096 break; 00097 default: 00098 permAssert(false); 00099 } 00100 }
bool RegisterTestInfo< T >::checkTupleDatum | ( | TupleDatum & | datum | ) | [inline] |
Definition at line 102 of file CalcAssemblerTest.cpp.
References RegisterTestInfo< T >::EINVALID, RegisterTestInfo< T >::ENULL, RegisterTestInfo< T >::EVALID, RegisterTestInfo< T >::mCheckValue, RegisterTestInfo< T >::mValue, and TupleDatum::pData.
00103 { 00104 switch (mCheckValue) { 00105 case EINVALID: 00106 // Nothing to check against, okay 00107 return true; 00108 case ENULL: 00109 // Check for null 00110 return (datum.pData == NULL); 00111 case EVALID: 00112 if (datum.pData == NULL) { 00113 return false; 00114 } 00115 return (*reinterpret_cast<const T*>(datum.pData) == mValue); 00116 default: 00117 permAssert(false); 00118 } 00119 }
string RegisterTestInfo< T >::toString | ( | ) | [inline] |
Definition at line 121 of file CalcAssemblerTest.cpp.
References RegisterTestInfo< T >::EINVALID, RegisterTestInfo< T >::ENULL, RegisterTestInfo< T >::EVALID, RegisterTestInfo< T >::mCheckValue, RegisterTestInfo< T >::mDesc, RegisterTestInfo< T >::mPC, and RegisterTestInfo< T >::mValue.
00122 { 00123 ostringstream ostr(""); 00124 switch (mCheckValue) { 00125 case EINVALID: 00126 break; 00127 case ENULL: 00128 ostr << "(NULL) for test "; 00129 break; 00130 case EVALID: 00131 ostr << "(" << mValue << ") for test "; 00132 break; 00133 default: 00134 permAssert(false); 00135 } 00136 00137 ostr << "'" << mDesc << "'" << " at PC=" << mPC; 00138 return ostr.str(); 00139 }
string RegisterTestInfo< T >::mDesc |
Definition at line 144 of file CalcAssemblerTest.cpp.
Referenced by RegisterTestInfo< T >::toString().
T RegisterTestInfo< T >::mValue |
Definition at line 147 of file CalcAssemblerTest.cpp.
Referenced by RegisterTestInfo< T >::checkTupleDatum(), RegisterTestInfo< T >::RegisterTestInfo(), RegisterTestInfo< T >::setTupleDatum(), and RegisterTestInfo< T >::toString().
ERegisterCheck RegisterTestInfo< T >::mCheckValue |
Definition at line 150 of file CalcAssemblerTest.cpp.
Referenced by RegisterTestInfo< T >::checkTupleDatum(), RegisterTestInfo< T >::RegisterTestInfo(), RegisterTestInfo< T >::setTupleDatum(), and RegisterTestInfo< T >::toString().
TProgramCounter RegisterTestInfo< T >::mPC |
Definition at line 153 of file CalcAssemblerTest.cpp.
Referenced by RegisterTestInfo< T >::toString().