Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions
G4MapCache< KEYTYPE, VALTYPE > Class Template Reference

#include <G4Cache.hh>

Inheritance diagram for G4MapCache< KEYTYPE, VALTYPE >:
G4Cache< std::map< 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)
 
virtual ~G4Cache ()
 
value_typeGet () const
 
void Put (const value_type &val) const
 
value_type Pop ()
 

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 351 of file G4Cache.hh.

References G4Cache< VALTYPE >::GetId().

352 {
353 #ifdef g4cdebug
354  cout<<"~G4MacCache "<<G4Cache<map_type>::GetId()<<" with size: "<<Size()<<"->";
355  for ( iterator it = Begin() ; it != End() ; ++it )
356  cout<<it->first<<":"<<it->second<<",";
357  cout<<"<-"<<endl;
358 #endif
359 }
iterator End()
Definition: G4Cache.hh:382
size_type Size()
Definition: G4Cache.hh:192
const int & GetId() const
Definition: G4Cache.hh:109
map_type::iterator iterator
Definition: G4Cache.hh:175
iterator Begin()
Definition: G4Cache.hh:377

Member Function Documentation

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

Definition at line 377 of file G4Cache.hh.

References G4Cache< VALTYPE >::Get().

378 {
379  return G4Cache<map_type>::Get().begin();
380 }
value_type & Get() const
Definition: G4Cache.hh:253
template<class K , class V >
G4MapCache< K, V >::iterator G4MapCache< K, V >::End ( )
inline

Definition at line 382 of file G4Cache.hh.

References G4Cache< VALTYPE >::Get().

Referenced by G4VBiasingOperator::AttachTo(), and G4VBiasingOperator::GetBiasingOperator().

383 {
384  return G4Cache<map_type>::Get().end();
385 }
value_type & Get() const
Definition: G4Cache.hh:253
template<class KEYTYPE, class VALTYPE>
G4MapCache< K, V >::size_type G4MapCache< K, V >::Erase ( const key_type k)
inline

Definition at line 406 of file G4Cache.hh.

References G4Cache< VALTYPE >::Get().

407 {
408  return G4Cache<map_type>::Get().erase(k);
409 }
value_type & Get() const
Definition: G4Cache.hh:253
template<class KEYTYPE, class VALTYPE>
G4MapCache< K, V >::iterator G4MapCache< K, V >::Find ( const key_type k)
inline

Definition at line 388 of file G4Cache.hh.

References G4Cache< VALTYPE >::Get().

Referenced by G4VBiasingOperator::AttachTo(), and G4VBiasingOperator::GetBiasingOperator().

389 {
390  return G4Cache<map_type>::Get().find(k);
391 }
value_type & Get() const
Definition: G4Cache.hh:253
template<class KEYTYPE, class VALTYPE>
V & G4MapCache< K, V >::Get ( const key_type k)
inline

Definition at line 400 of file G4Cache.hh.

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

Definition at line 394 of file G4Cache.hh.

395 {
396  return ( Find(k) != End() );
397 }
iterator End()
Definition: G4Cache.hh:382
iterator Find(const key_type &k)
Definition: G4Cache.hh:388
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 362 of file G4Cache.hh.

References G4Cache< VALTYPE >::Get().

366 {
367  return G4Cache<map_type>::Get().insert( std::pair<key_type,value_type>(k,v) );
368 }
value_type & Get() const
Definition: G4Cache.hh:253
template<class KEYTYPE, class VALTYPE>
V & G4MapCache< K, V >::operator[] ( const key_type k)
inline

Definition at line 412 of file G4Cache.hh.

413 {
414  return (G4Cache<map_type>::Get())[k];
415 }
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:253

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