RDM::DB::read_row< table_id > Class Template Reference

Template Class for reading a row. More...

#include "rdm_db_read_row.h"

Public Member Functions

uint8_t * serialize (uint8_t *buffer)
uint8_t * unserialize (uint8_t *buffer)
RDM_RETCODE fetch (direction dir, bool first_or_last)
Fetch a row. More...
read_row & operator= (const read_row &)
read_row (const read_row &r)
read_row ()
~read_row ()
uint32_t init_tables_to_write_lock (RDM_TABLE_ID *)
IDs of the tables where rows are inserted. More...
uint32_t init_tables_to_read_lock (RDM_TABLE_ID *tables)
IDs of the tables where rows are read. More...
RDM_RETCODE init (RDM_DB p_db)
Initialize this object. More...
void reset (void)
Reset this object. More...
template<class TARGET_ROW_T >
RDM_RETCODE bind_row (TARGET_ROW_T *target_row)
Bind a row. More...
RDM_RETCODE get_rows (void)
Get rows. More...
RDM_RETCODE get_rows_by_key (RDM_KEY_ID key_id)
Get rows by key. More...
template<class KEY_T >
RDM_RETCODE get_rows_by_key (RDM_KEY_ID key_id, const KEY_T *startValue, const KEY_T *endValue)
Get rows by key within a key range. More...
template<class KEY_T >
RDM_RETCODE get_rows_by_key (RDM_KEY_ID key_id, const KEY_T *value)
Get rows by key for a give key value. More...
template<class KEY_T >
RDM_RETCODE get_rows_from_key (RDM_KEY_ID key_id, const KEY_T *startValue)
Get rows by key within a key range that is open at the end. More...
template<class KEY_T >
RDM_RETCODE get_rows_to_key (RDM_KEY_ID key_id, const KEY_T *endValue)
Get rows by key within a key range that is open at the beginning. More...
RDM_RETCODE get_rows_by_key (RDM_KEY_ID key_id, const RDM_RANGE_KEY *startValue, const RDM_RANGE_KEY *endValue)
Get rows by key within a key range. More...
RDM_RETCODE get_rows_by_key (RDM_KEY_ID key_id, const RDM_RANGE_KEY *value)
Get rows by key for a give key value. More...
RDM_RETCODE get_rows_from_key (RDM_KEY_ID key_id, const RDM_RANGE_KEY *startValue)
Get rows by key within a key range that is open at the end. More...
RDM_RETCODE get_rows_to_key (RDM_KEY_ID key_id, const RDM_RANGE_KEY *endValue)
Get rows by key within a key range that is open at the beginning. More...
RDM_RETCODE get_rows_by_key (RDM_KEY_ID key_id, const RDM_SEARCH_KEY *startValue, const RDM_SEARCH_KEY *endValue)
Get rows by key within a key range. More...
RDM_RETCODE get_rows_by_key (RDM_KEY_ID key_id, const RDM_SEARCH_KEY *value)
Get rows by key for a give key value. More...
RDM_RETCODE get_rows_from_key (RDM_KEY_ID key_id, const RDM_SEARCH_KEY *startValue)
Get rows by key within a key range that is open at the end. More...
RDM_RETCODE get_rows_to_key (RDM_KEY_ID key_id, const RDM_SEARCH_KEY *endValue)
Get rows by key within a key range that is open at the beginning. More...
RDM_RETCODE get_rows_by_rtree_key (RDM_KEY_ID key_id, const RDM_RTREE_KEY *value)
Get rows by an R-tree key. More...
RDM_RETCODE fetch_first (void)
Fetch the first row. More...
RDM_RETCODE fetch_prev (void)
Fetch the previouse row. More...
RDM_RETCODE fetch_next (void)
Fetch the next row. More...
RDM_RETCODE fetch_last (void)
Fetch the first row. More...

Static Public Member Functions

constexpr static int get_serialize_size (void)
Get the size of a buffer for serialization to hold its state. More...
constexpr static int number_of_tables_to_write_lock (void)
Number of tables where rows are inserted. More...
constexpr static int number_of_tables_to_read_lock (void)
Number of tables where rows are read. More...

Data Fields

RDM_DB db
RDM_CURSOR cursor
void * target_row
uint32_t target_size

Friends

template<RDM_TABLE_ID any_table_id, class ANY_NEXT >
class join_rows_to_many
template<RDM_TABLE_ID any_table_id, class ANY_NEXT >
class join_rows_to_one

Detailed Description

template<RDM_TABLE_ID table_id>
class RDM::DB::read_row< table_id >

Template Class for reading a row.

Template class for reading rows from a table specifed by the template parameter table_id.

Initialize the class by calling init() with a valid database handle. Bind an application row buffer using bind_row(). A set of rows from the table specified by the template parameter

Template Parameters
table_id with a given order can be associated by calling any of the following methods: get_rows_by_key(), TBD.

The application row buffer will be populated when any of the navigational fetch methods are called such as fetch_first(), fetch_prev(), fetch_next(), or fetch_last().

This class can be used in a chain of template classes for doing a join or a series of nested joins where this class is the last class in the chain. When this class is used in a chain of classes the navigational fetch methods for this class should normally not be called directly. The application should instead call the navigational fetch methods of thse first class the chain. The other classes in the chain will fetch from its next class when additional rows are needed. See RaimaDB Database Query APIs for details.

Template Parameters
table_id The ID of the table to read rows from

Constructor & Destructor Documentation

read_row() [1/2]

template<RDM_TABLE_ID table_id>
RDM::DB::read_row< table_id >::read_row ( const read_row< table_id > & r )
inline
157 : cursor (NULL), target_row (NULL)
158 {
159 }

read_row() [2/2]

template<RDM_TABLE_ID table_id>
RDM::DB::read_row< table_id >::read_row ( )
inline
161 : cursor (NULL), target_row (NULL)
162 {
163 }

~read_row()

template<RDM_TABLE_ID table_id>
RDM::DB::read_row< table_id >::~read_row ( )
inline
165 {
166if (cursor)
167 {
169 }
170 }

References RDM::DB::read_row< table_id >::cursor, and rdm_cursorFree().

Here is the call graph for this function:

Member Function Documentation

bind_row()

template<RDM_TABLE_ID table_id>
template<class TARGET_ROW_T >
RDM_RETCODE RDM::DB::read_row< table_id >::bind_row ( TARGET_ROW_T * target_row )
inline

Bind a row.

Bind an application target row. For each row that is fetched one actual row in that set will be populated into the buffers specified here.

Only one buffer is provided here as opposed to other classes.

Template Parameters
TARGET_ROW_T The type for the application target row struct definition
Return values
sOKAY Normal, successful return.
Parameters
[in] target_row The target the rows are fetched into
260 {
262target_size = sizeof (TARGET_ROW_T);
263
264return sOKAY;
265 }

References sOKAY, RDM::DB::read_row< table_id >::target_row, and RDM::DB::read_row< table_id >::target_size.

fetch()

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::fetch ( direction dir,
bool first_or_last
)
inline

Fetch a row.

A generalized fetch which is the actual methode used by other classes when this class is set up in a chain.

Return values
sOKAY Normal, successful return.
sENDOFCURSOR Reached the end of the cursor collection.
eINVITERATION Invalid attempt to move cursor before 'BeforeFirst' or past 'AfterLast'.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
eCATMISMATCH Catalog in memory does not match Catalog on disk.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
Parameters
[in] dir The direction we are fetching
[in] first_or_last Wheter we are fetching one of the extremes such as the first or the last as opposed to the next or the previous
118 {
119RDM_RETCODE rc;
120if (first_or_last)
121 {
122if (dir == direction_forward)
123 {
124 rc = fetch_first ();
125 }
126else
127 {
128 rc = fetch_last ();
129 }
130 }
131else
132 {
133if (dir == direction_forward)
134 {
135 rc = fetch_next ();
136 }
137else
138 {
139 rc = fetch_prev ();
140 }
141 }
142
143return rc;
144 }

References RDM::DB::direction_forward, RDM::DB::read_row< table_id >::fetch_first(), RDM::DB::read_row< table_id >::fetch_last(), RDM::DB::read_row< table_id >::fetch_next(), and RDM::DB::read_row< table_id >::fetch_prev().

Here is the call graph for this function:

fetch_first()

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::fetch_first ( void )
inline

Fetch the first row.

Fetch the first row from the actual table. This navigation is done independent of any previously set position. A new position will be establshed for a successfull return.

If a row has been bound using bind_row() the row will be read and poputated into the buffers provided.

Return values
sOKAY Normal, successful return.
sENDOFCURSOR Reached the end of the cursor collection.
eINVITERATION Invalid attempt to move cursor before 'BeforeFirst' or past 'AfterLast'.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
eCATMISMATCH Catalog in memory does not match Catalog on disk.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
572 {
574if (rc == sOKAY && this->target_row)
575 {
576 rc = rdm_cursorReadRow (cursor, this->target_row, target_size, NULL);
577 }
578
579return rc;
580 }

References RDM::DB::read_row< table_id >::cursor, rdm_cursorMoveToFirst(), rdm_cursorReadRow(), sOKAY, and RDM::DB::read_row< table_id >::target_size.

Referenced by RDM::DB::read_row< table_id >::fetch().

Here is the call graph for this function:
Here is the caller graph for this function:

fetch_last()

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::fetch_last ( void )
inline

Fetch the first row.

Fetch the first row from the actual table. This navigation is done independent of any previously set position. A new position will be establshed for a successfull return.

If a row has been bound using bind_row() the row will be read and poputated into the buffers provided.

Return values
sOKAY Normal, successful return.
sENDOFCURSOR Reached the end of the cursor collection.
eINVITERATION Invalid attempt to move cursor before 'BeforeFirst' or past 'AfterLast'.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
eCATMISMATCH Catalog in memory does not match Catalog on disk.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
668 {
670if (rc == sOKAY && this->target_row)
671 {
672 rc = rdm_cursorReadRow (cursor, this->target_row, target_size, NULL);
673 }
674
675return rc;
676 }

References RDM::DB::read_row< table_id >::cursor, rdm_cursorMoveToLast(), rdm_cursorReadRow(), sOKAY, and RDM::DB::read_row< table_id >::target_size.

Referenced by RDM::DB::read_row< table_id >::fetch().

Here is the call graph for this function:
Here is the caller graph for this function:

fetch_next()

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::fetch_next ( void )
inline

Fetch the next row.

Fetch the next row from the actual table. This navigation is done based on a previously set position and a new position will be establshed for a successfull return.

If a row has been bound using bind_row() the row will be read and poputated into the buffers provided.

Return values
sOKAY Normal, successful return.
sENDOFCURSOR Reached the end of the cursor collection.
eINVITERATION Invalid attempt to move cursor before 'BeforeFirst' or past 'AfterLast'.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
eCATMISMATCH Catalog in memory does not match Catalog on disk.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
637 {
639if (rc == sOKAY && this->target_row)
640 {
641 rc = rdm_cursorReadRow (cursor, this->target_row, target_size, NULL);
642 }
643
644return rc;
645 }

References RDM::DB::read_row< table_id >::cursor, rdm_cursorMoveToNext(), rdm_cursorReadRow(), sOKAY, and RDM::DB::read_row< table_id >::target_size.

Referenced by RDM::DB::read_row< table_id >::fetch().

Here is the call graph for this function:
Here is the caller graph for this function:

fetch_prev()

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::fetch_prev ( void )
inline

Fetch the previouse row.

Fetch the previous row from the actual table. This navigation is done based on a previously set position and a new position will be establshed for a successfull return.

If a row has been bound using bind_row() the row will be read and poputated into the buffers provided.

Return values
sOKAY Normal, successful return.
sENDOFCURSOR Reached the end of the cursor collection.
eINVITERATION Invalid attempt to move cursor before 'BeforeFirst' or past 'AfterLast'.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
eCATMISMATCH Catalog in memory does not match Catalog on disk.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
604 {
606
607if (rc == sOKAY && this->target_row)
608 {
609 rc = rdm_cursorReadRow (cursor, this->target_row, target_size, NULL);
610 }
611
612return rc;
613 }

References RDM::DB::read_row< table_id >::cursor, rdm_cursorMoveToPrevious(), rdm_cursorReadRow(), sOKAY, and RDM::DB::read_row< table_id >::target_size.

Referenced by RDM::DB::read_row< table_id >::fetch().

Here is the call graph for this function:
Here is the caller graph for this function:

get_rows()

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows ( void )
inline

Get rows.

Set up this class to get the rows from a give table.

Return values
sOKAY Normal, successful return.
eINVTABID Invalid table id.
eDBNOTOPEN Database not open.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
277 {
278RDM_RETCODE rc = rdm_dbGetRows (db, table_id, &cursor);
279return rc;
280 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRows().

Here is the call graph for this function:

get_rows_by_key() [1/7]

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_by_key ( RDM_KEY_ID key_id )
inline

Get rows by key.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
294 {
295RDM_RETCODE rc = rdm_dbGetRowsByKey (db, key_id, &cursor);
296return rc;
297 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKey().

Here is the call graph for this function:

get_rows_by_key() [2/7]

template<RDM_TABLE_ID table_id>
template<class KEY_T >
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_by_key ( RDM_KEY_ID key_id,
const KEY_T * startValue,
const KEY_T * endValue
)
inline

Get rows by key within a key range.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Template Parameters
KEY_T The key type for the key values provided
Parameters
[in] key_id The key ID for which key to order the rows
[in] startValue The value for the start of the range
[in] endValue The value for the end of the range
317 {
318RDM_RETCODE rc = rdm_dbGetRowsByKeyInKeyRange (db, key_id, startValue, sizeof(KEY_T), endValue, sizeof (KEY_T), &cursor);
319return rc;
320 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInKeyRange().

Here is the call graph for this function:

get_rows_by_key() [3/7]

template<RDM_TABLE_ID table_id>
template<class KEY_T >
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_by_key ( RDM_KEY_ID key_id,
const KEY_T * value
)
inline

Get rows by key for a give key value.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Template Parameters
KEY_T The key type for the key value provided
Parameters
[in] key_id The key ID for which key to order the rows
[in] value The value to select
338 {
339RDM_RETCODE rc = rdm_dbGetRowsByKeyInKeyRange (db, key_id, value, sizeof(KEY_T), value, sizeof (KEY_T), &cursor);
340return rc;
341 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInKeyRange().

Here is the call graph for this function:

get_rows_by_key() [4/7]

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_by_key ( RDM_KEY_ID key_id,
const RDM_RANGE_KEY * startValue,
const RDM_RANGE_KEY * endValue
)
inline

Get rows by key within a key range.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
[in] startValue The value for the start of the range
[in] endValue The value for the end of the range
400 {
401RDM_RETCODE rc = rdm_dbGetRowsByKeyInRangeKeyRange (db, key_id, startValue, endValue, &cursor);
402return rc;
403 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInRangeKeyRange().

Here is the call graph for this function:

get_rows_by_key() [5/7]

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_by_key ( RDM_KEY_ID key_id,
const RDM_RANGE_KEY * value
)
inline

Get rows by key for a give key value.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
[in] value The value to select
418 {
419RDM_RETCODE rc = rdm_dbGetRowsByKeyInRangeKeyRange (db, key_id, value, value, &cursor);
420return rc;
421 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInRangeKeyRange().

Here is the call graph for this function:

get_rows_by_key() [6/7]

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_by_key ( RDM_KEY_ID key_id,
const RDM_SEARCH_KEY * startValue,
const RDM_SEARCH_KEY * endValue
)
inline

Get rows by key within a key range.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
[in] startValue The value for the start of the range
[in] endValue The value for the end of the range
473 {
474RDM_RETCODE rc = rdm_dbGetRowsByKeyInSearchKeyRange (db, key_id, startValue, endValue, &cursor);
475return rc;
476 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInSearchKeyRange().

Here is the call graph for this function:

get_rows_by_key() [7/7]

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_by_key ( RDM_KEY_ID key_id,
const RDM_SEARCH_KEY * value
)
inline

Get rows by key for a give key value.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
[in] value The value to select
491 {
492RDM_RETCODE rc = rdm_dbGetRowsByKeyInSearchKeyRange (db, key_id, value, value, &cursor);
493return rc;
494 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInSearchKeyRange().

Here is the call graph for this function:

get_rows_by_rtree_key()

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_by_rtree_key ( RDM_KEY_ID key_id,
const RDM_RTREE_KEY * value
)
inline

Get rows by an R-tree key.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eNOTRTREE The key specified is not an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
[in] value The value for the end of the range
545 {
547return rc;
548 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInRtreeKeyRange().

Here is the call graph for this function:

get_rows_from_key() [1/3]

template<RDM_TABLE_ID table_id>
template<class KEY_T >
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_from_key ( RDM_KEY_ID key_id,
const KEY_T * startValue
)
inline

Get rows by key within a key range that is open at the end.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Template Parameters
KEY_T The key type for the key value provided
Parameters
[in] key_id The key ID for which key to order the rows
[in] startValue The value for the start of the range
360 {
361RDM_RETCODE rc = rdm_dbGetRowsByKeyInKeyRange (db, key_id, startValue, sizeof(KEY_T), NULL, 0, &cursor);
362return rc;
363 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInKeyRange().

Here is the call graph for this function:

get_rows_from_key() [2/3]

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_from_key ( RDM_KEY_ID key_id,
const RDM_RANGE_KEY * startValue
)
inline

Get rows by key within a key range that is open at the end.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
[in] startValue The value for the start of the range
436 {
437RDM_RETCODE rc = rdm_dbGetRowsByKeyInRangeKeyRange (db, key_id, startValue, NULL, &cursor);
438return rc;
439 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInRangeKeyRange().

Here is the call graph for this function:

get_rows_from_key() [3/3]

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_from_key ( RDM_KEY_ID key_id,
const RDM_SEARCH_KEY * startValue
)
inline

Get rows by key within a key range that is open at the end.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
[in] startValue The value for the start of the range
509 {
510RDM_RETCODE rc = rdm_dbGetRowsByKeyInSearchKeyRange (db, key_id, startValue, NULL, &cursor);
511return rc;
512 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInSearchKeyRange().

Here is the call graph for this function:

get_rows_to_key() [1/3]

template<RDM_TABLE_ID table_id>
template<class KEY_T >
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_to_key ( RDM_KEY_ID key_id,
const KEY_T * endValue
)
inline

Get rows by key within a key range that is open at the beginning.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Template Parameters
KEY_T The key type for the key value provided
Parameters
[in] key_id The key ID for which key to order the rows
[in] endValue The value for the end of the range
381 {
382RDM_RETCODE rc = rdm_dbGetRowsByKeyInKeyRange (db, key_id, NULL, 0, endValue, sizeof (KEY_T), &cursor);
383return rc;
384 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInKeyRange().

Here is the call graph for this function:

get_rows_to_key() [2/3]

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_to_key ( RDM_KEY_ID key_id,
const RDM_RANGE_KEY * endValue
)
inline

Get rows by key within a key range that is open at the beginning.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
[in] endValue The value for the end of the range
454 {
455RDM_RETCODE rc = rdm_dbGetRowsByKeyInRangeKeyRange (db, key_id, NULL, endValue, &cursor);
456return rc;
457 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInRangeKeyRange().

Here is the call graph for this function:

get_rows_to_key() [3/3]

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::get_rows_to_key ( RDM_KEY_ID key_id,
const RDM_SEARCH_KEY * endValue
)
inline

Get rows by key within a key range that is open at the beginning.

Set up this class to get the rows in key order.

Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eINVKEYID Invalid key id.
eISRTREE The key specified is an rtree index.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
Parameters
[in] key_id The key ID for which key to order the rows
[in] endValue The value for the end of the range
527 {
528RDM_RETCODE rc = rdm_dbGetRowsByKeyInSearchKeyRange (db, key_id, NULL, endValue, &cursor);
529return rc;
530 }

References RDM::DB::read_row< table_id >::cursor, RDM::DB::read_row< table_id >::db, and rdm_dbGetRowsByKeyInSearchKeyRange().

Here is the call graph for this function:

get_serialize_size()

template<RDM_TABLE_ID table_id>
constexpr static int RDM::DB::read_row< table_id >::get_serialize_size ( void )
inlinestaticconstexpr

Get the size of a buffer for serialization to hold its state.

Get the size needed for a buffer to hold the state of this object.

65 {
66return 0;
67 }

init()

template<RDM_TABLE_ID table_id>
RDM_RETCODE RDM::DB::read_row< table_id >::init ( RDM_DB p_db )
inline

Initialize this object.

Call this method before sending it any data values, ranges, or statistics.

Return values
sOKAY Normal, successful return.
Parameters
p_db [IN] Use this database for chained classes that need to insert rows
224 {
225read_row::db = p_db;
226return sOKAY;
227 }

References RDM::DB::read_row< table_id >::db, and sOKAY.

init_tables_to_read_lock()

template<RDM_TABLE_ID table_id>
uint32_t RDM::DB::read_row< table_id >::init_tables_to_read_lock ( RDM_TABLE_ID * tables )
inline

IDs of the tables where rows are read.

Use this method to initialize an array of table IDs. This array can then be used to start a transaction where those tables are specified.

210 {
211 *tables = table_id;;
212return 1;
213 }

init_tables_to_write_lock()

template<RDM_TABLE_ID table_id>
uint32_t RDM::DB::read_row< table_id >::init_tables_to_write_lock ( RDM_TABLE_ID * )
inline

IDs of the tables where rows are inserted.

Use this method to initialize an array of table IDs. This array can then be used to start a transaction where those tables are specified.

189 {
190return 0;
191 }

number_of_tables_to_read_lock()

template<RDM_TABLE_ID table_id>
constexpr static int RDM::DB::read_row< table_id >::number_of_tables_to_read_lock ( void )
inlinestaticconstexpr

Number of tables where rows are read.

Constant expression method used to statically calculate the size of the array needed for table locking.

199 {
200return 1;
201 }

number_of_tables_to_write_lock()

template<RDM_TABLE_ID table_id>
constexpr static int RDM::DB::read_row< table_id >::number_of_tables_to_write_lock ( void )
inlinestaticconstexpr

Number of tables where rows are inserted.

Constant expression method used to statically calculate the size of the array needed for table locking.

178 {
179return 0;
180 }

operator=()

template<RDM_TABLE_ID table_id>
read_row& RDM::DB::read_row< table_id >::operator= ( const read_row< table_id > & )
inline
154 {
155return *this;
156 }

reset()

template<RDM_TABLE_ID table_id>
void RDM::DB::read_row< table_id >::reset ( void )
inline

Reset this object.

Calling this method to discard all internally kept data values, ranges, and statistics that have not yet been persisted and start over from scratch.

Any alternative implementation of this method in a sub class would call this method to reset the next class.

239 {
241 }

References RDM::DB::read_row< table_id >::cursor, and rdm_cursorMoveToBeforeFirst().

Here is the call graph for this function:

serialize()

template<RDM_TABLE_ID table_id>
uint8_t* RDM::DB::read_row< table_id >::serialize ( uint8_t * buffer )
inline
76 {
77return buffer;
78 }

unserialize()

template<RDM_TABLE_ID table_id>
uint8_t* RDM::DB::read_row< table_id >::unserialize ( uint8_t * buffer )
inline
87 {
88return buffer;
89 }

Friends And Related Function Documentation

join_rows_to_many

template<RDM_TABLE_ID table_id>
template<RDM_TABLE_ID any_table_id, class ANY_NEXT >
friend class join_rows_to_many
friend

join_rows_to_one

template<RDM_TABLE_ID table_id>
template<RDM_TABLE_ID any_table_id, class ANY_NEXT >
friend class join_rows_to_one
friend

Field Documentation

cursor

db

target_row

template<RDM_TABLE_ID table_id>
void* RDM::DB::read_row< table_id >::target_row

The target row we write eche row we read into

Referenced by RDM::DB::read_row< table_id >::bind_row().

target_size


The documentation for this class was generated from the following file:
uint32_t target_size
Definition: rdm_db_read_row.h:94
RDM_RETCODE rdm_cursorMoveToFirst(RDM_CURSOR cursor)
Position a cursor to the first row in the collection.
RDM_RETCODE rdm_cursorMoveToNext(RDM_CURSOR cursor)
Position a cursor to the next row in the collection.
RDM_RETCODE fetch_next(void)
Fetch the next row.
Definition: rdm_db_read_row.h:636
RDM_CURSOR cursor
Definition: rdm_db_read_row.h:92
RDM_RETCODE rdm_cursorReadRow(RDM_CURSOR cursor, void *colValues, size_t bytesIn, size_t *bytesOut)
Read all columns from a row.
RDM_RETCODE fetch_first(void)
Fetch the first row.
Definition: rdm_db_read_row.h:571
RDM_RETCODE rdm_dbGetRowsByKey(RDM_DB db, RDM_KEY_ID keyId, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with a row set based on a key.
@ sOKAY
Definition: rdmretcodetypes.h:100
RDM_RETCODE rdm_dbGetRowsByKeyInRtreeKeyRange(RDM_DB db, RDM_KEY_ID keyId, const RDM_RTREE_KEY *keyValue, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with a row set based on a R-tree.
RDM_RETCODE rdm_cursorMoveToPrevious(RDM_CURSOR cursor)
Position a cursor to the previous row in the collection.
RDM_RETCODE rdm_cursorFree(RDM_CURSOR cursor)
Free an RDM_CURSOR.
RDM_RETCODE fetch_prev(void)
Fetch the previouse row.
Definition: rdm_db_read_row.h:603
enum RDM_RETCODE_E RDM_RETCODE
RaimaDB status and error return codes.
RDM_RETCODE rdm_dbGetRows(RDM_DB db, RDM_TABLE_ID tableId, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with rows based on a table id.
RDM_RETCODE fetch_last(void)
Fetch the first row.
Definition: rdm_db_read_row.h:667
@ direction_forward
Definition: rdm_db.h:46
RDM_RETCODE rdm_cursorMoveToLast(RDM_CURSOR cursor)
Position a cursor to the last row in the collection.
void * target_row
Definition: rdm_db_read_row.h:93
RDM_DB db
Definition: rdm_db_read_row.h:91
RDM_RETCODE rdm_dbGetRowsByKeyInRangeKeyRange(RDM_DB db, RDM_KEY_ID keyId, const RDM_RANGE_KEY *startValue, const RDM_RANGE_KEY *endValue, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with rows in a specified key range.
RDM_RETCODE rdm_cursorMoveToBeforeFirst(RDM_CURSOR cursor)
Position a cursor to the BeforeFirst position.
RDM_RETCODE rdm_dbGetRowsByKeyInSearchKeyRange(RDM_DB db, RDM_KEY_ID keyId, const RDM_SEARCH_KEY *startValue, const RDM_SEARCH_KEY *endValue, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with rows in a specified key range.
RDM_RETCODE rdm_dbGetRowsByKeyInKeyRange(RDM_DB db, RDM_KEY_ID keyId, const void *startValue, size_t bytesInStartValue, const void *endValue, size_t bytesInEndValue, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with rows in a specified key range.