84 template<
class VALTYPE>
99 inline value_type&
Get()
const;
102 inline void Put(
const value_type& val )
const;
105 inline value_type
Pop();
130 template<
class VALTYPE>
153 inline void Push_back(
const value_type& val );
156 inline iterator
Begin();
157 inline iterator
End();
167 template<
class KEYTYPE,
class VALTYPE>
173 typedef typename std::map<key_type,value_type>
map_type;
185 inline std::pair<iterator,G4bool>
Insert(
const key_type& k ,
const value_type& v );
186 inline iterator
Begin();
187 inline iterator
End();
188 inline iterator
Find(
const key_type& k );
189 inline value_type&
Get(
const key_type& k );
190 inline size_type
Erase(
const key_type& k );
191 inline value_type&
operator[](
const key_type& k);
221 cout<<
"G4Cache id: "<<
id<<endl;
230 if (
this == &rhs )
return;
237 cout<<
"Copy constructor with id: "<<
id<<endl;
244 if (
this == &rhs)
return *
this;
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>
G4CacheReference< value_type > theCache
void Initialize(unsigned int id)
value_type & GetCache() const
static unsigned int instancesctr
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)
static unsigned int dstrctr
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