Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4MapCache< KEYTYPE, VALTYPE > Class Template Reference

#include <G4Cache.hh>

Inheritance diagram for G4MapCache< KEYTYPE, VALTYPE >:
Collaboration diagram for G4MapCache< KEYTYPE, VALTYPE >:

Public Types

typedef KEYTYPE key_type
 
typedef VALTYPE value_type
 
typedef std::map< key_type,
value_type
map_type
 
typedef map_type::size_type size_type
 
typedef map_type::iterator iterator
 
typedef map_type::const_iterator const_iterator
 
- Public Types inherited from G4Cache< std::map< KEYTYPE, VALTYPE > >
typedef std::map< KEYTYPE,
VALTYPE > 
value_type
 

Public Member Functions

virtual ~G4MapCache ()
 
G4bool Has (const key_type &k)
 
std::pair< iterator, G4boolInsert (const key_type &k, const value_type &v)
 
iterator Begin ()
 
iterator End ()
 
iterator Find (const key_type &k)
 
value_typeGet (const key_type &k)
 
size_type Erase (const key_type &k)
 
value_typeoperator[] (const key_type &k)
 
size_type Size ()
 
- Public Member Functions inherited from G4Cache< std::map< KEYTYPE, VALTYPE > >
 G4Cache ()
 
 G4Cache (const value_type &v)
 
 G4Cache (const G4Cache &rhs)
 
virtual ~G4Cache ()
 
value_typeGet () const
 
void Put (const value_type &val) const
 
value_type Pop ()
 
G4Cacheoperator= (const G4Cache &rhs)
 

Additional Inherited Members

- Protected Member Functions inherited from G4Cache< std::map< KEYTYPE, VALTYPE > >
const intGetId () const
 

Detailed Description

template<class KEYTYPE, class VALTYPE>
class G4MapCache< KEYTYPE, VALTYPE >

Definition at line 168 of file G4Cache.hh.

Member Typedef Documentation

template<class KEYTYPE, class VALTYPE>
typedef map_type::const_iterator G4MapCache< KEYTYPE, VALTYPE >::const_iterator

Definition at line 176 of file G4Cache.hh.

template<class KEYTYPE, class VALTYPE>
typedef map_type::iterator G4MapCache< KEYTYPE, VALTYPE >::iterator

Definition at line 175 of file G4Cache.hh.

template<class KEYTYPE, class VALTYPE>
typedef KEYTYPE G4MapCache< KEYTYPE, VALTYPE >::key_type

Definition at line 171 of file G4Cache.hh.

template<class KEYTYPE, class VALTYPE>
typedef std::map<key_type,value_type> G4MapCache< KEYTYPE, VALTYPE >::map_type

Definition at line 173 of file G4Cache.hh.

template<class KEYTYPE, class VALTYPE>
typedef map_type::size_type G4MapCache< KEYTYPE, VALTYPE >::size_type

Definition at line 174 of file G4Cache.hh.

template<class KEYTYPE, class VALTYPE>
typedef VALTYPE G4MapCache< KEYTYPE, VALTYPE >::value_type

Definition at line 172 of file G4Cache.hh.

Constructor & Destructor Documentation

template<class K , class V >
G4MapCache< K, V >::~G4MapCache ( )
virtual

Definition at line 380 of file G4Cache.hh.

381 {
382 #ifdef g4cdebug
383  cout<<"~G4MacCache "<<G4Cache<map_type>::GetId()<<" with size: "<<Size()<<"->";
384  for ( iterator it = Begin() ; it != End() ; ++it )
385  cout<<it->first<<":"<<it->second<<",";
386  cout<<"<-"<<endl;
387 #endif
388 }
iterator End()
Definition: G4Cache.hh:411
size_type Size()
Definition: G4Cache.hh:192
const int & GetId() const
Definition: G4Cache.hh:112
map_type::iterator iterator
Definition: G4Cache.hh:175
iterator Begin()
Definition: G4Cache.hh:406

Here is the call graph for this function:

Member Function Documentation

template<class K , class V >
G4MapCache< K, V >::iterator G4MapCache< K, V >::Begin ( )
inline

Definition at line 406 of file G4Cache.hh.

407 {
408  return G4Cache<map_type>::Get().begin();
409 }
value_type & Get() const
Definition: G4Cache.hh:282

Here is the call graph for this function:

template<class K , class V >
G4MapCache< K, V >::iterator G4MapCache< K, V >::End ( )
inline

Definition at line 411 of file G4Cache.hh.

412 {
413  return G4Cache<map_type>::Get().end();
414 }
value_type & Get() const
Definition: G4Cache.hh:282

Here is the call graph for this function:

Here is the caller graph for this function:

template<class KEYTYPE, class VALTYPE>
G4MapCache< K, V >::size_type G4MapCache< K, V >::Erase ( const key_type k)
inline

Definition at line 435 of file G4Cache.hh.

436 {
437  return G4Cache<map_type>::Get().erase(k);
438 }
value_type & Get() const
Definition: G4Cache.hh:282

Here is the call graph for this function:

template<class KEYTYPE, class VALTYPE>
G4MapCache< K, V >::iterator G4MapCache< K, V >::Find ( const key_type k)
inline

Definition at line 417 of file G4Cache.hh.

418 {
419  return G4Cache<map_type>::Get().find(k);
420 }
value_type & Get() const
Definition: G4Cache.hh:282

Here is the call graph for this function:

Here is the caller graph for this function:

template<class KEYTYPE, class VALTYPE>
V & G4MapCache< K, V >::Get ( const key_type k)
inline

Definition at line 429 of file G4Cache.hh.

430 {
431  return Find(k)->second;
432 }
iterator Find(const key_type &k)
Definition: G4Cache.hh:417
template<class KEYTYPE, class VALTYPE>
G4bool G4MapCache< K, V >::Has ( const key_type k)
inline

Definition at line 423 of file G4Cache.hh.

424 {
425  return ( Find(k) != End() );
426 }
iterator End()
Definition: G4Cache.hh:411
iterator Find(const key_type &k)
Definition: G4Cache.hh:417
template<class KEYTYPE, class VALTYPE>
std::pair< typename G4MapCache< K, V >::iterator, G4bool > G4MapCache< K, V >::Insert ( const key_type k,
const value_type v 
)
inline

Definition at line 391 of file G4Cache.hh.

395 {
396  return G4Cache<map_type>::Get().insert( std::pair<key_type,value_type>(k,v) );
397 }
value_type & Get() const
Definition: G4Cache.hh:282
tuple v
Definition: test.py:18

Here is the call graph for this function:

template<class KEYTYPE, class VALTYPE>
V & G4MapCache< K, V >::operator[] ( const key_type k)
inline

Definition at line 441 of file G4Cache.hh.

442 {
443  return (G4Cache<map_type>::Get())[k];
444 }
template<class KEYTYPE, class VALTYPE>
size_type G4MapCache< KEYTYPE, VALTYPE >::Size ( )
inline

Definition at line 192 of file G4Cache.hh.

192 { return G4Cache<map_type>::Get().size(); } //Needs to be here for a VC9 compilation problem
value_type & Get() const
Definition: G4Cache.hh:282

The documentation for this class was generated from the following file: