TupleDatum Struct Reference

A TupleDatum is a component of TupleData; see the design docs for more details. More...

#include <TupleData.h>

Inheritance diagram for TupleDatum:

StringDesc List of all members.

Public Member Functions

 TupleDatum ()
 TupleDatum (TupleDatum const &other)
bool isNull () const
void setNull ()
 Set this TupleDatum to a NULL value.
TupleDatumoperator= (TupleDatum const &other)
 Copy assignment(shallow copy).
void copyFrom (TupleDatum const &other)
 Copies data from source(shallow copy).
void memCopyFrom (TupleDatum const &other)
 Copies data into TupleDatum's private buffer(deep copy).

Public Attributes

TupleStorageByteLength cbData
PConstBuffer pData
union {
   uint16_t   data16
   uint32_t   data32
   uint64_t   data64
}; 

Detailed Description

A TupleDatum is a component of TupleData; see the design docs for more details.

Definition at line 44 of file TupleData.h.


Constructor & Destructor Documentation

TupleDatum::TupleDatum (  )  [inline, explicit]

Definition at line 139 of file TupleData.h.

References cbData, and pData.

00140 {
00141     cbData = 0;
00142     pData = NULL;
00143 }

TupleDatum::TupleDatum ( TupleDatum const &  other  )  [inline]

Definition at line 145 of file TupleData.h.

References copyFrom().

00146 {
00147     copyFrom(other);
00148 }


Member Function Documentation

bool TupleDatum::isNull (  )  const [inline]

Definition at line 150 of file TupleData.h.

References pData.

00151 {
00152     return (!pData);
00153 }

void TupleDatum::setNull (  )  [inline]

Set this TupleDatum to a NULL value.

Definition at line 155 of file TupleData.h.

References pData.

00156 {
00157     pData = NULL;
00158 }

TupleDatum & TupleDatum::operator= ( TupleDatum const &  other  )  [inline]

Copy assignment(shallow copy).

Note:
See the note of copyFrom method.
Parameters:
[in] other the source TupleDatum

Definition at line 160 of file TupleData.h.

References copyFrom().

00161 {
00162     copyFrom(other);
00163     return *this;
00164 }

void TupleDatum::copyFrom ( TupleDatum const &  other  )  [inline]

Copies data from source(shallow copy).

Note:
pData is set to the source data buffer. If pData points to any buffer before this call, it will no longer point to that buffer after this function call.
Parameters:
[in] other the source TupleDatum

Definition at line 166 of file TupleData.h.

References cbData, and pData.

Referenced by StringDesc::copyFrom(), operator=(), TupleDatum(), CountNullableAggComputer::updateAccumulator(), and CountStarAggComputer::updateAccumulator().

00167 {
00168     cbData = other.cbData;
00169     pData = other.pData;
00170 }

void TupleDatum::memCopyFrom ( TupleDatum const &  other  ) 

Copies data into TupleDatum's private buffer(deep copy).

Note:
pData must point to allocated memory before calling this function. If this TupleDatum is part of a TupleDataWithBuffer class, pData will point to valid memory after computeAndAllocate if no memory has been allocated yet, or resetBuffer if computeAndAllocate had previously been called. If this TupleDatum is not part of a TupleDataWithBuffer class, the caller needs to allocate buffer and set up the pData pointer manually.
Upon return, pData might no longer point to allocated memory if the source has a null data pointer.
Parameters:
[in] other the source TupleDatum

Definition at line 30 of file TupleData.cpp.

References cbData, and pData.

Referenced by ExtremeAggComputer::copyInputToAccumulator(), SumAggComputer< T >::initAccumulator(), ExtremeAggComputer::initAccumulator(), CountNullableAggComputer::initAccumulator(), CountStarAggComputer::initAccumulator(), DynamicParamManager::readParam(), SumAggComputer< T >::updateAccumulator(), ExtremeAggComputer::updateAccumulator(), and DynamicParamManager::writeParam().

00031 {
00032     cbData = other.cbData;
00033 
00034     /*
00035      * Performs memcpy from "other".
00036      * Sets pData to NULL if it is NULL in "other".
00037      */
00038     if (other.pData) {
00039         memcpy(
00040             const_cast<PBuffer>(pData),
00041             other.pData,
00042             other.cbData);
00043     } else {
00044         pData = other.pData;
00045     }
00046 }


Member Data Documentation

TupleStorageByteLength TupleDatum::cbData

Definition at line 46 of file TupleData.h.

Referenced by RegisterReference::cachePointer(), TupleTest::checkData(), checkEqualStr(), CalcExtStringTest::cmpTupStr(), CalcExtRegExpTest::cmpTupStr(), CalcExtCastTest::cmpTupStr(), UnalignedAttributeAccessor::compressInt64(), copyFrom(), LbmByteSegment::countBits(), CalcExtDateTimeTest::equals(), LbmSplicerExecStream::execute(), LhxHashGenerator::hashOneColumn(), SumAggComputer< T >::interpretDatum(), CountAggComputer::interpretDatum(), RegisterRef< char * >::length(), TupleTest::loadAndStore8ByteInt(), TupleTest::loadStore2ByteLenData(), TupleTest::loadStoreNullData(), UnalignedAttributeAccessor::loadValue(), TupleAccessor::marshal(), FixedWidthNetworkAccessor64::marshalValueData(), FixedWidthNetworkAccessor32::marshalValueData(), FixedWidthNetworkAccessor16::marshalValueData(), AttributeAccessorImpl::marshalValueData(), memCopyFrom(), LcsClusterReplaceExecStream::open(), BTreeInsertExecStream::open(), RegisterRef< char * >::pointer(), LbmUnionExecStream::prepare(), LbmSearchExecStream::prepare(), LbmBitOpExecStream::prepare(), LbmEntry::printDatum(), SegBufferWriterExecStream::readReaderRefCount(), RegisterRef< char * >::refer(), CalcAssembler::setTupleDatum(), CalcAssemblerTestCase::setTupleDatum(), LbmSplicerExecStreamTest::spliceInput(), UnalignedAttributeAccessor::storeValue(), StringDesc::stringLength(), LbmLoadBitmapTest::testLoad(), TupleTest::testLoadStoreUnaligned(), ExecStreamTestSuite::testReshapeExecStream(), LbmSearchTest::testScanIdx(), CalcAssemblerTestCase::toLiteralString(), TupleDatum(), UnalignedAttributeAccessor::uncompressInt64(), VarOffsetAccessor< network >::unmarshalValue(), FixedOffsetVarWidthAccessor< network >::unmarshalValue(), FixedWidthNetworkAccessor64::unmarshalValue(), FixedWidthNetworkAccessor32::unmarshalValue(), FixedWidthNetworkAccessor16::unmarshalValue(), ExtremeAggComputer::updateAccumulator(), TupleTest::writeMaxData(), CalcAssemblerTestCase::writeMaxData(), TupleTest::writeMinData(), CalcAssemblerTestCase::writeMinData(), DynamicParamManager::writeParam(), and TupleTest::writeSampleData().

PConstBuffer TupleDatum::pData

Definition at line 47 of file TupleData.h.

Referenced by add(), avg(), RegisterReference::cachePointer(), TupleTest::checkData(), checkEqualStr(), RegisterTestInfo< T >::checkTupleDatum(), CalcExtRegExpTest::cmpTupBool(), CalcExtCastTest::cmpTupBool(), CalcExtCastTest::cmpTupDouble(), CalcExtStringTest::cmpTupInt(), CalcExtRegExpTest::cmpTupInt(), CalcExtCastTest::cmpTupInt(), CalcExtCastTest::cmpTupInt64(), CalcExtStringTest::cmpTupNull(), CalcExtRegExpTest::cmpTupNull(), CalcExtCastTest::cmpTupNull(), CalcExtStringTest::cmpTupStr(), CalcExtRegExpTest::cmpTupStr(), CalcExtCastTest::cmpTupStr(), TupleDescriptor::compareTuples(), TupleDescriptor::compareTuplesKey(), UnalignedAttributeAccessor::compressInt64(), SumAggComputer< T >::computeOutput(), ExtremeAggComputer::computeOutput(), copyFrom(), count(), LbmByteSegment::countBits(), drop(), CalcExtDateTimeTest::equals(), LbmSplicerExecStream::execute(), CalcExecStream::execute(), firstValue(), RegisterReference::getBinding(), BTreeAccessBase::getChildForCurrent(), LhxHashGenerator::hashOneColumn(), histogramAlloc(), CountNullableAggComputer::initAccumulator(), SumAggComputer< T >::interpretDatum(), CountAggComputer::interpretDatum(), isNull(), RegisterRef< char * >::isNull(), lastValue(), TupleTest::loadAndStore8ByteInt(), TupleTest::loadStore2ByteLenData(), TupleTest::loadStoreNullData(), UnalignedAttributeAccessor::loadValue(), TupleAccessor::marshal(), FixedWidthNetworkAccessor64::marshalValueData(), FixedWidthNetworkAccessor32::marshalValueData(), FixedWidthNetworkAccessor16::marshalValueData(), AttributeAccessorImpl::marshalValueData(), max(), memCopyFrom(), min(), LcsClusterReplaceExecStream::open(), BTreeInsertExecStream::open(), StringDesc::pointer(), RegisterRef< char * >::pointer(), LbmUnionExecStream::prepare(), LbmSearchExecStream::prepare(), LbmBitOpExecStream::prepare(), LbmEntry::printDatum(), SegBufferWriterExecStream::readReaderRefCount(), RegisterRef< char * >::refer(), RegisterSetBinding::RegisterSetBinding(), setNull(), CalcAssembler::setTupleDatum(), CalcAssemblerTestCase::setTupleDatum(), RegisterTestInfo< T >::setTupleDatum(), CalcAssemblerTestCase::setTupleDatumNull(), LbmSplicerExecStreamTest::spliceInput(), BTreeWriter::splitCurrentNode(), UnalignedAttributeAccessor::storeValue(), sum(), LbmLoadBitmapTest::testLoad(), TupleTest::testLoadStoreUnaligned(), ExecStreamTestSuite::testReshapeExecStream(), LbmSearchTest::testScanIdx(), CalcAssemblerTestCase::toLiteralString(), RegisterRef< char * >::toNull(), TupleDatum(), tupleFiddle(), UnalignedAttributeAccessor::uncompressInt64(), AttributeAccessorImpl::unmarshalNullableValue(), BitAccessor::unmarshalValue(), VarOffsetAccessor< network >::unmarshalValue(), FixedOffsetVarWidthAccessor< network >::unmarshalValue(), FixedWidthNetworkAccessor64::unmarshalValue(), FixedWidthNetworkAccessor32::unmarshalValue(), FixedWidthNetworkAccessor16::unmarshalValue(), FixedWidthAccessor::unmarshalValue(), SumAggComputer< T >::updateAccumulator(), ExtremeAggComputer::updateAccumulator(), CountNullableAggComputer::updateAccumulator(), RegisterRef< char * >::value(), WinAggAddTest(), WinAggAddTestStr(), WinAggDropTest(), WinAggDropTestStr(), TupleTest::writeMaxData(), CalcAssemblerTestCase::writeMaxData(), TupleTest::writeMinData(), CalcAssemblerTestCase::writeMinData(), DynamicParamManager::writeParam(), and TupleTest::writeSampleData().

uint16_t TupleDatum::data16

Definition at line 51 of file TupleData.h.

Referenced by FixedWidthNetworkAccessor16::unmarshalValue().

uint32_t TupleDatum::data32

Definition at line 52 of file TupleData.h.

Referenced by FixedWidthNetworkAccessor32::unmarshalValue().

uint64_t TupleDatum::data64

Definition at line 53 of file TupleData.h.

Referenced by FixedWidthNetworkAccessor64::unmarshalValue().

union { ... }


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