CONZEPT 16 C++ API
C16::RecordsKey Class Reference

Record set of records ordered by a key. More...

#include "C16/RecordsKey.hpp"

Inheritance diagram for C16::RecordsKey:
C16::Records

Detailed Description

Record set of records ordered by a key.

Public Member Functions

 RecordsKey (const Key &key, bool reverse=false)
 Constructs a record set by means of a key. More...
 
 RecordsKey (const Table &table, int key_number, bool reverse=false)
 Constructs a record set by means of a table and the number of a key. More...
 
 RecordsKey (const Database &database, const std::string &key_name, bool reverse=false)
 Constructs a record set by means of a database and the name of a key. More...
 
 RecordsKey (const Database &database, const std::string &table_name, int key_number, bool reverse=false)
 Constructs a record set by means of a database, the name of a table and the number of a key. More...
 
 RecordsKey (const Database &database, int table_number, int key_number, bool reverse=false)
 Constructs a record set by means of a database, the number of a table and the number of a key. More...
 
long int count () const override
 Gets the count of records of the record set. More...
 
const Keykey () const
 Gets the key of the record set. More...
 
- Public Member Functions inherited from C16::Records
const Tabletable () const
 Gets the table of the record set. More...
 
const Recordrecord () const
 Gets the record buffer of the record set. More...
 
Recordrecord ()
 Gets the record buffer of the record set. More...
 
bool reverse () const
 Gets if the order of the records is reverted. More...
 
void reverse_set (bool reverse)
 Sets if the order of the records is reverted. More...
 
Result read (Place place, Locking locking=Locking::NONE, bool reverse=false)
 Reads a record by means of a place into the record buffer. More...
 
Result read (long int position, Locking locking=Locking::NONE, bool reverse=false)
 Reads a record by means of its position into the record buffer. More...
 

Constructor & Destructor Documentation

◆ RecordsKey() [1/5]

C16::RecordsKey::RecordsKey ( const Key key,
bool  reverse = false 
)
explicit

Constructs a record set by means of a key.

Parameters
keyKey
reverseOption to use the key in reverse order

◆ RecordsKey() [2/5]

C16::RecordsKey::RecordsKey ( const Table table,
int  key_number,
bool  reverse = false 
)

Constructs a record set by means of a table and the number of a key.

Parameters
tableTable
key_numberNumber of the key
reverseOption to use the key in reverse order
Exceptions
Exception::InexistenceKey inexistent.

◆ RecordsKey() [3/5]

C16::RecordsKey::RecordsKey ( const Database database,
const std::string &  key_name,
bool  reverse = false 
)

Constructs a record set by means of a database and the name of a key.

Parameters
databaseDatabase
key_nameName of the key.
reverseOption to use the key in reverse order
Exceptions
Exception::InexistenceKey inexistent.

◆ RecordsKey() [4/5]

C16::RecordsKey::RecordsKey ( const Database database,
const std::string &  table_name,
int  key_number,
bool  reverse = false 
)

Constructs a record set by means of a database, the name of a table and the number of a key.

Parameters
databaseDatabase
table_nameName of the table
key_numberNumber of the key
reverseOption to use the key in reverse order
Exceptions
Exception::InexistenceTable inexistent.
Exception::InexistenceKey inexistent.

◆ RecordsKey() [5/5]

C16::RecordsKey::RecordsKey ( const Database database,
int  table_number,
int  key_number,
bool  reverse = false 
)

Constructs a record set by means of a database, the number of a table and the number of a key.

Parameters
databaseDatabase
table_numberNumber of the table
key_numberNumber of the key
reverseOption to use the key in reverse order
Exceptions
Exception::InexistenceTable inexistent.
Exception::InexistenceKey inexistent.

Member Function Documentation

◆ count()

long int C16::RecordsKey::count ( ) const
overridevirtual

Gets the count of records of the record set.

Implements C16::Records.

◆ key()

const Key& C16::RecordsKey::key ( ) const

Gets the key of the record set.