TypeMetadata Class Reference

Abstract base class that provides access to type metadata information. More...

Inherited by SqlCTypeMetadata, and SqlTypeMetadata.

List of all members.

Public Member Functions

virtual void CheckValidity () const =0
 Throws a BadTypeMetadataException if any metadata is invalid or inconsistent for the type.
virtual const std::map
< simba_int16, AttributeType > & 
GetCustomFields () const
 Returns a map of valid custom fields and their types.
EncodingType GetEncoding () const
 Returns encoding type used for wchar or char types.
virtual const AttributeDataGetField (simba_int16 in_fieldIdent) const
 Gets a custom metadata field from this type metadata. Throws an exception if in_fieldIdent is not supported for this type metadata. Default implementation throws InvalidOperationException because no custom fields are supported for default SqlCTypeMetadata.
NumericPrecisionRadix GetNumPrecRadix () const
 If the data type is an approximate numeric type, this method returns the value COLUMNSIZEISNUMBEROFBITS to indicate that COLUMN_SIZE specifies a number of bits.
simba_uint32 GetOctetLength (simba_uint32 in_columnSize, simba_uint8 in_wideCodeUnitSize) const
 Returns the octet length of this type.
simba_signed_native GetOctetLength () const
 Returns octet length in bytes as set by client.
TDWType GetTDWType () const
 Returns the internal type identifier.
bool IsAnyCharacterType () const
 Returns true if this type is a wide or non-wide character type.
bool IsApproximateNumericType () const
 Returns true if this type is an approximate numeric type.
bool IsBinaryType () const
 Returns true if this type is a binary type.
bool IsCharacterOrBinaryType () const
 Returns true if this type is a binary, a non-wide character, or a wide character type.
bool IsCharacterType () const
 Returns true if this type is a non-wide character type.
bool IsDateTimeType () const
 Returns true if this type is a datetime type.
bool IsExactNumericType () const
 Returns true if this type is an exact numeric type.
bool IsIntegerType () const
 Returns true if this type is an integer type.
bool IsIntervalType () const
 Returns true if this type is an interval type.
bool IsLOBType () const
 Returns true if this type is a large object (LOB) type.
bool IsNumberType () const
 Returns true if this type is a number type.
bool IsTimeType () const
 Returns true if this type is a time type.
bool IsWideCharacterType () const
 Returns true if this type is a wide character type.
void SetEncoding (EncodingType in_encoding)
 Sets the encoding used for wchar or char types.
virtual void SetField (simba_int16 in_fieldIdent, AutoPtr< AttributeData > in_value)
 Sets a custom metadata field on this type metadata Throws an exception if in_fieldIdent is not supported for this type metadata. Default implementation throws InvalidOperationException because no custom fields are supported for default SqlCTypeMetadata.
void SetIsApproximateNumericType (bool in_isApproximateNumericType)
 Sets the approximate numeric type indicator.
void SetIsBinaryType (bool in_isBinaryType)
 Sets the binary type indicator.
void SetIsCharacterType (bool in_isCharacterType)
 Sets the character type indicator.
void SetIsDateTimeType (bool in_isDateTimeType)
 Sets the date time type indicator.
void SetIsExactNumericType (bool in_isExactNumericType)
 Sets the exact numeric type indicator.
void SetIsIntegerType (bool in_isIntegerType)
 Sets the integer type indicator.
void SetIsIntervalType (bool in_isIntervalType)
 Sets the interval type indicator.
void SetIsLOBType (bool in_isLOBType)
 Sets the LOB type indicator.
void SetIsTimeType (bool in_isTimeType)
 Sets the time type indicator.
void SetIsWideCharacterType (bool in_isWideCharacterType)
 Sets the wide character type indicator.
void SetNumPrecRadix (NumericPrecisionRadix in_numPrecRadix)
 Sets the numeric precision radix.
void SetOctetLength (simba_signed_native in_octetLength)
 Sets the length, in octets (bytes), of the data.
void SetTDWType (TDWType in_tdwType)
 Sets the TDW type.
virtual ~TypeMetadata ()
 Destructor.

Protected Member Functions

void ClearTypeFlags ()
 Reset all the metadata type flags.
 TypeMetadata (const TypeMetadata &in_metadata)
 Copy constructor.
 TypeMetadata ()
 Constructor. Protected to avoid direct instantiation of this abstract base class.

Protected Attributes

EncodingType m_encoding
bool m_isApproximateNumericType
 Indicates whether this type is an approximate numeric type.
bool m_isBinaryType
 Indicates whether this type is a binary type.
bool m_isCharacterType
 Indicates whether this type is a non-wide character type.
bool m_isDateTimeType
 Indicates whether this type is a datetime type.
bool m_isExactNumericType
 Indicates whether this type is an exact numeric type.
bool m_isIntegerType
 Indicates whether this type is an integer type.
bool m_isIntervalType
 Indicates whether this type is an interval type.
bool m_isLOBType
 Indicates whether this type is a large object (LOB) type.
bool m_isTimeType
bool m_isWideCharacterType
 Indicates whether this type is a wide character type.
NumericPrecisionRadix m_numPrecRadix
simba_signed_native m_octetLength
TDWType m_tdwType

Detailed Description

Abstract base class that provides access to type metadata information.


Constructor & Destructor Documentation

virtual ~TypeMetadata (  )  [virtual]

Destructor.

TypeMetadata (  )  [protected]

Constructor. Protected to avoid direct instantiation of this abstract base class.

TypeMetadata ( const TypeMetadata in_metadata  )  [protected]

Copy constructor.

Parameters:
in_metadata 

Member Function Documentation

virtual void CheckValidity (  )  const [pure virtual]

Throws a BadTypeMetadataException if any metadata is invalid or inconsistent for the type.

Ignores values which don't matter for a particular type.

Implemented in SqlCTypeMetadata, and SqlTypeMetadata.

void ClearTypeFlags (  )  [protected]

Reset all the metadata type flags.

virtual const std::map<simba_int16, AttributeType>& GetCustomFields (  )  const [virtual]

Returns a map of valid custom fields and their types.

Returns:
Map of custom fields and their types
EncodingType GetEncoding (  )  const [inline]

Returns encoding type used for wchar or char types.

Returns:
The EncodingType.
virtual const AttributeData& GetField ( simba_int16  in_fieldIdent  )  const [virtual]

Gets a custom metadata field from this type metadata. Throws an exception if in_fieldIdent is not supported for this type metadata. Default implementation throws InvalidOperationException because no custom fields are supported for default SqlCTypeMetadata.

Parameters:
in_fieldIdent Field identifier to get the type for.
Returns:
The AttributeData for in_fieldIdent.
NumericPrecisionRadix GetNumPrecRadix (  )  const [inline]

If the data type is an approximate numeric type, this method returns the value COLUMNSIZEISNUMBEROFBITS to indicate that COLUMN_SIZE specifies a number of bits.

For exact numeric types, this method contains the value EXACTNUMERICTYPE to indicate that COLUMN_SIZE specifies a number of decimal digits. Otherwise, this method returns 0.

simba_uint32 GetOctetLength ( simba_uint32  in_columnSize,
simba_uint8  in_wideCodeUnitSize 
) const [inline]

Returns the octet length of this type.

If this type is a variable length character or binary type, then the octet length depends on in_columnSize and in_wideCodeUnitSize. If this type is a fixed-length type, then m_octetLength is returned.

Transfer octet length is the maximum number of bytes returned to the application when the data is transfered to its default C type.

Parameters:
in_columnSize The width of the column in number of elements. Only used for variable length types.
in_wideCodeUnitSize The number of bytes per code unit for wide character data.
Returns:
The transfer octet length.
simba_signed_native GetOctetLength (  )  const [inline]

Returns octet length in bytes as set by client.

Returns:
the length in bytes.
TDWType GetTDWType (  )  const [inline]

Returns the internal type identifier.

Has different values for signed and unsigned types.

bool IsAnyCharacterType (  )  const [inline]

Returns true if this type is a wide or non-wide character type.

Returns:
True if this type is a wide or non-wide character type; false otherwise.
bool IsApproximateNumericType (  )  const [inline]

Returns true if this type is an approximate numeric type.

Returns:
True if this type is an approximate numeric type; false otherwise.
bool IsBinaryType (  )  const [inline]

Returns true if this type is a binary type.

Returns:
True if this type is a binary type; false otherwise.
bool IsCharacterOrBinaryType (  )  const [inline]

Returns true if this type is a binary, a non-wide character, or a wide character type.

Returns:
True if this type is a binary, non-wide character, or wide character type; false otherwise.
bool IsCharacterType (  )  const [inline]

Returns true if this type is a non-wide character type.

Returns:
True if this type is a non-wide character type; false otherwise.
bool IsDateTimeType (  )  const [inline]

Returns true if this type is a datetime type.

Returns:
True if this type is a datetime type; false otherwise.
bool IsExactNumericType (  )  const [inline]

Returns true if this type is an exact numeric type.

Returns:
True if this type is an exact numeric type; false otherwise.
bool IsIntegerType (  )  const [inline]

Returns true if this type is an integer type.

Returns:
True if this type is an integer type; false otherwise.
bool IsIntervalType (  )  const [inline]

Returns true if this type is an interval type.

Returns:
True if this type is an interval type; false otherwise.
bool IsLOBType (  )  const [inline]

Returns true if this type is a large object (LOB) type.

Returns:
True if this type is an LOB type; false otherwise.
bool IsNumberType (  )  const [inline]

Returns true if this type is a number type.

This means any of integer, approximate numeric, or exact numeric.

Returns:
True if this type is a number type; false otherwise.
bool IsTimeType (  )  const [inline]

Returns true if this type is a time type.

Time types are TIME, TYPE_TIME, TIMESTAMP, TYPE_TIMESTAMP.

Returns:
True if this type is a time type; false otherwise.
bool IsWideCharacterType (  )  const [inline]

Returns true if this type is a wide character type.

Returns:
True if this type is a wide character type; false otherwise.
void SetEncoding ( EncodingType  in_encoding  )  [inline]

Sets the encoding used for wchar or char types.

Parameters:
in_encoding The EncodingType.
virtual void SetField ( simba_int16  in_fieldIdent,
AutoPtr< AttributeData in_value 
) [virtual]

Sets a custom metadata field on this type metadata Throws an exception if in_fieldIdent is not supported for this type metadata. Default implementation throws InvalidOperationException because no custom fields are supported for default SqlCTypeMetadata.

Parameters:
in_fieldIdent Field identifier to get the type for.
in_value The AttributeData to set for in_fieldIdent.
void SetIsApproximateNumericType ( bool  in_isApproximateNumericType  )  [inline]

Sets the approximate numeric type indicator.

Parameters:
in_isApproximateNumericType The approximate numeric type indicator.
void SetIsBinaryType ( bool  in_isBinaryType  )  [inline]

Sets the binary type indicator.

Parameters:
in_isBinaryType The binary type indicator.
void SetIsCharacterType ( bool  in_isCharacterType  )  [inline]

Sets the character type indicator.

Parameters:
in_isCharacterType The character type indicator.
void SetIsDateTimeType ( bool  in_isDateTimeType  )  [inline]

Sets the date time type indicator.

Parameters:
in_isDateTimeType The date time type indicator.
void SetIsExactNumericType ( bool  in_isExactNumericType  )  [inline]

Sets the exact numeric type indicator.

Parameters:
in_isExactNumericType The exact numeric type indicator.
void SetIsIntegerType ( bool  in_isIntegerType  )  [inline]

Sets the integer type indicator.

Parameters:
in_isIntegerType The integer type indicator.
void SetIsIntervalType ( bool  in_isIntervalType  )  [inline]

Sets the interval type indicator.

Parameters:
in_isIntervalType The interval type indicator.
void SetIsLOBType ( bool  in_isLOBType  )  [inline]

Sets the LOB type indicator.

Parameters:
in_isLOBType The LOB type indicator.
void SetIsTimeType ( bool  in_isTimeType  )  [inline]

Sets the time type indicator.

Time types are TIME, TYPE_TIME, TIMESTAMP, TYPE_TIMESTAMP.

Parameters:
in_isTimeType The time type indicator.
void SetIsWideCharacterType ( bool  in_isWideCharacterType  )  [inline]

Sets the wide character type indicator.

Parameters:
in_isWideCharacterType The wide character type indicator.
void SetNumPrecRadix ( NumericPrecisionRadix  in_numPrecRadix  )  [inline]

Sets the numeric precision radix.

Parameters:
in_numPrecRadix The numeric precision radix.
void SetOctetLength ( simba_signed_native  in_octetLength  )  [inline]

Sets the length, in octets (bytes), of the data.

Parameters:
in_octetLength The length in bytes.
void SetTDWType ( TDWType  in_tdwType  )  [inline]

Sets the TDW type.

Parameters:
in_tdwType The TDW type.

Member Data Documentation

EncodingType m_encoding [protected]
bool m_isApproximateNumericType [protected]

Indicates whether this type is an approximate numeric type.

bool m_isBinaryType [protected]

Indicates whether this type is a binary type.

bool m_isCharacterType [protected]

Indicates whether this type is a non-wide character type.

bool m_isDateTimeType [protected]

Indicates whether this type is a datetime type.

bool m_isExactNumericType [protected]

Indicates whether this type is an exact numeric type.

bool m_isIntegerType [protected]

Indicates whether this type is an integer type.

bool m_isIntervalType [protected]

Indicates whether this type is an interval type.

bool m_isLOBType [protected]

Indicates whether this type is a large object (LOB) type.

bool m_isTimeType [protected]

Indicates whether this type is a time type. TIME, TYPE_TIME, TIMESTAMP, and TYPE_TIMESTAMP are time types. NOTE this is a subset of datetime types.

bool m_isWideCharacterType [protected]

Indicates whether this type is a wide character type.

Size of the buffer in number of bytes. For SQL types, does not include space for null terminator. For SQL C types, does include space for null terminator. Should be ignored for fixed-length types.

TDWType m_tdwType [protected]

The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba