PCMContainer.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00027
00028 #ifndef __PCM_CONTAINER_H__
00029 # define __PCM_CONTAINER_H__
00030
00031
00032
00033
00034
00035 # include "PCMPremeditations.h"
00036
00037 # include "PCMLogger.h"
00038
00039 # include "PCMException.h"
00040
00041
00042
00043
00044
00045 # include <string>
00046
00047 # include <map>
00048
00049 namespace ParCompMark
00050 {
00051
00055 template < class ElementType, class LockType > class Container
00056 {
00057
00058
00059
00060
00061 # ifdef PARCOMPMARK_TEST
00062 friend class ParCompMarkTest::TestContainer;
00063 # endif
00064
00065
00066
00067
00068
00069 public:
00070
00072 typedef Pointer < Container < ElementType,
00073 LockType >,
00074 LockType > Pointer;
00075
00077 typedef typename ElementType::Pointer ElementPointer;
00078
00080 typedef std::map < std::string,
00081 ElementPointer > ElementsMap;
00082
00084 typedef typename ElementsMap::iterator Iterator;
00085
00086
00087
00088
00089
00091
00092
00093 protected:
00094
00100 ElementsMap mElements;
00101
00103
00104
00105
00106
00107
00109
00110
00111 public:
00112
00116 Container();
00117
00121 virtual ~ Container();
00122
00124
00125
00126
00127
00128
00130
00131
00132 public:
00133
00139 virtual void add(std::string name, ElementPointer element);
00140
00146 virtual ElementPointer get(const std::string & name);
00147
00153 virtual bool has(const std::string & name);
00154
00159 virtual void remove(const std::string & name);
00160
00165 virtual u32 getSize();
00166
00171 virtual bool isEmpty();
00172
00177 virtual Iterator begin();
00178
00183 virtual Iterator end();
00184
00186
00187 };
00188
00189
00190
00191
00192
00193 # include "PCMContainer_impl.h"
00194
00195 }
00196
00197 #endif