CONZEPT 16 C++ API
|
Database hosted by a server. More...
#include "C16/Database.hpp"
Classes | |
class | Connection |
Connection to a database. More... | |
class | Diagnosis |
Diagnosis of a database. More... | |
Public Types | |
enum | Status { Status::READ_ONLY = 1, Status::BACKUP = 2, Status::UPDATE = 4, Status::DIAGNOSIS = 8 } |
Status of a database. More... | |
Public Member Functions | |
Database (const Client &client, const std::string &server_name, const std::string &name, const std::string &user_name, const std::string &user_password=std::string(), const std::string &server_password=std::string()) | |
Constructs and connects to a database. More... | |
~Database () | |
Disconnects from and destructs the database. More... | |
bool | origin () const |
Gets if the database is the origin database. More... | |
const std::string & | name () const |
Gets the name of the database. More... | |
const std::string & | version () const |
Gets the version of the database. More... | |
int | user_id () const |
Gets the id of the user accessing the database. More... | |
int | user_number () const |
Gets the number of user accessing the database. More... | |
long int | size () const |
Gets the size of the database in units of kilobytes. More... | |
long int | size_free () const |
Gets the size of free space of the database in units of kilobytes. More... | |
Flags< Status > | status () const |
Gets the status of the database. More... | |
int | user_count () const |
Gets the count of users currently accessing the database. More... | |
int | backup_duration_remaining () const |
Gets the remaining backup duration of the database in units of seconds. More... | |
void | backup (unsigned int duration_minutes) const |
Transfers the database to backup mode. More... | |
Diagnosis::Result | diagnose (const Flags< Diagnosis::Option > &options, const Diagnosis::Callback &callback=Diagnosis::Callback()) const |
Diagnoses the database. More... | |
const Server & | server () const |
Gets the server hosting the database. More... | |
const Transactions & | transactions () const |
Gets the transactions performed by the user accessing the database. More... | |
Transactions & | transactions () |
Gets the transactions performed by the user accessing the database. More... | |
const Tables & | tables () const |
Gets the tables of the database. More... | |
const Subrecords & | subrecords () const |
Gets the subrecords of the database. More... | |
const Keys & | keys () const |
Gets the keys of the database. More... | |
const Links & | links () const |
Gets the links of the database. More... | |
const Fields & | fields () const |
Gets the fields of the database. More... | |
const Texts & | texts () const |
Gets the texts of the database. More... | |
Texts & | texts () |
Gets the texts of the database. More... | |
const Procedures & | procedures () const |
Gets the procedures of the database. More... | |
Procedures & | procedures () |
Gets the procedures of the database. More... | |
const BinaryDirectory & | binary_directory_root () const |
Gets the root binary directory of the database. More... | |
BinaryDirectory & | binary_directory_root () |
Gets the root binary directory of the database. More... | |
const Users & | users () const |
Gets the users accessing the database. More... | |
Users & | users () |
Gets the users accessing the database. More... | |
|
strong |
C16::Database::Database | ( | const Client & | client, |
const std::string & | server_name, | ||
const std::string & | name, | ||
const std::string & | user_name, | ||
const std::string & | user_password = std::string() , |
||
const std::string & | server_password = std::string() |
||
) |
Constructs and connects to a database.
client | Client to access the server |
server_name | Name of the server hosting the database |
name | Name of the database |
user_name | Name of the user to access the database |
user_password | Password of the user to access the database |
server_password | Password of the server hosting the database |
Connection::Exception | Database connection exception occurred. |
C16::Database::~Database | ( | ) |
Disconnects from and destructs the database.
bool C16::Database::origin | ( | ) | const |
Gets if the database is the origin database.
The origin database is the database where the call of DLLCall()
originates from.
const std::string& C16::Database::name | ( | ) | const |
Gets the name of the database.
const std::string& C16::Database::version | ( | ) | const |
Gets the version of the database.
The version is represented by a string of the form <major>.<minor>
, where the parts in angle brackets (<
... >
) contain the following data:
<major>
– Major version of the database. An integer consisting of one digit.<minor>
– Minor version of the database. An integer consisting of one digit.Examples: 5.0
, 5.4
, 5.8
int C16::Database::user_id | ( | ) | const |
Gets the id of the user accessing the database.
int C16::Database::user_number | ( | ) | const |
Gets the number of user accessing the database.
long int C16::Database::size | ( | ) | const |
Gets the size of the database in units of kilobytes.
long int C16::Database::size_free | ( | ) | const |
Gets the size of free space of the database in units of kilobytes.
Gets the status of the database.
The status is represented by flags of the enumeration Status.
int C16::Database::user_count | ( | ) | const |
Gets the count of users currently accessing the database.
int C16::Database::backup_duration_remaining | ( | ) | const |
Gets the remaining backup duration of the database in units of seconds.
void C16::Database::backup | ( | unsigned int | duration_minutes | ) | const |
Transfers the database to backup mode.
duration_minutes | Backup duration in units of minutes |
Diagnosis::Result C16::Database::diagnose | ( | const Flags< Diagnosis::Option > & | options, |
const Diagnosis::Callback & | callback = Diagnosis::Callback() |
||
) | const |
Diagnoses the database.
options | Options represented by flags of the enumeration Diagnosis::Options |
callback | Callback that will be called in a loop during the diagnosis |
Exception::Unavailability | Database diagnosis unavailable. Database diagnosis is unavailable for the origin database. |
const Transactions& C16::Database::transactions | ( | ) | const |
Gets the transactions performed by the user accessing the database.
Transactions& C16::Database::transactions | ( | ) |
Gets the transactions performed by the user accessing the database.
const Subrecords& C16::Database::subrecords | ( | ) | const |
Gets the subrecords of the database.
const Procedures& C16::Database::procedures | ( | ) | const |
Gets the procedures of the database.
Procedures& C16::Database::procedures | ( | ) |
Gets the procedures of the database.
const BinaryDirectory& C16::Database::binary_directory_root | ( | ) | const |
Gets the root binary directory of the database.
Exception::Unavailability | Binary objects unavailable. Binary objects are unavailable for the origin database. |
BinaryDirectory& C16::Database::binary_directory_root | ( | ) |
Gets the root binary directory of the database.
Exception::Unavailability | Binary objects unavailable. Binary objects are unavailable for the origin database. |