StoredTypeDescriptor Class Reference

StoredTypeDescriptor is an abstract class defining the datatypes which characterize values stored in tuples, as described in the design docs. More...

#include <StoredTypeDescriptor.h>

Inheritance diagram for StoredTypeDescriptor:

BinaryType CharType NumericType< T, typeOrdinal > UnicodeCharType UnicodeVarCharType VarBinaryType VarCharType List of all members.

Public Types

typedef uint Ordinal
 Each type must have a unique positive integer ordinal associated with it.

Public Member Functions

virtual ~StoredTypeDescriptor ()
virtual Ordinal getOrdinal () const=0
 
Returns:
the ordinal representing this type.

virtual uint getBitCount () const=0
 
Returns:
number of bits in marshalled representation, or 0 for a non-bit type; currently only 0 or 1 is supported

virtual uint getFixedByteCount () const=0
 
Returns:
the width in bytes for a fixed-width non-bit type which admits no per-attribute precision, or 0 for types with per-attribute precision; for bit types, this yields the size of the unmarshalled representation

virtual uint getMinByteCount (uint cbMaxWidth) const=0
 Gets the number of bytes required to store the narrowest value with this type, given a particular max byte count.
virtual uint getAlignmentByteCount (uint cbWidth) const =0
 Gets the alignment size in bytes required for values of this type, given a particular max byte count.
virtual void visitValue (DataVisitor &dataVisitor, void const *pData, TupleStorageByteLength cbData) const =0
 Visits a value of this type.
virtual int compareValues (void const *pData1, TupleStorageByteLength cbData1, void const *pData2, TupleStorageByteLength cbData2) const=0
 Compares two values of this type.

Detailed Description

StoredTypeDescriptor is an abstract class defining the datatypes which characterize values stored in tuples, as described in the design docs.

Definition at line 36 of file StoredTypeDescriptor.h.


Member Typedef Documentation

typedef uint StoredTypeDescriptor::Ordinal

Each type must have a unique positive integer ordinal associated with it.

This is used to reconstruct a StoredTypeDescriptor object from a stored attribute definition.

Definition at line 44 of file StoredTypeDescriptor.h.


Constructor & Destructor Documentation

StoredTypeDescriptor::~StoredTypeDescriptor (  )  [virtual]

Definition at line 34 of file StandardTypeDescriptor.cpp.

00035 {
00036 }


Member Function Documentation

virtual Ordinal StoredTypeDescriptor::getOrdinal (  )  const [pure virtual]

Returns:
the ordinal representing this type.

Implemented in NumericType< T, typeOrdinal >, CharType, UnicodeCharType, VarCharType, UnicodeVarCharType, BinaryType, and VarBinaryType.

Referenced by UnalignedAttributeAccessor::compute(), TupleAccessor::compute(), operator<<(), TupleAttributeDescriptor::operator==(), CalcAssemblerTestCase::setTupleDatum(), CalcAssemblerTestCase::setTupleDatumMax(), CalcAssemblerTestCase::setTupleDatumMin(), and TupleDescriptor::storageEqual().

virtual uint StoredTypeDescriptor::getBitCount (  )  const [pure virtual]

Returns:
number of bits in marshalled representation, or 0 for a non-bit type; currently only 0 or 1 is supported

Implemented in NumericType< T, typeOrdinal >, CharType, UnicodeCharType, VarCharType, UnicodeVarCharType, BinaryType, VarBinaryType, and NumericType< T, typeOrdinal >.

Referenced by TupleAccessor::compute().

virtual uint StoredTypeDescriptor::getFixedByteCount (  )  const [pure virtual]

Returns:
the width in bytes for a fixed-width non-bit type which admits no per-attribute precision, or 0 for types with per-attribute precision; for bit types, this yields the size of the unmarshalled representation

Implemented in NumericType< T, typeOrdinal >, CharType, UnicodeCharType, VarCharType, UnicodeVarCharType, BinaryType, and VarBinaryType.

Referenced by TupleAccessor::compute(), and TupleAttributeDescriptor::TupleAttributeDescriptor().

virtual uint StoredTypeDescriptor::getMinByteCount ( uint  cbMaxWidth  )  const [pure virtual]

Gets the number of bytes required to store the narrowest value with this type, given a particular max byte count.

For a fixed-width type, the return value is the same as the input.

Parameters:
cbMaxWidth maximum width for which to compute the minimum
Returns:
number of bytes

Implemented in NumericType< T, typeOrdinal >, CharType, UnicodeCharType, VarCharType, UnicodeVarCharType, BinaryType, and VarBinaryType.

Referenced by TupleAccessor::compute().

virtual uint StoredTypeDescriptor::getAlignmentByteCount ( uint  cbWidth  )  const [pure virtual]

Gets the alignment size in bytes required for values of this type, given a particular max byte count.

This must be 1, 2, 4, or 8, and may not be greater than 2 for variable-width datatypes. For fixed-width datatypes, the width must be a multiple of the alignment size.

Parameters:
cbWidth width for which to compute the alignment
Returns:
number of bytes

Implemented in NumericType< T, typeOrdinal >, CharType, UnicodeCharType, VarCharType, UnicodeVarCharType, BinaryType, and VarBinaryType.

Referenced by TupleTest::checkAlignment(), and TupleAccessor::compute().

virtual void StoredTypeDescriptor::visitValue ( DataVisitor dataVisitor,
void const *  pData,
TupleStorageByteLength  cbData 
) const [pure virtual]

Visits a value of this type.

Parameters:
dataVisitor the DataVisitor which should be called with the interpreted value
pData the address of the data value
cbData the number of bytes of data

Implemented in NumericType< T, typeOrdinal >, CharType, UnicodeCharType, VarCharType, UnicodeVarCharType, BinaryType, VarBinaryType, NumericType< T, typeOrdinal >, and NumericType< T, typeOrdinal >.

virtual int StoredTypeDescriptor::compareValues ( void const *  pData1,
TupleStorageByteLength  cbData1,
void const *  pData2,
TupleStorageByteLength  cbData2 
) const [pure virtual]

Compares two values of this type.

Parameters:
pData1 the address of the first data value
cbData1 the width of the first data value in bytes
pData2 the address of the second data value
cbData2 the width of the second data value in bytes
Returns:
negative if the first data value is less than the second; positive if greater; zero if equal

Implemented in NumericType< T, typeOrdinal >, CharType, UnicodeCharType, VarCharType, UnicodeVarCharType, BinaryType, and VarBinaryType.

Referenced by ExtremeAggComputer::updateAccumulator().


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