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