GlobalObjects
|
Class to access the generic persistent objects of a database in memory. More...
#include <GloGenPersObjectSpy.h>
Public Member Functions | |
GenPersObjectSpy () | |
virtual | ~GenPersObjectSpy () |
GenericPersistent * | getPersistentObject (const ObjID &rGloObjID) |
GenericPersistent * | getPersistentObject (EnSeekMode eMode) |
int | getPersistentObject (GenericPersistent *&prRetVal, const ObjID &rGloObjID) |
int | getPersistentObject (GenericPersistent *&prRetVal, EnSeekMode eMode) |
int | getPersistentObject (std::shared_ptr< GenericPersistent > &rRetVal, const ObjID &rGloObjID) |
int | getPersistentObject (std::shared_ptr< GenericPersistent > &rRetVal, EnSeekMode eMode) |
int | insertPersistentObject (const GenericPersistent *pPersObject) |
int | removePersistentObject (const GenericPersistent *pPersObject) |
std::size_t | sizeOfPersObjectList () const |
Private Member Functions | |
GenPersObjectSpy (const GenPersObjectSpy &) | |
GenPersObjectSpy & | operator= (const GenPersObjectSpy &) |
Private Attributes | |
eut::CriticalSection | m_LocalCriticalSection |
std::unordered_map< unsigned long, GenericPersistent * > | m_PersObjectList |
std::unordered_map< unsignedlong, GenericPersistent * >::iterator | m_PersObjectListIterator |
Friends | |
class | GenericPersistent |
Class to access the generic persistent objects of a database in memory.
All generic persistent objects of a database log on automatically here.
glo::GenPersObjectSpy::GenPersObjectSpy | ( | ) |
Standard constructor.
|
virtual |
Destructor.
|
private |
The copy constructor is not available.
GenericPersistent * glo::GenPersObjectSpy::getPersistentObject | ( | const ObjID & | rGloObjID | ) |
Returns a pointer to a generic persistent object from the list of generic persistent objects that has the passed object ID.
[in] | rGloObjID | The object ID. |
GenericPersistent * glo::GenPersObjectSpy::getPersistentObject | ( | EnSeekMode | eMode | ) |
Returns a generic persistent object from the list of generic persistent objects related to eMode.
[in] | eMode | The seek mode. |
Parameter examples:
int glo::GenPersObjectSpy::getPersistentObject | ( | GenericPersistent *& | prRetVal, |
const ObjID & | rGloObjID ) |
Returns a pointer to a generic persistent object from the list of generic persistent objects that has the passed object ID.
[in,out] | prRetVal | If no error, the pointer to the fetched object. |
[in] | rGloObjID | The object ID. |
int glo::GenPersObjectSpy::getPersistentObject | ( | GenericPersistent *& | prRetVal, |
EnSeekMode | eMode ) |
Returns a generic persistent object from the list of generic persistent objects related to eMode.
[in,out] | prRetVal | If no error, the pointer to the fetched object. |
[in] | eMode | The seek mode. |
Parameter examples:
int glo::GenPersObjectSpy::getPersistentObject | ( | std::shared_ptr< GenericPersistent > & | rRetVal, |
const ObjID & | rGloObjID ) |
Returns a std::shared_ptr to a generic persistent object from the list of generic persistent objects that has the passed object ID.
[in,out] | rRetVal | If no error, the std::shared_ptr to the fetched object. |
[in] | rGloObjID | The object ID. |
int glo::GenPersObjectSpy::getPersistentObject | ( | std::shared_ptr< GenericPersistent > & | rRetVal, |
EnSeekMode | eMode ) |
Returns a generic persistent object from the list of generic persistent objects related to eMode.
[in,out] | rRetVal | If no error, the std::shared_ptr to the fetched object. |
[in] | eMode | The seek mode. |
Parameter examples:
int glo::GenPersObjectSpy::insertPersistentObject | ( | const GenericPersistent * | pPersObject | ) |
Inserts a generic persistent object into the list of generic persistent objects.
[in] | pPersObject | The generic persistent object to be inserted. |
|
private |
The assignment operator is not available.
int glo::GenPersObjectSpy::removePersistentObject | ( | const GenericPersistent * | pPersObject | ) |
Removes a generic persistent object from the list of generic persistent objects.
[in] | pPersObject | The generic persistent object to be removed. |
std::size_t glo::GenPersObjectSpy::sizeOfPersObjectList | ( | ) | const |
Retrurns the number of entries in m_PersObjectList.
|
friend |
|
private |
To have thread-safe access to the list of generic persistent objects, access is synchronized via this local CriticalSection.
|
private |
The list of generic persistent objects. The index is ObjID::m_ulObjCounter of the object ID of each object.
Since the ObjID::m_ulObjCounter is unique in a database, the entire object ID is not necessary as an index.
|
private |
An internal iterator to the generic persistent object list.