BankAndCustomer
|
An object ID consists of the class ID, a database ID and the actual unique object number (all unsigned long). More...
#include <GloObjID.h>
Classes | |
struct | HashFunction |
Public Member Functions | |
ObjID () | |
ObjID (unsigned long ulClassID, unsigned long ulBaseID, unsigned long ulObjCounter) | |
ObjID (const std::string &sObjId, const std::string &sSeparator=".") | |
ObjID (const ObjID &rT) | |
virtual | ~ObjID () |
bool | isNULL () const |
void | setNULL () |
void | setID (unsigned long ulClassID, unsigned long ulBaseID, unsigned long ulObjCounter) |
int | setID (const std::string &sObjId, const std::string &sSeparator=".") |
void | setClassID (unsigned long ulClassID) |
void | setBaseID (unsigned long ulBaseID) |
void | setObjCounter (unsigned long ulObjCounter) |
unsigned long | getClassID () const |
unsigned long | getBaseID () const |
unsigned long | getObjCounter () const |
std::string | toString () const |
ObjID & | operator= (const ObjID &rT) |
bool | operator== (const ObjID &rT) const |
Comparison operator. | |
bool | operator!= (const ObjID &rT) const |
Comparison operator. | |
bool | operator> (const ObjID &rT) const |
The size comparison is made from the m_ulClassID via the m_ulBaseID to the m_ulObjCounter in this order. | |
bool | operator>= (const ObjID &rT) const |
The size comparison is made from the m_ulClassID via the m_ulBaseID to the m_ulObjCounter in this order. | |
bool | operator< (const ObjID &rT) const |
The size comparison is made from the m_ulClassID via the m_ulBaseID to the m_ulObjCounter in this order. | |
bool | operator<= (const ObjID &rT) const |
The size comparison is made from the m_ulClassID via the m_ulBaseID to the m_ulObjCounter in this order. | |
Static Public Member Functions | |
static bool | IsValidObjID (const std::string &rsObjID, const std::string &sSeparator=".") |
Private Attributes | |
unsigned long | m_ulClassID |
unsigned long | m_ulBaseID |
unsigned long | m_ulObjCounter |
Friends | |
std::ostream & | operator<< (std::ostream &rOStream, const ObjID &rObjID) |
std::istream & | operator>> (std::istream &rIStream, ObjID &rObjID) |
An object ID consists of the class ID, a database ID and the actual unique object number (all unsigned long).
Each persistent object gets an object ID and is therefore uniquely identifiable in the database. An object ID is assigned by GlobalObjects when a persistent object is registered in the database. An object ID is unique and is not reused when a persistent object is deleted.
References in the database are made using the object ID.
glo::ObjID::ObjID | ( | ) |
Standard constructor.
glo::ObjID::ObjID | ( | unsigned long | ulClassID, |
unsigned long | ulBaseID, | ||
unsigned long | ulObjCounter ) |
Constructor with parameter passing sets the object ID.
[in] | ulClassID | The class ID. |
[in] | ulBaseID | The database ID. |
[in] | ulObjCounter | The object counter. |
glo::ObjID::ObjID | ( | const std::string & | sObjId, |
const std::string & | sSeparator = "." ) |
Constructor with parameter passing.
Takes the class ID, database ID and object counter from a string.
For example, if this is in the following form: "2.0.123" is the results:
Leading and following spaces are ignored.
[in] | sObjId | Class ID, database ID and object counter in one string. |
[in] | sSeparator | The separator character (default "."). |
eut::ErrorNException | An exception is thrown if an error occurs. |
glo::ObjID::ObjID | ( | const ObjID & | rT | ) |
Copy constructor.
[in] | rT | The data is copied from this object. |
|
virtual |
Destructor
unsigned long glo::ObjID::getBaseID | ( | ) | const |
unsigned long glo::ObjID::getClassID | ( | ) | const |
unsigned long glo::ObjID::getObjCounter | ( | ) | const |
bool glo::ObjID::isNULL | ( | ) | const |
Checks if the class ID has a value, i.e. is valid.
|
static |
Checks the passed string whether it represents a valid Object ID.
[in] | rsObjID | Reference to the string to be checked. |
[in] | sSeparator | The separator character (default "."). |
bool glo::ObjID::operator!= | ( | const ObjID & | rT | ) | const |
Comparison operator.
[in] | rT | The object to be compared with this one. |
bool glo::ObjID::operator< | ( | const ObjID & | rT | ) | const |
The size comparison is made from the m_ulClassID via the m_ulBaseID to the m_ulObjCounter in this order.
The ObjID 999.1.1 is greater than 888,999,999.
[in] | rT | The object to be compared with this one. |
bool glo::ObjID::operator<= | ( | const ObjID & | rT | ) | const |
The size comparison is made from the m_ulClassID via the m_ulBaseID to the m_ulObjCounter in this order.
The ObjID 999.1.1 is greater than 888,999,999.
[in] | rT | The object to be compared with this one. |
Assignment operator.
[in] | rT | The data is transferred from this object. |
bool glo::ObjID::operator== | ( | const ObjID & | rT | ) | const |
Comparison operator.
[in] | rT | The object to be compared with this one. |
bool glo::ObjID::operator> | ( | const ObjID & | rT | ) | const |
The size comparison is made from the m_ulClassID via the m_ulBaseID to the m_ulObjCounter in this order.
The ObjID 999.1.1 is greater than 888,999,999.
[in] | rT | The object to be compared with this one. |
bool glo::ObjID::operator>= | ( | const ObjID & | rT | ) | const |
The size comparison is made from the m_ulClassID via the m_ulBaseID to the m_ulObjCounter in this order.
The ObjID 999.1.1 is greater than 888,999,999.
[in] | rT | The object to be compared with this one. |
void glo::ObjID::setBaseID | ( | unsigned long | ulBaseID | ) |
void glo::ObjID::setClassID | ( | unsigned long | ulClassID | ) |
int glo::ObjID::setID | ( | const std::string & | sObjId, |
const std::string & | sSeparator = "." ) |
Takes the class ID, database ID and object counter from a string.
For example, if this is in the following form: "2.0.123" is the results:
Leading and following spaces are ignored.
[in] | sObjId | Class ID, database ID and object counter in one string. |
[in] | sSeparator | The separator character (default "."). |
void glo::ObjID::setID | ( | unsigned long | ulClassID, |
unsigned long | ulBaseID, | ||
unsigned long | ulObjCounter ) |
Sets the object ID.
[in] | ulClassID | The class ID. |
[in] | ulBaseID | The database ID. |
[in] | ulObjCounter | The object counter. |
void glo::ObjID::setNULL | ( | ) |
Sets all attributes to 0.
void glo::ObjID::setObjCounter | ( | unsigned long | ulObjCounter | ) |
std::string glo::ObjID::toString | ( | ) | const |
Returns the object ID in a string. The separator is the default value ".
|
friend |
|
friend |
|
private |
The database ID.
|
private |
The class ID.
|
private |
The object counter.