84 template<
class VALTYPE>
112 const int&
GetId()
const {
return id; }
117 static unsigned int instancesctr;
118 static unsigned int dstrctr;
130 template<
class VALTYPE>
167 template<
class KEYTYPE,
class VALTYPE>
173 typedef typename std::map<key_type,value_type>
map_type;
221 cout<<
"G4Cache id: "<<
id<<endl;
230 if (
this == &rhs )
return;
234 V aCopy = rhs.GetCache();
237 cout<<
"Copy constructor with id: "<<
id<<endl;
244 if (
this == &rhs)
return *
this;
246 V aCopy = rhs.GetCache();
249 cout<<
"Assignement operator with id: "<<
id<<endl;
261 cout<<
"G4Cache id: "<<
id<<
" "<<endl;
269 cout<<
"~G4Cache id: "<<
id<<
" "<<endl;
273 G4bool last = ( dstrctr == instancesctr );
274 theCache.Destroy(
id,last);
283 {
return GetCache(); }
287 { GetCache() = val; }
292 {
return GetCache(); }
312 for (
size_type i = 0 ; i < Size() ; ++i )
313 cout<<
operator[](i)<<
",";
328 for (
G4int idx = 0 ; idx < nElems ; ++idx )
379 template<
class K,
class V>
384 for (
iterator it = Begin() ; it != End() ; ++it )
385 cout<<it->first<<
":"<<it->second<<
",";
390 template<
class K,
class V>
405 template<
class K,
class V>
410 template<
class K,
class V>
416 template<
class K,
class V>
422 template<
class K,
class V>
425 return ( Find(k) != End() );
428 template<
class K,
class V>
431 return Find(k)->second;
434 template<
class K,
class V>
440 template<
class K,
class V>
void Initialize(unsigned int id)
vector_type::const_iterator const_iterator
std::vector< value_type > vector_type
#define G4MUTEX_INITIALIZER
vector_type::iterator iterator
G4bool Has(const key_type &k)
size_type Erase(const key_type &k)
const int & GetId() const
map_type::const_iterator const_iterator
VALTYPE & GetCache(unsigned int id) const
value_type & operator[](const G4int &idx)
void Push_back(const value_type &val)
iterator Find(const key_type &k)
map_type::iterator iterator
G4Cache & operator=(const G4Cache &rhs)
map_type::size_type size_type
std::map< key_type, value_type > map_type
value_type & operator[](const key_type &k)
void Put(const value_type &val) const
std::pair< iterator, G4bool > Insert(const key_type &k, const value_type &v)
vector_type::size_type size_type