AttributeAccessor Class Reference

AttributeAccessor defines how to efficiently unmarshal the value of an attribute from a stored tuple. More...

#include <AttributeAccessor.h>

Inheritance diagram for AttributeAccessor:

AttributeAccessorImpl BitAccessor FixedOffsetVarWidthAccessor< network > FixedWidthAccessor VarOffsetAccessor< network > FixedWidthNetworkAccessor16 FixedWidthNetworkAccessor32 FixedWidthNetworkAccessor64 List of all members.

Public Member Functions

virtual ~AttributeAccessor ()
virtual void unmarshalValue (TupleAccessor const &tupleAccessor, TupleDatum &value) const=0
 Unmarshals the attribute's value by setting up the data pointer, length, and null indicator; does not actually copy any data.
virtual void marshalValueData (PBuffer pDestData, TupleDatum const &value) const=0
 Marshals value data for the attribute.

Public Attributes

uint iNullBit
 Index of this attribute's null indicator bit in the tuple's bit array, or MAXU for a NOT NULL attribute.
uint iFixedOffset
 Byte offset of this attribute within a stored tuple image, or MAXU if the start is variable.
uint iEndIndirectOffset
 Indirect offset of the end of this attribute within a stored tuple image, or MAXU if the end is fixed.
uint iValueBit
 Index of this attribute's value in the tuple's bit array, or MAXU for a non-bit attribute.
TupleStorageByteLength cbStorage
 Copied from TupleAttributeDescriptor.cbStorage.

Detailed Description

AttributeAccessor defines how to efficiently unmarshal the value of an attribute from a stored tuple.

Derived classes implement various strategies depending on the storage type.

All data members are defined at this level rather than in derived classes, which only provide method implementations. This makes it possible to write non-polymorphic access code in cases where the entire tuple is being processed, but polymorphic access code in cases where only a small subset of the attributes are being processed. In theory, this hybrid should yield the highest efficiency, but it needs to be benchmarked and tuned.

Definition at line 46 of file AttributeAccessor.h.


Constructor & Destructor Documentation

AttributeAccessor::~AttributeAccessor (  )  [virtual]

Definition at line 29 of file AttributeAccessorImpl.cpp.

00030 {
00031 }


Member Function Documentation

virtual void AttributeAccessor::unmarshalValue ( TupleAccessor const &  tupleAccessor,
TupleDatum value 
) const [pure virtual]

Unmarshals the attribute's value by setting up the data pointer, length, and null indicator; does not actually copy any data.

Parameters:
tupleAccessor containing TupleAccessor set up with the current tuple image to be accessed
value receives the reference to the unmarshalled value

Implemented in FixedWidthAccessor, FixedWidthNetworkAccessor16, FixedWidthNetworkAccessor32, FixedWidthNetworkAccessor64, FixedOffsetVarWidthAccessor< network >, VarOffsetAccessor< network >, and BitAccessor.

Referenced by BTreeAccessBase::getChildForCurrent(), BTreeWriter::splitCurrentNode(), and TupleTest::testMarshal().

virtual void AttributeAccessor::marshalValueData ( PBuffer  pDestData,
TupleDatum const &  value 
) const [pure virtual]

Marshals value data for the attribute.

Only deals with the data bytes, not length and null indicators.

Parameters:
pDestData the target address where the data should be marshalled
value the value to be marshalled

Implemented in AttributeAccessorImpl, FixedWidthNetworkAccessor16, FixedWidthNetworkAccessor32, and FixedWidthNetworkAccessor64.

Referenced by TupleAccessor::marshal().


Member Data Documentation

uint AttributeAccessor::iNullBit

Index of this attribute's null indicator bit in the tuple's bit array, or MAXU for a NOT NULL attribute.

Definition at line 53 of file AttributeAccessor.h.

Referenced by AttributeAccessorImpl::AttributeAccessorImpl(), TupleAccessor::compute(), Java_net_sf_farrago_fennel_FennelStorage_getAccessorXmiForTupleDescriptor(), TupleAccessor::marshal(), and TupleAccessor::unmarshal().

uint AttributeAccessor::iFixedOffset

Byte offset of this attribute within a stored tuple image, or MAXU if the start is variable.

Definition at line 59 of file AttributeAccessor.h.

Referenced by AttributeAccessorImpl::AttributeAccessorImpl(), TupleAccessor::compute(), TupleAccessor::initFixedAccessors(), TupleAccessor::marshal(), TupleAccessor::unmarshal(), and FixedOffsetVarWidthAccessor< network >::unmarshalValue().

uint AttributeAccessor::iEndIndirectOffset

Indirect offset of the end of this attribute within a stored tuple image, or MAXU if the end is fixed.

Definition at line 65 of file AttributeAccessor.h.

Referenced by AttributeAccessorImpl::AttributeAccessorImpl(), TupleAccessor::marshal(), TupleAccessor::unmarshal(), VarOffsetAccessor< network >::unmarshalValue(), and FixedOffsetVarWidthAccessor< network >::unmarshalValue().

uint AttributeAccessor::iValueBit

Index of this attribute's value in the tuple's bit array, or MAXU for a non-bit attribute.

Definition at line 71 of file AttributeAccessor.h.

Referenced by AttributeAccessorImpl::AttributeAccessorImpl(), TupleAccessor::marshal(), and TupleAccessor::unmarshal().

TupleStorageByteLength AttributeAccessor::cbStorage

Copied from TupleAttributeDescriptor.cbStorage.

This is not used for anything except assertions.

Definition at line 77 of file AttributeAccessor.h.

Referenced by AttributeAccessorImpl::AttributeAccessorImpl(), TupleAccessor::compute(), TupleAccessor::marshal(), TupleAccessor::unmarshal(), VarOffsetAccessor< network >::unmarshalValue(), and FixedOffsetVarWidthAccessor< network >::unmarshalValue().


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