DataLengthIter Class Reference

This class allows iteration on an input value/length buffer pairs. The pointer to the next element is computed by adding a fixed offset (one value for the value pointer and another one for the length). More...

List of all members.

Public Member Functions

 DataLengthIter (simba_unsigned_native in_numberOfParameters, const void *in_dataPtr, simba_signed_native in_dataOffset, const simba_signed_native *in_lengthPtr, simba_signed_native in_lengthOffset)
 Constructor.
 DataLengthIter ()
 Constructor.
const void * GetDataPtr () const
 Return the current data pointer.
simba_signed_native GetLength () const
 Return the current length pointer.
simba_unsigned_native GetNumberRemainingParameters () const
 Return the number of parameters that are still available in the iterator after the current one.
simba_unsigned_native GetPosition ()
 Get the current parameter number (start at 1).
simba_unsigned_nativeGetPositionRef ()
 Get a reference to the current parameter number (start at 1).
bool Next ()
 Add the data offset to the data pointer and the length offset to the length pointer in order to move to the next pair of data/length.
void Update (simba_unsigned_native in_numberOfParameters, const void *in_dataPtr, simba_signed_native in_dataOffset, const simba_signed_native *in_lengthPtr, simba_signed_native in_lengthOffset)
 Update the pointer and offset values.

Detailed Description

This class allows iteration on an input value/length buffer pairs. The pointer to the next element is computed by adding a fixed offset (one value for the value pointer and another one for the length).

At creation, the iterator points directly to the first element. Once the first parameter has been processed, the caller should call Next() to move to the next parameter. If none are available, data pointer won't be updated (they remain on the last element). Before using a parameter, it is however highly recommended to check if at least a parameter is available. Indeed if the iterator was created with no parameter, the data pointer will be NULL which could lead to NULL pointer access error if the value is used.

It is used initially for the Bulk writeback implementation and used as input/output parameter of the C to SQL bulk converters.


Constructor & Destructor Documentation

DataLengthIter (  )  [inline]

Constructor.

DataLengthIter ( simba_unsigned_native  in_numberOfParameters,
const void *  in_dataPtr,
simba_signed_native  in_dataOffset,
const simba_signed_native in_lengthPtr,
simba_signed_native  in_lengthOffset 
) [inline]

Constructor.

Parameters:
in_numberOfParameters Total number of parameters available in this iterator.
in_dataPtr Start of the data buffer.
in_dataOffset Offset to add to the data buffer pointer to get to the next element.
in_lengthPtr Start of the length buffer.
in_lengthOffset Offset to add to the length buffer pointer to get to the next element.

Member Function Documentation

const void* GetDataPtr (  )  const [inline]

Return the current data pointer.

Returns:
The current data pointer.
simba_signed_native GetLength (  )  const [inline]

Return the current length pointer.

Returns:
The current length pointer.
simba_unsigned_native GetNumberRemainingParameters (  )  const [inline]

Return the number of parameters that are still available in the iterator after the current one.

NOTE: It corresponds to the number of times a call to Next() will be successful.

Returns:
The number of parameters available, else 0.
simba_unsigned_native GetPosition (  )  [inline]

Get the current parameter number (start at 1).

Returns:
The current parameter number.
simba_unsigned_native& GetPositionRef (  )  [inline]

Get a reference to the current parameter number (start at 1).

The objective of returning such a reference is to use it with the conversion listener the bulk converters.

Returns:
A reference to the current parameter number.
bool Next (  )  [inline]

Add the data offset to the data pointer and the length offset to the length pointer in order to move to the next pair of data/length.

NOTE: After construction or calling Update(), the iterator is placed on the first data and length. The first call to Next() must be done after processing this first data and length.

Returns:
True if it is able to move to a next parameter, false if it has iterated over all parameters and is unable to move further (happens when GetNumberRemainingParameters() returns 0).
void Update ( simba_unsigned_native  in_numberOfParameters,
const void *  in_dataPtr,
simba_signed_native  in_dataOffset,
const simba_signed_native in_lengthPtr,
simba_signed_native  in_lengthOffset 
) [inline]

Update the pointer and offset values.

Parameters:
in_numberOfParameters Total number of parameters available in this iterator.
in_dataPtr Start of the data buffer.
in_dataOffset Offset to add to the data buffer pointer to get to the next element.
in_lengthPtr Start of the length buffer.
in_lengthOffset Offset to add to the length buffer pointer to get to the next element.

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