1 #ifndef UTIL__OBJECTSTORE__HPP
2 #define UTIL__OBJECTSTORE__HPP
46 template<
class TKey,
class TObject>
92 TObject* obj = it->second;
95 TObject* ptr = lit->GetPointer();
114 const CObject* ptr = lit->GetPointer();
141 static SSystemFastMutex& GetMutex(
void);
149 template<
class TKey,
class TObject>
Protected base class for CSingletonObjectStore Holds a syncronization mutex.
static SSystemFastMutex & GetMutex(void)
Storage container for CObject derived classes Objects are indexed by a key (usually string or integer...
bool HasObject(const TKey &key)
Check to see if a named object exists.
TObject * GetObject(const TKey &key)
Retrieve a named object from the data store.
map< TKey, TObjectPtr > TObjectMap
void ReleaseObject(const TKey &key)
Release an object from the data store.
list< CRef< TObject > > TObjectList
bool PutObject(const TKey &key, TObject *obj)
Put an object in the store.
void Clear()
Clear all objects from the store.
bool HasObject(const CObject *obj)
check to see if a given object is in the store
System wide dumping ground for objects.
static TObject * GetObject(const TKey &key)
Retrieve a named object from the data store.
static TReverseObjectStore & GetObjStore(void)
static void ReleaseObject(const TKey &key)
Release an object from the data store.
CReverseObjectStore< TKey, TObject > TReverseObjectStore
static bool HasObject(const CObject *obj)
check to see if a given object is in the store
static void Clear()
Clear all objects from the store.
static bool PutObject(const TKey &key, TObject *obj)
Put an object in the store.
static bool HasObject(const TKey &key)
Check to see if a named object exists.
~CSingletonObjectStore(void)
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator end() const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_XNCBI_EXPORT
const struct ncbi::grid::netcache::search::fields::KEY key
Multi-threading – mutexes; rw-locks; semaphore.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.