CONZEPT 16 C++ API
C16::Table Class Referenceabstract

Table of a database. More...

#include "C16/Table.hpp"

Detailed Description

Classes

class  Fields
 Fields of a table. More...
 

Static Public Attributes

static const int NUMBER_MINIMUM = 1
 Minimum number of a table. More...
 
static const int NUMBER_MAXIMUM = 999
 Maximum number of a table. More...
 

Public Member Functions

virtual Databasedatabase () const =0
 Gets the database of the table. More...
 
virtual int number () const =0
 Gets the number of the table. More...
 
virtual const std::string & name () const =0
 Gets the name of the table. More...
 
virtual long long int prime_counter () const =0
 Gets the prime counter of the table. More...
 
virtual bool subordinated () const =0
 Gets if the table is subordinated. More...
 
virtual const Tablemaster_table () const =0
 Gets the master table of the table, if subordinated. More...
 
virtual long int records_count () const =0
 Gets the count of records of the table. More...
 
virtual long int records_count_link (const Record &record_source, int link_number) const =0
 Gets the count of records of a link to the table. More...
 
virtual void records_erase () const =0
 Deletes the records of the table. More...
 
virtual Result record_lock_id (long long int id, Locking locking=Locking::LOCK_EXCLUSIVE) const =0
 Applies a locking to a record by means of its id. More...
 
virtual Result record_lock_position_key (int key_number, long int position, Locking locking=Locking::LOCK_EXCLUSIVE, bool reverse=false) const =0
 Applies a locking to a record by means of its position dependent on a key. More...
 
virtual Result record_lock_position_link (const Record &record_source, int link_number, long int position, Locking locking=Locking::LOCK_EXCLUSIVE, bool reverse=false) const =0
 Applies a locking to a record by means of its position dependent on a link. More...
 
virtual Result record_test_id (long long int id) const =0
 Tests the existence of a record by means of its id. More...
 
virtual const Series< Subrecord > & subrecords () const =0
 Gets the subrecords of the table. More...
 
virtual const Series< Key > & keys () const =0
 Gets the keys of the table. More...
 
virtual const Series< Link > & links () const =0
 Gets the links of the table. More...
 
virtual const Fieldsfields () const =0
 Gets the fields of the table. More...
 

Member Data Documentation

◆ NUMBER_MINIMUM

const int C16::Table::NUMBER_MINIMUM = 1
static

Minimum number of a table.

◆ NUMBER_MAXIMUM

const int C16::Table::NUMBER_MAXIMUM = 999
static

Maximum number of a table.

Member Function Documentation

◆ database()

virtual Database& C16::Table::database ( ) const
pure virtual

Gets the database of the table.

◆ number()

virtual int C16::Table::number ( ) const
pure virtual

Gets the number of the table.

◆ name()

virtual const std::string& C16::Table::name ( ) const
pure virtual

Gets the name of the table.

◆ prime_counter()

virtual long long int C16::Table::prime_counter ( ) const
pure virtual

Gets the prime counter of the table.

◆ subordinated()

virtual bool C16::Table::subordinated ( ) const
pure virtual

Gets if the table is subordinated.

◆ master_table()

virtual const Table* C16::Table::master_table ( ) const
pure virtual

Gets the master table of the table, if subordinated.

Return values
!= nullptrPointer to the master table of the table.
nullptrTable not subordinated.
Examples
#include "C16/Library.hpp"
using namespace C16;
void table_master_table(const Table& table)
{
// Table subordinated to table "table_master"
if (Table* table_master = table.master_table())
{
...
}
// Table not subordinated
else
{
...
}
}

◆ records_count()

virtual long int C16::Table::records_count ( ) const
pure virtual

Gets the count of records of the table.

◆ records_count_link()

virtual long int C16::Table::records_count_link ( const Record record_source,
int  link_number 
) const
pure virtual

Gets the count of records of a link to the table.

Parameters
record_sourceRecord buffer of the table of the link
link_numberNumber of the link
Exceptions
Exception::DifferenceTable different.
Destination table of the link is different to table.

◆ records_erase()

virtual void C16::Table::records_erase ( ) const
pure virtual

Deletes the records of the table.

◆ record_lock_id()

virtual Result C16::Table::record_lock_id ( long long int  id,
Locking  locking = Locking::LOCK_EXCLUSIVE 
) const
pure virtual

Applies a locking to a record by means of its id.

Parameters
idId of the record
lockingLocking to apply to the record
Locking::LOCK_EXCLUSIVEApplies an exclusive lock to the record.
Locking::LOCK_SINGLEApplies an exclusive, singulary lock to the record.
Locking::LOCK_FORCERemoves all locks by all users from the record and applies an exclusive lock to the record.
Locking::LOCK_SHAREDApplies a shared lock to the record.
Locking::UNLOCKRemoves a lock applied by the accessing user from the record.
Returns
Result
Return values
Result::OKLocking applied.
Result::LOCKEDRecord already locked.
Result::NO_RECRecord inexistent.
Result::NO_RIGHTSPermissions insufficient.
Exceptions
Exception::InvalidityLocking invalid.

◆ record_lock_position_key()

virtual Result C16::Table::record_lock_position_key ( int  key_number,
long int  position,
Locking  locking = Locking::LOCK_EXCLUSIVE,
bool  reverse = false 
) const
pure virtual

Applies a locking to a record by means of its position dependent on a key.

Parameters
key_numberNumber of the key
positionPosition of the record dependent on the key (1 to records_count()).
lockingLocking to apply to the record
Locking::LOCK_EXCLUSIVEApplies an exclusive lock to the record.
Locking::LOCK_SINGLEApplies an exclusive, singulary lock to the record.
Locking::LOCK_FORCERemoves all locks by all users from the record and applies an exclusive lock to the record.
Locking::LOCK_SHAREDApplies a shared lock to the record.
Locking::UNLOCKRemoves a lock applied by the accessing user from the record.
reverseOption to use the key in reverse order
Returns
Result
Return values
Result::OKLocking applied.
Result::LOCKEDRecord already locked.
Result::NO_RECRecord inexistent.
Result::NO_RIGHTSPermissions insufficient.
Exceptions
Exception::InexistenceKey inexistent.
Exception::InvalidityLocking invalid.

◆ record_lock_position_link()

virtual Result C16::Table::record_lock_position_link ( const Record record_source,
int  link_number,
long int  position,
Locking  locking = Locking::LOCK_EXCLUSIVE,
bool  reverse = false 
) const
pure virtual

Applies a locking to a record by means of its position dependent on a link.

Parameters
record_sourceRecord buffer of the table of the link
link_numberNumber of the link
positionPosition of the record dependent on the link (1 to records_count_link()).
lockingLocking to apply to the record
Locking::NONEDoes not change the lock of the record.
Locking::LOCK_EXCLUSIVEApplies an exclusive lock to the record.
Locking::LOCK_SINGLEApplies an exclusive, singulary lock to the record.
Locking::LOCK_FORCERemoves all locks by all users from the record and applies an exclusive lock to the record.
Locking::LOCK_SHAREDApplies a shared lock to the record.
Locking::UNLOCKRemoves a lock applied by the accessing user from the record.
reverseOption to use the destination key of the link in reverse order
Returns
Result
Return values
Result::OKLocking applied.
Result::LOCKEDRecord already locked.
Result::NO_RECRecord inexistent.
Result::NO_RIGHTSPermissions insufficient.
Exceptions
Exception::InexistenceLink inexistent.
Exception::InvalidityLocking invalid.

◆ record_test_id()

virtual Result C16::Table::record_test_id ( long long int  id) const
pure virtual

Tests the existence of a record by means of its id.

Parameters
idId of the record
Returns
Result
Return values
Result::OKRecord existent.
Result::NO_RECRecord inexistent.
Result::NO_RIGHTSPermissions insufficient.

◆ subrecords()

virtual const Series<Subrecord>& C16::Table::subrecords ( ) const
pure virtual

Gets the subrecords of the table.

Returns
Series of subrecords of the table
Examples
#include "C16/Library.hpp"
using namespace C16;
void table_subrecords_iterate(const Table& table)
{
// const-Iteration
for (const Subrecord& subrecord : table.subrecords())
{
...
}
}

◆ keys()

virtual const Series<Key>& C16::Table::keys ( ) const
pure virtual

Gets the keys of the table.

Returns
Series of keys of the table
Examples
#include "C16/Library.hpp"
using namespace C16;
void table_keys_iterate(const Table& table)
{
// const-Iteration
for (const Key& key : table.keys())
{
...
}
}

◆ links()

virtual const Series<Link>& C16::Table::links ( ) const
pure virtual

Gets the links of the table.

Returns
Series of links of the table
Examples
#include "C16/Library.hpp"
using namespace C16;
void table_links_iterate(const Table& table)
{
// const-Iteration
for (const Link& link : table.links())
{
...
}
}

◆ fields()

virtual const Fields& C16::Table::fields ( ) const
pure virtual

Gets the fields of the table.

C16::Table::keys
virtual const Series< Key > & keys() const =0
Gets the keys of the table.
C16::Table::master_table
virtual const Table * master_table() const =0
Gets the master table of the table, if subordinated.
C16::Table::links
virtual const Series< Link > & links() const =0
Gets the links of the table.
Library.hpp
CONZEPT 16 C++ API.
C16::Table::subrecords
virtual const Series< Subrecord > & subrecords() const =0
Gets the subrecords of the table.
C16::Key
Key of a table.
Definition: Key.hpp:17
C16
Namespace.
Definition: Array.hpp:6
C16::Table
Table of a database.
Definition: Table.hpp:21
C16::Subrecord
Subrecord of a table.
Definition: Subrecord.hpp:16