Jpp  master_rocky-43-ge265d140c
the software that should make you happy
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::JHashMap< key_type, value_type, JHashEvaluator > JTOOLS::JHashMap< JHead_t, JValue_t, JEvaluator_t > JTOOLS::JHashMap< int, JModuleAnalogueSignalProcessor > JTOOLS::JHashMap< int, int > JTOOLS::JHashMap< int, function_type > JTOOLS::JHashMap< int, JTOOLS::JHashMap< int, JDETECTOR::JModuleAddress > > JTOOLS::JHashMap< int, JGEOMETRY3D::JQuaternion3D > JTOOLS::JHashMap< JHead_t, JHashMap< JTail_t, JValue_t, JEvaluator_t >, JEvaluator_t > JTOOLS::JHashMap< int, JString > JTOOLS::JHashMap< int, JDETECTOR::JLocation > JTOOLS::JGarbageCollection< JKey_t, JValue_t > JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >

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

◆ key_type

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.

◆ mapped_type

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

◆ ~JMappableCollection()

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

◆ clear()

template<class JKey_t , class JValue_t >
virtual void JTOOLS::JMappableCollection< JKey_t, JValue_t >::clear ( )
pure virtual

◆ get() [1/2]

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

◆ get() [2/2]

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

◆ operator[]() [1/2]

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  }
virtual const mapped_type & get(typename JClass< key_type >::argument_type key) const =0
Get mapped value.

◆ operator[]() [2/2]

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  }

◆ put()

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: