RegisterSetBinding Class Reference

How a register set is bound to data. More...

#include <RegisterReference.h>

List of all members.

Public Member Functions

 ~RegisterSetBinding ()
 RegisterSetBinding (TupleData *base, bool ownIt=false)
 binds a register set to a tuple
 RegisterSetBinding (TupleData *base, const TupleData *shadow, bool ownIt=false)
 bind an output register set bound to a tuple, with supplementary target address info.
const TupleDataasTupleData () const
 view the register set as a tuple (read-only)
TupleDatumoperator[] (int n)
 get the Nth register
PConstBuffer getTargetAddr (int n)
 get the target address of the Nth register

Private Attributes

const bool ownTheBase
uint ncols
TupleData *const base
PConstBufferdatumAddr


Detailed Description

How a register set is bound to data.

Definition at line 49 of file RegisterReference.h.


Constructor & Destructor Documentation

RegisterSetBinding::~RegisterSetBinding (  ) 

Definition at line 34 of file RegisterReference.cpp.

References base, datumAddr, and ownTheBase.

00035 {
00036     if (ownTheBase) {
00037         delete base;
00038     }
00039     delete[] datumAddr;
00040 }

RegisterSetBinding::RegisterSetBinding ( TupleData base,
bool  ownIt = false 
)

binds a register set to a tuple

Parameters:
base the underlying tuple
ownIt the RegisterSetBinding takes ownership of the TupleData

Definition at line 42 of file RegisterReference.cpp.

References base, datumAddr, and ncols.

00043     : ownTheBase(ownIt), base(base)
00044 {
00045     assert(base);
00046     ncols = base->size();
00047     datumAddr = new PConstBuffer[ncols];
00048     for (int i = 0; i < ncols; i++) {
00049         const TupleDatum& baseCol = (*base)[i];
00050         datumAddr[i] = baseCol.pData;
00051     }
00052 }

RegisterSetBinding::RegisterSetBinding ( TupleData base,
const TupleData shadow,
bool  ownIt = false 
)

bind an output register set bound to a tuple, with supplementary target address info.

Parameters:
base the underlying tuple (some columns may be null)
shadow Equivalent to base, but all TupleDatum elements have a non-null address.
ownIt the RegisterSetBinding takes ownership of the TupleData

Definition at line 54 of file RegisterReference.cpp.

References base, datumAddr, ncols, and TupleDatum::pData.

00058     : ownTheBase(ownIt),
00059       base(base)
00060 {
00061     assert(base);
00062     ncols = base->size();
00063     assert(shadow->size() == ncols);
00064     datumAddr = new PConstBuffer[ncols];
00065     for (int i = 0; i < ncols; i++) {
00066         const TupleDatum& baseCol = (*base)[i];
00067         const TupleDatum& shadowCol = (*shadow)[i];
00068         datumAddr[i] = shadowCol.pData;
00069         // check that SHADOW coincides with BASE
00070         if (baseCol.pData) {
00071             assert(baseCol.pData == shadowCol.pData);
00072         } else {
00073             assert(shadowCol.pData);
00074         }
00075     }
00076 }


Member Function Documentation

const TupleData& RegisterSetBinding::asTupleData (  )  const [inline]

view the register set as a tuple (read-only)

Definition at line 83 of file RegisterReference.h.

Referenced by Calculator::getStatusRegister(), and Calculator::zeroStatusRegister().

00083                                          {
00084         return *base;
00085     }

TupleDatum& RegisterSetBinding::operator[] ( int  n  )  [inline]

get the Nth register

Definition at line 88 of file RegisterReference.h.

00088                                   {
00089         assert((n >= 0) && (n < ncols));
00090         return (*base)[n];
00091     }

PConstBuffer RegisterSetBinding::getTargetAddr ( int  n  )  [inline]

get the target address of the Nth register

Definition at line 94 of file RegisterReference.h.

00094                                       {
00095         assert((n >= 0) && (n < ncols));
00096         return datumAddr[n];
00097     }


Member Data Documentation

const bool RegisterSetBinding::ownTheBase [private]

Definition at line 51 of file RegisterReference.h.

Referenced by ~RegisterSetBinding().

uint RegisterSetBinding::ncols [private]

Definition at line 52 of file RegisterReference.h.

Referenced by RegisterSetBinding().

TupleData* const RegisterSetBinding::base [private]

Definition at line 53 of file RegisterReference.h.

Referenced by RegisterSetBinding(), and ~RegisterSetBinding().

PConstBuffer* RegisterSetBinding::datumAddr [private]

Definition at line 54 of file RegisterReference.h.

Referenced by RegisterSetBinding(), and ~RegisterSetBinding().


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