00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023 #ifndef LOG4CPLUS_SPI_OBJECT_REGISTRY_HEADER_
00024 #define LOG4CPLUS_SPI_OBJECT_REGISTRY_HEADER_
00025
00026 #include "dcmtk/oflog/config.h"
00027 #include "dcmtk/oflog/tstring.h"
00028 #include "dcmtk/oflog/helpers/threads.h"
00029 #include "dcmtk/ofstd/oflist.h"
00030 #include "dcmtk/ofstd/ofmap.h"
00031
00032
00033
00034
00035
00036 namespace log4cplus {
00037 namespace spi {
00038
00043 class LOG4CPLUS_EXPORT ObjectRegistryBase {
00044 public:
00045
00050 bool exists(const log4cplus::tstring& name) const;
00051
00055 OFList<log4cplus::tstring> getAllNames() const;
00056
00057 protected:
00058
00059 ObjectRegistryBase();
00060 virtual ~ObjectRegistryBase();
00061
00062
00067 bool putVal(const log4cplus::tstring& name, void* object);
00068
00073 void* getVal(const log4cplus::tstring& name) const;
00074
00078 virtual void deleteObject(void *object) const = 0;
00079
00083 virtual void clear();
00084
00085
00086 typedef OFMap<log4cplus::tstring, void*> ObjectMap;
00087
00088
00089 LOG4CPLUS_MUTEX_PTR_DECLARE mutex;
00090 ObjectMap data;
00091 };
00092
00093 }
00094 }
00095
00096
00097 #endif // LOG4CPLUS_SPI_OBJECT_REGISTRY_HEADER_
00098