OFFIS DCMTK  Version 3.6.0
objreg.h
Go to the documentation of this file.
1 // Module: Log4CPLUS
2 // File: objectregistry.h
3 // Created: 3/2003
4 // Author: Tad E. Smith
5 //
6 //
7 // Copyright 2003-2009 Tad E. Smith
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 
23 #ifndef LOG4CPLUS_SPI_OBJECT_REGISTRY_HEADER_
24 #define LOG4CPLUS_SPI_OBJECT_REGISTRY_HEADER_
25 
26 #include "dcmtk/oflog/config.h"
27 #include "dcmtk/oflog/tstring.h"
29 #include "dcmtk/ofstd/oflist.h"
30 #include "dcmtk/ofstd/ofmap.h"
31 //#include <map>
32 //#include <memory>
33 //#include <vector>
34 
35 
36 namespace log4cplus {
37  namespace spi {
38 
43  class LOG4CPLUS_EXPORT ObjectRegistryBase {
44  public:
45  // public methods
50  bool exists(const log4cplus::tstring& name) const;
51 
55  OFList<log4cplus::tstring> getAllNames() const;
56 
57  protected:
58  // Ctor and Dtor
60  virtual ~ObjectRegistryBase();
61 
62  // protected methods
67  bool putVal(const log4cplus::tstring& name, void* object);
68 
73  void* getVal(const log4cplus::tstring& name) const;
74 
78  virtual void deleteObject(void *object) const = 0;
79 
83  virtual void clear();
84 
85  // Types
87 
88  // Data
89  LOG4CPLUS_MUTEX_PTR_DECLARE mutex;
90  ObjectMap data;
91  };
92 
93  }
94 }
95 
96 
97 #endif // LOG4CPLUS_SPI_OBJECT_REGISTRY_HEADER_
98 


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2