Tango Core Classes Reference
9.3.3
|
A database value. More...
#include "tango.h"
Public Member Functions | |
Constructors | |
DbDatum (string name) | |
Create a DbDatum object. More... | |
DbDatum (const char *name) | |
Create a DbDatum object. More... | |
Operators overloading | |
void | operator<< (bool val) |
Inserters operators. More... | |
bool | operator>> (bool &val) |
Extractors operators. More... | |
Exception related methods methods | |
void | exceptions (bitset< DbDatum::numFlags > fl) |
Set exception flag. More... | |
bitset< DbDatum::numFlags > | exceptions () |
Get exception flag. More... | |
void | reset_exceptions (except_flags fl) |
Reset one exception flag. More... | |
void | set_exceptions (except_flags fl) |
Set one exception flag. More... | |
Miscellaneous methods | |
bool | is_empty () |
Test if instance is empty. More... | |
A database value.
A single database value which has a name, type, address and value and methods for inserting and extracting C++ native types. This is the fundamental type for specifying database properties. Every property has a name and has one or more values associated with it. The values can be inserted and extracted using the operators << and >> respectively. A status flag indicates if there is data in the DbDatum object or not. An additional flag allows the user to activate exceptions.
Tango::DbDatum::DbDatum | ( | string | name | ) |
Tango::DbDatum::DbDatum | ( | const char * | name | ) |
|
inline |
Get exception flag.
Returns the whole exception flags. The following is an example of how to use these exceptions related methods
|
inline |
Set exception flag.
Is a method which allows the user to switch on/off exception throwing for trying to extract data from an empty DbDatum object. The default is to not throw exception. The following flags are supported :
[in] | fl | The exception flag |
bool Tango::DbDatum::is_empty | ( | ) |
Test if instance is empty.
is_empty() is a boolean method which returns true or false depending on whether the DbDatum object contains data or not. It can be used to test whether a property is defined in the database or not e.g.
WrongData | if requested |
void Tango::DbDatum::operator<< | ( | bool | val | ) |
Inserters operators.
The insert and extract operators are specified for the following C++ types :
Here is an example of creating, inserting and extracting some DbDatum types :
[in] | val | Data to be inserted |
WrongData | if requested |
bool Tango::DbDatum::operator>> | ( | bool & | val | ) |
Extractors operators.
See documentation of the DbDatum::operator<< for details
[out] | val | Data to be initalized with database value |
WrongData | if requested |
|
inline |
Reset one exception flag.
Resets one exception flag
[in] | fl | The exception flag |
|
inline |
Set one exception flag.
Sets one exception flag. See DbDatum::exceptions() for a usage example
[in] | fl | The exception flag |