CONZEPT 16 C++ API
|
Selection buffer to operate on selections of a table. More...
#include "C16/Selection.hpp"
Selection buffer to operate on selections of a table.
Static Public Attributes | |
static const int | NAME_LENGTH_LIMIT = 20 |
Name length limit. More... | |
Public Member Functions | |
Selection (const Database &database, int table_number) | |
Constructs a selection buffer by means of the database and the number of its table. More... | |
Selection (const Database &database, const std::string &table_name) | |
Constructs a selection buffer by means of the database and the name of its table. More... | |
Selection (const Table &table) | |
Constructs a selection buffer by means of its table. More... | |
Selection (const Selection &other) | |
Constructs a copy of another selection buffer. More... | |
const Database & | database () const |
Gets the database of the selection buffer. More... | |
const Table & | table () const |
Gets the table of the selection buffer. More... | |
bool | loaded () const |
Gets if a selection is loaded into the selection buffer. More... | |
const std::string & | name () const |
Gets the name of the loaded selection. More... | |
const Value::Date & | created_date () const |
Gets the date of the creation of the loaded selection. More... | |
const Value::Time & | created_time () const |
Gets the time of the creation of the loaded selection. More... | |
const Value::Date & | modified_date () const |
Gets the date of the last modification of the loaded selection. More... | |
const Value::Time & | modified_time () const |
Gets the time of the last modification of the loaded selection. More... | |
const std::string & | modified_user () const |
Gets the user who last modified the loaded selection. More... | |
const Value::Date & | executed_date () const |
Gets the date of the last execution of the loaded selection. More... | |
const Value::Time & | executed_time () const |
Gets the time of the last execution of the loaded selection. More... | |
int | right_modify () const |
Gets the right required by a user to modify the loaded selection. More... | |
int | right_execute () const |
Gets the right required by a user to execute the loaded selection. More... | |
long int | records_count () const |
Gets the count of records of the loaded selection. More... | |
Result | read (const std::string &name, Place place=Place::KEY, Locking locking=Locking::NONE) |
Reads a selection by means of a reference name and a place into the selection buffer. More... | |
Result | read (Place place, Locking locking=Locking::NONE) |
Reads a selection by means of a place into the selection buffer. More... | |
Result | reload (Locking locking=Locking::NONE) |
Reloads the loaded selection. More... | |
void | unload () |
Unloads the loaded selection. More... | |
Result | record_insert (const Record &record) const |
Inserts a record into the loaded selection. More... | |
Result | record_remove (const Record &record) const |
Removes a record from the loaded selection. More... | |
Result | clear () const |
Clears the loaded selection (i.e. removes all records from the selection). More... | |
|
static |
Name length limit.
C16::Selection::Selection | ( | const Database & | database, |
int | table_number | ||
) |
C16::Selection::Selection | ( | const Database & | database, |
const std::string & | table_name | ||
) |
|
explicit |
C16::Selection::Selection | ( | const Selection & | other | ) |
Constructs a copy of another selection buffer.
other | Another selection buffer |
bool C16::Selection::loaded | ( | ) | const |
Gets if a selection is loaded into the selection buffer.
const std::string& C16::Selection::name | ( | ) | const |
Gets the name of the loaded selection.
const Value::Date& C16::Selection::created_date | ( | ) | const |
Gets the date of the creation of the loaded selection.
const Value::Time& C16::Selection::created_time | ( | ) | const |
Gets the time of the creation of the loaded selection.
const Value::Date& C16::Selection::modified_date | ( | ) | const |
Gets the date of the last modification of the loaded selection.
const Value::Time& C16::Selection::modified_time | ( | ) | const |
Gets the time of the last modification of the loaded selection.
const std::string& C16::Selection::modified_user | ( | ) | const |
Gets the user who last modified the loaded selection.
const Value::Date& C16::Selection::executed_date | ( | ) | const |
Gets the date of the last execution of the loaded selection.
const Value::Time& C16::Selection::executed_time | ( | ) | const |
Gets the time of the last execution of the loaded selection.
int C16::Selection::right_modify | ( | ) | const |
Gets the right required by a user to modify the loaded selection.
int C16::Selection::right_execute | ( | ) | const |
Gets the right required by a user to execute the loaded selection.
long int C16::Selection::records_count | ( | ) | const |
Gets the count of records of the loaded selection.
Result C16::Selection::read | ( | const std::string & | name, |
Place | place = Place::KEY , |
||
Locking | locking = Locking::NONE |
||
) |
Reads a selection by means of a reference name and a place into the selection buffer.
name | Reference name (case insensitive, 0 to NAME_LENGTH_LIMIT characters) | ||||||||
place | Place of the selection
| ||||||||
locking | Locking to apply to the selection
|
Result::OK | Selection loaded and locking applied. |
Result::LOCKED | Selection loaded but already locked. |
Result::NO_KEY | Selection inexistent but following selection existent and loaded. |
Result::LAST_REC | Selection and following selection inexistent but preceding selection existent and loaded. |
Result::NO_REC | No selection existent and loaded. |
Exception::Invalidity | Name invalid. |
Exception::Invalidity | Place invalid. |
Exception::Invalidity | Locking invalid. |
Result C16::Selection::read | ( | Place | place, |
Locking | locking = Locking::NONE |
||
) |
Reads a selection by means of a place into the selection buffer.
place | Place of the selection
| ||||||||
locking | Locking to apply to the selection
|
Result::OK | Selection loaded and locking applied. |
Result::LOCKED | Selection loaded but already locked. |
Result::NO_REC | No selection existent and loaded. |
Result::NO_RIGHTS | Permissions insufficient. Name of text loaded. |
Exception::Invalidity | Place invalid. |
Exception::Invalidity | Locking invalid. |
Result C16::Selection::reload | ( | Locking | locking = Locking::NONE | ) |
Reloads the loaded selection.
The selection is identified by its name.
locking | Locking to apply to the selection
|
Result::OK | Selection loaded and locking applied. |
Result::LOCKED | Selection loaded but already locked. |
Result::NO_KEY | Selection inexistent but following selection existent and loaded. |
Result::LAST_REC | Selection and following selection inexistent but preceding selection existent and loaded. |
Result::NO_REC | Selection inexistent or not loaded. No selection loaded. |
void C16::Selection::unload | ( | ) |
Unloads the loaded selection.
Inserts a record into the loaded selection.
record | Record buffer of the record |
Result::OK | Record inserted to the selection. |
Result::EXISTS | Record already existent in the selection. |
Result::NO_LOCK | Selection not exclusively locked or not loaded. |
Result::DEADLOCK | Deadlock occurred. |
Exception::Inexistence | Result set inexistent. Selection does not contain a result set for the record. |
Removes a record from the loaded selection.
record | Record buffer of the record |
Result::OK | Record removed from the selection. |
Result::NO_KEY | Record not existent in the selection. |
Result::NO_REC | Result set empty. |
Result::NO_LOCK | Selection not exclusively locked or not loaded. |
Result::DEADLOCK | Deadlock occurred. |
Exception::Inexistence | Result set inexistent. Selection does not contain a result set for the record. |
Result C16::Selection::clear | ( | ) | const |
Clears the loaded selection (i.e. removes all records from the selection).
Result::OK | Selection cleared. |
Result::NO_LOCK | Selection not exclusively locked or not loaded. |
Result::DEADLOCK | Deadlock occurred. |