Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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::JGarbageCollection< JKey_t, JValue_t > JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t > JACOUSTICS::JModel::hash_map< JEKey, JEmission > JACOUSTICS::JModel::hash_map< int, JString, hash_evaluator > JACOUSTICS::JModel::hash_map< JACOUSTICS::JEKey, JACOUSTICS::JMODEL::JEmission > JACOUSTICS::JGEOMETRY::JDetector JACOUSTICS::JModel::hash_map< key_type, value_type, evaluator_type > JDETECTOR::JPMTDefaultSimulator JACOUSTICS::JModel::emission_type JACOUSTICS::JModel::string_type JTRIGGER::JPMTRunByRunSimulator

Public Types

typedef JKey_t key_type
 
typedef JValue_t mapped_type
 

Public Member Functions

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

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 >
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 >
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()

◆ get() [1/2]

◆ get() [2/2]

◆ 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: