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

RDM_RETCODE fetch (direction dir, bool first_or_last)
Fetch a row. More...
read_row & operator= (const read_row &r)
read_row (const read_row &r)
read_row ()
~read_row ()
uint32_t init_tables_to_write_lock (RDM_TABLE_ID *tables)
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 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 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 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 the first class the chain. The other classes in the chain will fetch from its next class when additional rows are needed. See RDM 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
126 : cursor (NULL), target_row (NULL)
127 {
128 }

read_row() [2/2]

template<RDM_TABLE_ID table_id>
RDM::DB::read_row< table_id >::read_row ( )
inline
130 : cursor (NULL), target_row (NULL)
131 {
132 }

~read_row()

template<RDM_TABLE_ID table_id>
RDM::DB::read_row< table_id >::~read_row ( )
inline
134 {
135if (cursor)
136 {
138 }
139 }

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
229 {
231target_size = sizeof (TARGET_ROW_T);
232
233return sOKAY;
234 }

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
87 {
89if (first_or_last)
90 {
91if (dir == direction_forward)
92 {
93 rc = fetch_first ();
94 }
95else
96 {
97 rc = fetch_last ();
98 }
99 }
100else
101 {
102if (dir == direction_forward)
103 {
104 rc = fetch_next ();
105 }
106else
107 {
108 rc = fetch_prev ();
109 }
110 }
111
112return rc;
113 }

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.
541 {
543if (rc == sOKAY && this->target_row)
544 {
545 rc = rdm_cursorReadRow (cursor, this->target_row, target_size, NULL);
546 }
547
548return rc;
549 }

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.
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_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.
606 {
608if (rc == sOKAY && this->target_row)
609 {
610 rc = rdm_cursorReadRow (cursor, this->target_row, target_size, NULL);
611 }
612
613return rc;
614 }

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.
573 {
575
576if (rc == sOKAY && this->target_row)
577 {
578 rc = rdm_cursorReadRow (cursor, this->target_row, target_size, NULL);
579 }
580
581return rc;
582 }

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.
246 {
247RDM_RETCODE rc = rdm_dbGetRows (db, table_id, &cursor);
248return rc;
249 }

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
263 {
264RDM_RETCODE rc = rdm_dbGetRowsByKey (db, key_id, &cursor);
265return rc;
266 }

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
286 {
287RDM_RETCODE rc = rdm_dbGetRowsByKeyInKeyRange (db, key_id, startValue, sizeof(KEY_T), endValue, sizeof (KEY_T), &cursor);
288return rc;
289 }

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
307 {
308RDM_RETCODE rc = rdm_dbGetRowsByKeyInKeyRange (db, key_id, value, sizeof(KEY_T), value, sizeof (KEY_T), &cursor);
309return rc;
310 }

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
369 {
370RDM_RETCODE rc = rdm_dbGetRowsByKeyInRangeKeyRange (db, key_id, startValue, endValue, &cursor);
371return rc;
372 }

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
387 {
388RDM_RETCODE rc = rdm_dbGetRowsByKeyInRangeKeyRange (db, key_id, value, value, &cursor);
389return rc;
390 }

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
442 {
443RDM_RETCODE rc = rdm_dbGetRowsByKeyInSearchKeyRange (db, key_id, startValue, endValue, &cursor);
444return rc;
445 }

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
460 {
461RDM_RETCODE rc = rdm_dbGetRowsByKeyInSearchKeyRange (db, key_id, value, value, &cursor);
462return rc;
463 }

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
514 {
516return rc;
517 }

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
329 {
330RDM_RETCODE rc = rdm_dbGetRowsByKeyInKeyRange (db, key_id, startValue, sizeof(KEY_T), NULL, 0, &cursor);
331return rc;
332 }

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
405 {
406RDM_RETCODE rc = rdm_dbGetRowsByKeyInRangeKeyRange (db, key_id, startValue, NULL, &cursor);
407return rc;
408 }

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
478 {
479RDM_RETCODE rc = rdm_dbGetRowsByKeyInSearchKeyRange (db, key_id, startValue, NULL, &cursor);
480return rc;
481 }

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
350 {
351RDM_RETCODE rc = rdm_dbGetRowsByKeyInKeyRange (db, key_id, NULL, 0, endValue, sizeof (KEY_T), &cursor);
352return rc;
353 }

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
423 {
424RDM_RETCODE rc = rdm_dbGetRowsByKeyInRangeKeyRange (db, key_id, NULL, endValue, &cursor);
425return rc;
426 }

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
496 {
497RDM_RETCODE rc = rdm_dbGetRowsByKeyInSearchKeyRange (db, key_id, NULL, endValue, &cursor);
498return rc;
499 }

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:

init()

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

Initialize this object.

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

Return values
sOKAY Normal, successful return.
Parameters
db [IN] Use this database for chained classes that need to insert rows
193 {
195return sOKAY;
196 }

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.

179 {
180 *tables = table_id;;
181return 1;
182 }

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 * tables )
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.

158 {
159return 0;
160 }

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.

168 {
169return 1;
170 }

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.

147 {
148return 0;
149 }

operator=()

template<RDM_TABLE_ID table_id>
read_row& RDM::DB::read_row< table_id >::operator= ( const read_row< table_id > & r )
inline
123 {
124return *this;
125 }

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.

208 {
210 }

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

Here is the call graph for this function:

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:63
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:605
RDM_CURSOR cursor
Definition: rdm_db_read_row.h:61
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:540
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.
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.
@ sOKAY
Definition: rdmretcodetypes.h:97
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:572
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:636
@ direction_forward
Definition: rdm_db.h:44
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:62
RDM_DB db
Definition: rdm_db_read_row.h:60
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.
RDM_RETCODE
RDM status and error return codes.
Definition: rdmretcodetypes.h:43