ETDataRequest Class Reference

List of all members.

Public Member Functions

void CreateSqlData (simba_int16 in_sqlType, bool in_isUnsigned)
 Creates a buffer object to which to copy the data.
void CreateSqlData (SqlTypeMetadata *in_metadata, bool in_cloneMetadata=true)
 Creates a buffer object to which to copy the data.
 ETDataRequest (const ETDataRequest &in_another)
 Copy constructor.
 ETDataRequest (SqlTypeMetadata *in_metadata, bool in_cloneMetadata)
 Constructor.
 ETDataRequest (SqlData *in_sqlData, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Constructor.
 ETDataRequest ()
 Default Constructor.
simba_signed_native GetMaxSize () const
 Get the maximum number bytes to copy.
simba_signed_native GetOffset () const
 Get the offset in number of bytes in the data to skip before copying.
SqlDataGetSqlData ()
 Get a pointer reference to the SqlData object.
const SqlDataGetSqlData () const
 Get a pointer reference to the SqlData object.
bool IsDefault () const
 Get if the data request was for a default value.
ETDataRequestoperator= (const ETDataRequest &in_another)
 Assignment operator.
bool SatisfyWith (const void *in_buffer, simba_uint32 in_length)
 Satisfy this data request with data from the given buffer.
bool SatisfyWith (const simba_wstring &in_dataSource)
 Satisfy this data request with data from the given string.
void SetIsDefault (bool in_isDefault)
 Set if the data represents a default value.
void SetMaxSize (simba_signed_native in_maxSize)
 Set the maximum number of bytes to copy.
void SetOffset (simba_signed_native in_offset)
 Set the offset in number of bytes in the data to skip before copying.
void SetSqlData (SqlData *in_sqlData)
 Set a pointer reference to the buffer object to which to copy the data.
 ~ETDataRequest ()
 Destructor.

Detailed Description

This container class encapsulates the arguments needed to retrieve the data value from an expression execution node. Not surprisingly, the arguments that it encapsulates are also some of arguments needed to retrieve the data value from an ETRelationalExpr node.

An object of this class is designed to be passed by reference and live on the stack. This not only is more convenient but also more efficient especially when the execution tree is deep. The arguments needed to retrieve the data value do not need to be copied from one tree level to the next.

All data retrieval from an execution tree follows the following procedure,

(1) If the data is null, call m_sqlData->SetNull(true). m_offset and m_maxSize are ignored.

(2) If the data is not of a character or binary type, then the value should be copied into the pointer returned by m_sqlData->GetBuffer(). m_offset and m_maxSize are ignored.

(3) If the data is of a character or binary type: (a) m_offset specifies the starting point to copy data from, in # of bytes from the start of that piece of data (b) m_offset must be aligned properly to the start of a data element (c) m_maxSize indicates the maximum number of bytes to copy (d) if m_maxSize is RETRIEVE_ALL_DATA, it means that the whole piece of data should be copied (e) the size of the data chunk being copied should be set with m_sqlData->SetLength() (f) this length is the number of full elements copied (g) if there's only room for a partial element at the end, it does not need to be copied, and should not be included in the SetLength() length (h) calling SetLength() must be done before copying data in, because it modifies the size of the data buffer (i) the chunk of data starting at m_offset which is at a maximum in_size bytes long should be copied into the pointer returned by m_sqlData->GetBuffer(). (j) null termination is not necessary, though for character data the buffer has extra room available at the end for a null terminator


Constructor & Destructor Documentation

ETDataRequest (  )  [inline]

Default Constructor.

ETDataRequest ( SqlData in_sqlData,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [inline]

Constructor.

Parameters:
in_sqlData Holds a buffer to store the requested data. (NOT OWN)
in_offset Number of bytes in the data to skip before copying into in_data.
in_maxSize Maximum number of bytes of data to return in in in_data.
Exceptions:
SEInvalidArgumentException when in_sqlData is NULL
ETDataRequest ( SqlTypeMetadata in_metadata,
bool  in_cloneMetadata 
)

Constructor.

NOTE: In this case, the newly created SqlData object is owned by this object.

Parameters:
in_metadata The metadata of the type to create. Cannot be NULL. (NOT OWN)
in_cloneMetadata Indicates if the given metadata should be cloned or just referenced. It is faster to just reference the metadata but the lifetime of the metadata must be longer than the data request.
Exceptions:
SEInvalidArgumentException when in_metadata is NULL.
~ETDataRequest (  ) 

Destructor.

ETDataRequest ( const ETDataRequest in_another  ) 

Copy constructor.

Parameters:
in_another Another object.

Member Function Documentation

void CreateSqlData ( simba_int16  in_sqlType,
bool  in_isUnsigned 
)

Creates a buffer object to which to copy the data.

NOTE: In this case, the newly created SqlData object is owned by this object. Also, the newly created SqlData will have DEFAULT metadata values.

Parameters:
in_sqlType The SQL type of the data to create.
in_isUnsigned True if the SQL type is unsigned; false otherwise.
void CreateSqlData ( SqlTypeMetadata in_metadata,
bool  in_cloneMetadata = true 
)

Creates a buffer object to which to copy the data.

NOTE: In this case, the newly created SqlData object is owned by this object.

Parameters:
in_metadata The metadata of the type to create. Cannot be NULL. (NOT OWN)
in_cloneMetadata Indicates if the given metadata should be cloned or just referenced. It is faster to just reference the metadata but the lifetime of the metadata must be longer than the data request.
Exceptions:
SEInvalidArgumentException when in_metadata is NULL.
simba_signed_native GetMaxSize (  )  const [inline]

Get the maximum number bytes to copy.

Returns:
the maximum number bytes to copy.
simba_signed_native GetOffset (  )  const [inline]

Get the offset in number of bytes in the data to skip before copying.

Returns:
the offset in number of bytes in the data to skip before copying.
SqlData* GetSqlData (  )  [inline]

Get a pointer reference to the SqlData object.

Returns:
a pointer reference to the SqlData object. (NOT OWN)
const SqlData* GetSqlData (  )  const [inline]

Get a pointer reference to the SqlData object.

Returns:
a pointer reference to the SqlData object. (NOT OWN)
bool IsDefault (  )  const [inline]

Get if the data request was for a default value.

Returns:
true if the data represents a default value; false otherwise.
ETDataRequest& operator= ( const ETDataRequest in_another  ) 

Assignment operator.

Parameters:
in_another Another object.
bool SatisfyWith ( const void *  in_buffer,
simba_uint32  in_length 
)

Satisfy this data request with data from the given buffer.

NOTE: This may only be used for var-length types.

Parameters:
in_buffer The buffer containing the data to satisfy this request with. (NOT OWN)
in_length The length of in_buffer, in bytes.
Returns:
True if the data was truncated, false otherwise.
bool SatisfyWith ( const simba_wstring in_dataSource  ) 

Satisfy this data request with data from the given string.

Parameters:
in_dataSource The data source to fulfill this data request with.
Returns:
True if the data was truncated, false otherwise.
void SetIsDefault ( bool  in_isDefault  )  [inline]

Set if the data represents a default value.

Parameters:
in_isDefault True if the data represents a default value; false otherwise.
void SetMaxSize ( simba_signed_native  in_maxSize  )  [inline]

Set the maximum number of bytes to copy.

Parameters:
in_maxSize The maximum number of bytes to copy.
void SetOffset ( simba_signed_native  in_offset  )  [inline]

Set the offset in number of bytes in the data to skip before copying.

Parameters:
in_offset The offset in bytes in the data to skip before copying.
void SetSqlData ( SqlData in_sqlData  ) 

Set a pointer reference to the buffer object to which to copy the data.

Parameters:
in_sqlData The buffer object to which to copy the data. Cannot be NULL. (NOT OWN)
Exceptions:
SEInvalidArgumentException when in_sqlData is NULL.

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

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