SqlTypeMetadataFactory Class Reference

Constructs SqlTypeMetadata*s and fills them in with default values for SQL types. More...

List of all members.

Public Member Functions

SqlTypeMetadataCreateNewSqlTypeMetadata (simba_int16 in_sqlType, bool in_isUnsigned=false, TDWBufferOwnership in_bufferOwnership=TDW_BUFFER_OWNED)
 Creates a new SqlTypeMetadata*.
EncodingType GetSqlCharEncoding ()
 Gets the SqlCharEncoding of the SqlTypeMetadataFactory.
EncodingType GetSqlWCharEncoding ()
 Gets the SqlWCharEncoding of the SqlTypeMetadataFactory.
void SetSqlCharEncoding (EncodingType in_encoding)
 Sets the SqlCharEncoding for the SqlTypeMetadataFactory.
void SetSqlWCharEncoding (EncodingType in_encoding)
 Sets the SqlWCharEncoding for the SqlTypeMetadataFactory.
void SetTypeDefaults (simba_int16 in_sqlType, SqlTypeMetadata &io_typeMetadata)
 Sets default values for the given SQL type on the given SqlTypeMetadata.
void SetTypeSign (SqlTypeMetadata &io_typeMetadata, bool in_isUnsigned)
 Sets the values specific only to changing the sign of the metadata.
 SqlTypeMetadataFactory (SqlDataTypeUtilities *in_sqlDataTypeUtils)
 Constructor to be used when returning this from a connection instead of the singleton.
 SqlTypeMetadataFactory ()
 Constructor to be used for the singleton instance.
virtual ~SqlTypeMetadataFactory ()
 Destructor.

Protected Member Functions

virtual SqlTypeMetadataCreateNewCustomSqlTypeMetadata (simba_int16 in_sqlType, bool in_isUnsigned=false, TDWBufferOwnership in_bufferOwnership=TDW_BUFFER_OWNED)
 Creates a new custom SqlTypeMetadata*.
virtual bool SetCustomTypeDefaults (simba_int16 in_sqlType, SqlTypeMetadata &io_typeMetadata)
 Sets default values for the given SQL type on the given SqlTypeMetadata.
virtual bool SetCustomTypeSign (SqlTypeMetadata &io_typeMetadata, bool in_isUnsigned)
 Sets the values specific only to changing the sign of the metadata.
void SetStandardTypeDefaults (simba_int16 in_sqlType, SqlTypeMetadata &io_typeMetadata)
 Sets the values specific only to changing the sign of the metadata.
void SetStandardTypeSign (SqlTypeMetadata &io_typeMetadata, bool in_isUnsigned)
 Sets default values for the standard SQL types on the given SqlTypeMetadata.
void SetupStandardMetadata (SqlTypeMetadata &io_typeMetadata, simba_int16 in_sqlType, bool in_isUnsigned, TDWBufferOwnership in_bufferOwnership)
 Helper function to set up a SqlTypeMetadata of a standard SQL type.

Protected Attributes

SqlDataTypeUtilitiesm_sqlDataTypeUtils
 SqlDataTypeUtilities for the metadata that is constructed by this. (NOT OWNED).

Detailed Description

Constructs SqlTypeMetadata*s and fills them in with default values for SQL types.

Override the protected virtual function if you wish to support custom SqlTypeMetadata*s.

There is only one instance of this class. Access this instance via SqlTypeMetadataFactorySingleton::GetInstance().


Constructor & Destructor Documentation

Constructor to be used for the singleton instance.

SqlTypeMetadataFactory ( SqlDataTypeUtilities in_sqlDataTypeUtils  ) 

Constructor to be used when returning this from a connection instead of the singleton.

Parameters:
in_sqlDataTypeUtils SqlDataTypeUtilities for the metadata that is constructed by this. (NOT OWNED)
virtual ~SqlTypeMetadataFactory (  )  [virtual]

Destructor.


Member Function Documentation

virtual SqlTypeMetadata* CreateNewCustomSqlTypeMetadata ( simba_int16  in_sqlType,
bool  in_isUnsigned = false,
TDWBufferOwnership  in_bufferOwnership = TDW_BUFFER_OWNED 
) [protected, virtual]

Creates a new custom SqlTypeMetadata*.

This virtual protected function is meant to be over-ridden by the DSII subclass of this class, if custom SqlTypeMetadata*s are to be supported.

NOTE: in_sqlType does not necessarily have to be a user-defined SQL type. It could be a SQL type (e.g. SQL_CHAR) for which the DSII wants to override the SqlTypeMetadata.

NOTE: All user-defined SQL types _MUST_ be handled by this function. If a type is not supported, NULL should be returned.

Parameters:
in_sqlType The SQL type - could be user-defined.
in_isUnsigned Indicates whether the type is unsigned. True if it is unsigned; false if it is signed. False by default.
in_bufferOwnership The TDWBufferOwnership of the buffer. Defaults to TDW_BUFFER_OWNED.
Returns:
The newly created SqlTypeMetadata, or NULL if not supported. (OWN)
SqlTypeMetadata* CreateNewSqlTypeMetadata ( simba_int16  in_sqlType,
bool  in_isUnsigned = false,
TDWBufferOwnership  in_bufferOwnership = TDW_BUFFER_OWNED 
)

Creates a new SqlTypeMetadata*.

The in_bufferOwnership parameter indicates whether or not variable-length data own their buffer, or require it to be Attach()'ed.

This function delegates to CreateNewCustomSqlTypeMetadata() first. If it returns NULL, then this default implementation will be used.

DO NOT override this function. Override CreateNewCustomSqlTypeMetadata().

Parameters:
in_sqlType The SQL type.
in_isUnsigned Indicates whether the type is unsigned. True if it is unsigned; false if it is signed. False by default.
in_bufferOwnership The TDWBufferOwnership of the buffer. Defaults to TDW_BUFFER_OWNED.
Returns:
The newly created SqlTypeMetadata. (OWN)
EncodingType GetSqlCharEncoding (  ) 

Gets the SqlCharEncoding of the SqlTypeMetadataFactory.

Returns:
The current SqlCharEncoding.
EncodingType GetSqlWCharEncoding (  ) 

Gets the SqlWCharEncoding of the SqlTypeMetadataFactory.

Returns:
The current SqlWCharEncoding.
virtual bool SetCustomTypeDefaults ( simba_int16  in_sqlType,
SqlTypeMetadata io_typeMetadata 
) [protected, virtual]

Sets default values for the given SQL type on the given SqlTypeMetadata.

This virtual protected function is meant to be over-ridden by the DSII subclass of this class, if custom SqlTypeMetadata*s are to be supported.

NOTE: in_sqlType does not necessarily have to be a user-defined SQL type. It could be a SQL type (e.g. SQL_CHAR) for which the DSII wants to override the SqlTypeMetadata default values.

NOTE: All user-defined SQL types _MUST_ be handled by this function.

Parameters:
in_sqlType The SQL type.
io_typeMetadata The SqlTypeMetadata for which to set defaults.
Returns:
True if this function will set default values for the given type; false if it will not. This default implementation will always return 'false'.
virtual bool SetCustomTypeSign ( SqlTypeMetadata io_typeMetadata,
bool  in_isUnsigned 
) [protected, virtual]

Sets the values specific only to changing the sign of the metadata.

This virtual protected function is meant to be over-ridden by the DSII subclass of this class, if custom SqlTypeMetadata*s are to be supported.

NOTE: All user-defined SQL types _MUST_ be handled by this function.

Parameters:
io_typeMetadata The SqlTypeMetadata for which to set defaults.
in_isUnsigned Indicates whether the type is unsigned. True if it is unsigned; false if it is signed.
Returns:
true if the type was handled; false otherwise.
void SetSqlCharEncoding ( EncodingType  in_encoding  ) 

Sets the SqlCharEncoding for the SqlTypeMetadataFactory.

Parameters:
in_encoding The Input encoding to be set.
void SetSqlWCharEncoding ( EncodingType  in_encoding  ) 

Sets the SqlWCharEncoding for the SqlTypeMetadataFactory.

Parameters:
in_encoding The Input encoding to be set.
void SetStandardTypeDefaults ( simba_int16  in_sqlType,
SqlTypeMetadata io_typeMetadata 
) [protected]

Sets the values specific only to changing the sign of the metadata.

This function will not delegate to SetCustomTypeDefaults() first, but will always use the default implementation. This is useful to set the standard defaults for a type, and then tweak it if needed.

Parameters:
in_sqlType The SQL type.
io_typeMetadata The SqlTypeMetadata for which to set defaults.
void SetStandardTypeSign ( SqlTypeMetadata io_typeMetadata,
bool  in_isUnsigned 
) [protected]

Sets default values for the standard SQL types on the given SqlTypeMetadata.

This function will not delegate to SetCustomTypeSign() first, but will always use the default implementation.

Parameters:
io_typeMetadata The SqlTypeMetadata for which to set defaults.
in_isUnsigned Indicates whether the type is unsigned. True if it is unsigned; false if it is signed.
void SetTypeDefaults ( simba_int16  in_sqlType,
SqlTypeMetadata io_typeMetadata 
)

Sets default values for the given SQL type on the given SqlTypeMetadata.

This is a utility function that sets default values on the given SqlTypeMetadata for the given SQL type.

This function delegates to SetCustomTypeDefaults() first. If SetCustomTypeDefaults() returns 'false', then this default implementation will be used.

DO NOT override this function. Override SetCustomTypeDefaults().

Parameters:
in_sqlType The SQL type.
io_typeMetadata The SqlTypeMetadata for which to set defaults.
void SetTypeSign ( SqlTypeMetadata io_typeMetadata,
bool  in_isUnsigned 
)

Sets the values specific only to changing the sign of the metadata.

This function delegates to SetCustomTypeSign() first. If it returns false, then this default implementation will be used.

DO NOT override this function. Override SetCustomTypeSign().

Parameters:
io_typeMetadata The SqlTypeMetadata for which to set defaults.
in_isUnsigned Indicates whether the type is unsigned. True if it is unsigned; false if it is signed.
void SetupStandardMetadata ( SqlTypeMetadata io_typeMetadata,
simba_int16  in_sqlType,
bool  in_isUnsigned,
TDWBufferOwnership  in_bufferOwnership 
) [protected]

Helper function to set up a SqlTypeMetadata of a standard SQL type.

This is the default implementation that SimbaEngine uses.

Parameters:
io_typeMetadata The SqlTypeMetadata to set up.
in_sqlType The SQL type.
in_isUnsigned Indicates whether the type is unsigned. True if it is unsigned; false if it is signed.
in_bufferOwnership The TDWBufferOwnership of the buffer.
Exceptions:
ErrorException if in_sqlType is invalid.

Member Data Documentation

SqlDataTypeUtilities for the metadata that is constructed by this. (NOT OWNED).


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