RegisterTestInfo< T > Class Template Reference

List of all members.

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
mValue
ERegisterCheck mCheckValue
TProgramCounter mPC

Detailed Description

template<typename T>
class RegisterTestInfo< T >

Definition at line 50 of file CalcAssemblerTest.cpp.


Member Enumeration Documentation

template<typename T>
enum RegisterTestInfo::ERegisterCheck

Enumerator:
EINVALID 
ENULL 
EVALID 

Definition at line 53 of file CalcAssemblerTest.cpp.

00053                         {
00054         EINVALID = -1,
00055         ENULL = 0,
00056         EVALID = 1
00057     };


Constructor & Destructor Documentation

template<typename T>
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     }

template<typename T>
RegisterTestInfo< T >::RegisterTestInfo ( string  desc,
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     }

template<typename T>
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     }

template<typename T>
RegisterTestInfo< T >::~RegisterTestInfo (  )  [inline]

Definition at line 141 of file CalcAssemblerTest.cpp.

00141 {}


Member Function Documentation

template<typename T>
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     }

template<typename T>
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     }

template<typename T>
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     }


Member Data Documentation

template<typename T>
string RegisterTestInfo< T >::mDesc

Definition at line 144 of file CalcAssemblerTest.cpp.

Referenced by RegisterTestInfo< T >::toString().

template<typename T>
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().

template<typename T>
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().

template<typename T>
TProgramCounter RegisterTestInfo< T >::mPC

Definition at line 153 of file CalcAssemblerTest.cpp.

Referenced by RegisterTestInfo< T >::toString().


The documentation for this class was generated from the following file:
Generated on Mon Jun 22 04:00:45 2009 for Fennel by  doxygen 1.5.1