Jpp  18.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
JTOOLS::JMappableCollection< JKey_t, JValue_t > Struct Template Referenceabstract

Template interface definition for associative collection of elements. More...

#include <JMappableCollection.hh>

Inheritance diagram for JTOOLS::JMappableCollection< JKey_t, JValue_t >:
JTOOLS::JCollection< JElement2D< JKey_t, JHistogram_t >, JDistance_t > JTOOLS::JCollection< JElement2D< JKey_t, JValue_t >, JDistance_t > JTOOLS::JCollection< JElement2D_t > JTOOLS::JGarbageCollection< JKey_t, JValue_t > JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t > JTOOLS::JGridCollection< JElement2D< JKey_t, JHistogram_t >, JDistance_t > JTOOLS::JMap< JKey_t, JHistogram_t, JDistance_t > JTOOLS::JGridCollection< JElement2D< JKey_t, JValue_t >, JDistance_t > JTOOLS::JMap< JKey_t, JValue_t, JDistance_t > JTOOLS::JQuadrature JACOUSTICS::JModel::hash_map< int, JString > JACOUSTICS::JModel::hash_map< JACOUSTICS::JEKey, JACOUSTICS::JMODEL::JEmission > JACOUSTICS::JModel::hash_map< JEKey, JEmission > JACOUSTICS::JGEOMETRY::JDetector JACOUSTICS::JModel::hash_map< key_type, value_type > JDETECTOR::JPMTDefaultSimulator

Public Types

typedef JKey_t key_type
 
typedef JValue_t mapped_type
 

Public Member Functions

virtual ~JMappableCollection ()
 Virtual destructor. More...
 
virtual void clear ()=0
 Clear. More...
 
virtual const mapped_typeget (typename JClass< key_type >::argument_type key) const =0
 Get mapped value. More...
 
virtual mapped_typeget (typename JClass< key_type >::argument_type key)=0
 Get mapped value. More...
 
const mapped_typeoperator[] (typename JClass< key_type >::argument_type key) const
 Get mapped value. More...
 
mapped_typeoperator[] (typename JClass< key_type >::argument_type key)
 Get mapped value. More...
 
void put (typename JClass< key_type >::argument_type key, typename JClass< mapped_type >::argument_type value)
 Put pair-wise element (key,value) into collection. More...
 

Detailed Description

template<class JKey_t, class JValue_t>
struct JTOOLS::JMappableCollection< JKey_t, JValue_t >

Template interface definition for associative collection of elements.

The concrete associative collection should implement the following methods.

 
            void clear();
            mapped_type& get(key_type key);

This class implements the operator [key_type key] and method put(key_type key, mapped_type value).

Definition at line 30 of file JMappableCollection.hh.

Member Typedef Documentation

template<class JKey_t, class JValue_t>
typedef JKey_t JTOOLS::JMappableCollection< JKey_t, JValue_t >::key_type

Definition at line 33 of file JMappableCollection.hh.

template<class JKey_t, class JValue_t>
typedef JValue_t JTOOLS::JMappableCollection< JKey_t, JValue_t >::mapped_type

Definition at line 34 of file JMappableCollection.hh.

Constructor & Destructor Documentation

template<class JKey_t, class JValue_t>
virtual JTOOLS::JMappableCollection< JKey_t, JValue_t >::~JMappableCollection ( )
inlinevirtual

Virtual destructor.

Definition at line 39 of file JMappableCollection.hh.

40  {}

Member Function Documentation

template<class JKey_t, class JValue_t>
virtual void JTOOLS::JMappableCollection< JKey_t, JValue_t >::clear ( )
pure virtual
template<class JKey_t, class JValue_t>
virtual const mapped_type& JTOOLS::JMappableCollection< JKey_t, JValue_t >::get ( typename JClass< key_type >::argument_type  key) const
pure virtual
template<class JKey_t, class JValue_t>
virtual mapped_type& JTOOLS::JMappableCollection< JKey_t, JValue_t >::get ( typename JClass< key_type >::argument_type  key)
pure virtual
template<class JKey_t, class JValue_t>
const mapped_type& JTOOLS::JMappableCollection< JKey_t, JValue_t >::operator[] ( typename JClass< key_type >::argument_type  key) const
inline

Get mapped value.

Parameters
keykey
Returns
value

Definition at line 73 of file JMappableCollection.hh.

74  {
75  return get(key);
76  }
template<class JKey_t, class JValue_t>
mapped_type& JTOOLS::JMappableCollection< JKey_t, JValue_t >::operator[] ( typename JClass< key_type >::argument_type  key)
inline

Get mapped value.

Parameters
keykey
Returns
value

Definition at line 85 of file JMappableCollection.hh.

86  {
87  return get(key);
88  }
template<class JKey_t, class JValue_t>
void JTOOLS::JMappableCollection< JKey_t, JValue_t >::put ( typename JClass< key_type >::argument_type  key,
typename JClass< mapped_type >::argument_type  value 
)
inline

Put pair-wise element (key,value) into collection.

Parameters
keykey
valuevalue

Definition at line 97 of file JMappableCollection.hh.

99  {
100  get(key) = value;
101  }

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