GlobalObjects
Loading...
Searching...
No Matches
glo::ObjIDRecordTuple Class Reference

A tuple of record and object ID. More...

#include <GloObjIDRecordTuple.h>

Public Member Functions

 ObjIDRecordTuple (const ObjID &rObjID)
 
 ObjIDRecordTuple (const ObjID &rObjID, Record *pRecord)
 
 ObjIDRecordTuple (const ObjIDRecordTuple &rT)
 
 ObjIDRecordTuple (Record *pRecord)
 
virtual ~ObjIDRecordTuple ()
 
ObjID getObjID () const
 
bool getRecord (Record *&prRetVal) const
 
bool hasRecord () const
 
ObjIDRecordTupleoperator= (const ObjIDRecordTuple &)
 
int setObjID (const ObjID &rObjID)
 
int setRecord (Record *pRecord)
 
void unsetRecord ()
 
bool operator== (const ObjIDRecordTuple &rT) const
 
bool operator!= (const ObjIDRecordTuple &rT) const
 
bool operator> (const ObjIDRecordTuple &rT) const
 
bool operator>= (const ObjIDRecordTuple &rT) const
 
bool operator< (const ObjIDRecordTuple &rT) const
 
bool operator<= (const ObjIDRecordTuple &rT) const
 

Private Member Functions

 ObjIDRecordTuple ()
 

Private Attributes

ObjID m_ObjID
 
Recordm_pRecord
 

Detailed Description

A tuple of record and object ID.

Why the Object ID, which can also be present in the data set?

In order not to burden the data transfer between client/server with duplicate data records, objects of this class are transferred during transfers. If a data record is already in the transfer, only the ObjID is entered. This comes into play, for example, when a persistent object references another object several times.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ ObjIDRecordTuple() [1/5]

glo::ObjIDRecordTuple::ObjIDRecordTuple ( )
private

The standard constructor is not available.

◆ ObjIDRecordTuple() [2/5]

glo::ObjIDRecordTuple::ObjIDRecordTuple ( const ObjID & rObjID)

Constructor with parameter passing.

Parameters
[in]rObjIDA valid object ID is expected.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ObjIDRecordTuple() [3/5]

glo::ObjIDRecordTuple::ObjIDRecordTuple ( Record * pRecord)

Constructor with parameter passing.

Parameters
[in]pRecordA valid record is expected. The reference counter of the record is incremented.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ObjIDRecordTuple() [4/5]

glo::ObjIDRecordTuple::ObjIDRecordTuple ( const ObjID & rObjID,
Record * pRecord )

Constructor with parameter passing.

Parameters
[in]rObjIDA valid object ID is expected.
[in]pRecordA valid record is expected. Its object ID must match the passed object ID. The reference counter of the record is incremented.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ObjIDRecordTuple() [5/5]

glo::ObjIDRecordTuple::ObjIDRecordTuple ( const ObjIDRecordTuple & rT)

Copy constructor.

Parameters
[in]rTThe data is copied from this object.

◆ ~ObjIDRecordTuple()

virtual glo::ObjIDRecordTuple::~ObjIDRecordTuple ( )
virtual

Destructor. The reference counter of the referenced data set is decremented.

Member Function Documentation

◆ getObjID()

ObjID glo::ObjIDRecordTuple::getObjID ( ) const

Returns the object ID.

Returns
The object ID.

◆ getRecord()

bool glo::ObjIDRecordTuple::getRecord ( Record *& prRetVal) const

Returns the referenced record, if available.

Parameters
[in,out]prRetValIf present, the referenced record.
Returns
If true, then a data set was returned.
Attention
The calling instance must remove the returned object from memory using Record::forget().

◆ hasRecord()

bool glo::ObjIDRecordTuple::hasRecord ( ) const

Checks whether a Record is referenced in m_pRecord.

Returns
If true, a Record is referenced.

◆ operator!=()

bool glo::ObjIDRecordTuple::operator!= ( const ObjIDRecordTuple & rT) const

All comparison operators ignore the record, only the ObjID is compared.

◆ operator<()

bool glo::ObjIDRecordTuple::operator< ( const ObjIDRecordTuple & rT) const

All comparison operators ignore the record, only the ObjID is compared.

◆ operator<=()

bool glo::ObjIDRecordTuple::operator<= ( const ObjIDRecordTuple & rT) const

All comparison operators ignore the record, only the ObjID is compared.

◆ operator=()

ObjIDRecordTuple & glo::ObjIDRecordTuple::operator= ( const ObjIDRecordTuple & )

The assignment operator is not available.

◆ operator==()

bool glo::ObjIDRecordTuple::operator== ( const ObjIDRecordTuple & rT) const

All comparison operators ignore the record, only the ObjID is compared.

◆ operator>()

bool glo::ObjIDRecordTuple::operator> ( const ObjIDRecordTuple & rT) const

All comparison operators ignore the record, only the ObjID is compared.

◆ operator>=()

bool glo::ObjIDRecordTuple::operator>= ( const ObjIDRecordTuple & rT) const

All comparison operators ignore the record, only the ObjID is compared.

◆ setObjID()

int glo::ObjIDRecordTuple::setObjID ( const ObjID & rObjID)

Adopts the ObjID if a record with a different Object ID is not already referenced.

Parameters
[in]rObjIDA valid object ID is expected.
Returns
A return value < 0 indicates an error.

◆ setRecord()

int glo::ObjIDRecordTuple::setRecord ( Record * pRecord)

Accepts the passed record. If a record is already referenced, it is forgotten and the object ID is set to NULL.

Parameters
[in]pRecordA valid data record is expected. The reference counter of the data set is incremented and stored in m_pRecord. The object ID of the data set is written to m_ObjID.
Returns
A return value < 0 indicates an error.

◆ unsetRecord()

void glo::ObjIDRecordTuple::unsetRecord ( )

Forgets a possibly existing record without changing the ObjID. m_pRecord is then NULL_PTR.

Member Data Documentation

◆ m_ObjID

ObjID glo::ObjIDRecordTuple::m_ObjID
private

The object ID.

◆ m_pRecord

Record* glo::ObjIDRecordTuple::m_pRecord
private

The record.


The documentation for this class was generated from the following file: