Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JTOOLS::JAutoMap< JKey_t, JValue_t > Class Template Reference

Wrapper class around std::map for automatic insertion of elements based on data types. More...

#include <JAutoMap.hh>

Inheritance diagram for JTOOLS::JAutoMap< JKey_t, JValue_t >:
std::map< JKey_t, JValue_t > JSUPPORT::JAutoTreeWriter< JNET::JTag > JSUPPORT::JAutoTreeScanner< JBase_t, JEvaluator_t > JSUPPORT::JAutoTreeWriter< JKey_t >

Public Types

typedef std::map< JKey_t, JValue_t > map_type
 
typedef map_type::value_type value_type
 

Public Member Functions

 JAutoMap ()
 Default constructor.
 
template<class T >
void insert ()
 Insert list of data types.
 
template<class T , class JElement_t >
void insert (const JAutomate< JElement_t > &automate)
 Insert list of data types.
 

Static Public Member Functions

template<class T >
static value_type getAutoElement (JType< T > type)
 Creation of a map element for given data type.
 

Protected Member Functions

template<class T , class JElement_t >
void insert (JType< T > type, const JAutomate< JElement_t > &automate)
 Insertion of single data type.
 
template<class JHead_t , class JTail_t , class JElement_t >
void insert (JType< JTypeList< JHead_t, JTail_t > > typelist, const JAutomate< JElement_t > &automate)
 Recursive insertion of data types.
 
template<class JElement_t >
void insert (JType< JNullType > type, const JAutomate< JElement_t > &automate)
 Template specialisation to terminate insertion of data types.
 

Detailed Description

template<class JKey_t, class JValue_t>
class JTOOLS::JAutoMap< JKey_t, JValue_t >

Wrapper class around std::map for automatic insertion of elements based on data types.

Definition at line 91 of file JAutoMap.hh.

Member Typedef Documentation

◆ map_type

template<class JKey_t , class JValue_t >
std::map<JKey_t, JValue_t> JTOOLS::JAutoMap< JKey_t, JValue_t >::map_type

Definition at line 96 of file JAutoMap.hh.

◆ value_type

template<class JKey_t , class JValue_t >
map_type::value_type JTOOLS::JAutoMap< JKey_t, JValue_t >::value_type

Definition at line 97 of file JAutoMap.hh.

Constructor & Destructor Documentation

◆ JAutoMap()

template<class JKey_t , class JValue_t >
JTOOLS::JAutoMap< JKey_t, JValue_t >::JAutoMap ( )
inline

Default constructor.

Definition at line 104 of file JAutoMap.hh.

105 {}

Member Function Documentation

◆ getAutoElement()

template<class JKey_t , class JValue_t >
template<class T >
static value_type JTOOLS::JAutoMap< JKey_t, JValue_t >::getAutoElement ( JType< T > type)
static

Creation of a map element for given data type.

This method should be overloaded for the requested data types if the method insert() is used without argument.

Parameters
typedata type
Returns
element

◆ insert() [1/5]

template<class JKey_t , class JValue_t >
template<class T >
void JTOOLS::JAutoMap< JKey_t, JValue_t >::insert ( )
inline

Insert list of data types.

Definition at line 125 of file JAutoMap.hh.

126 {
127 insert(JType<T>(), JAutomate<JAutoMap>());
128 }
void insert()
Insert list of data types.
Definition JAutoMap.hh:125

◆ insert() [2/5]

template<class JKey_t , class JValue_t >
template<class T , class JElement_t >
void JTOOLS::JAutoMap< JKey_t, JValue_t >::insert ( const JAutomate< JElement_t > & automate)
inline

Insert list of data types.

Parameters
automatetype defined element

Definition at line 137 of file JAutoMap.hh.

138 {
139 insert(JType<T>(), automate);
140 }

◆ insert() [3/5]

template<class JKey_t , class JValue_t >
template<class T , class JElement_t >
void JTOOLS::JAutoMap< JKey_t, JValue_t >::insert ( JType< T > type,
const JAutomate< JElement_t > & automate )
inlineprotected

Insertion of single data type.

Parameters
typedata type
automateelement automate by data type

Definition at line 150 of file JAutoMap.hh.

152 {
153 map_type::insert(automate.getElement(type));
154 }

◆ insert() [4/5]

template<class JKey_t , class JValue_t >
template<class JHead_t , class JTail_t , class JElement_t >
void JTOOLS::JAutoMap< JKey_t, JValue_t >::insert ( JType< JTypeList< JHead_t, JTail_t > > typelist,
const JAutomate< JElement_t > & automate )
inlineprotected

Recursive insertion of data types.

Parameters
typelisttype list
automateelement automate by data type

Definition at line 164 of file JAutoMap.hh.

166 {
167 insert(JType<JHead_t>(), automate);
168 insert(JType<JTail_t>(), automate);
169 }

◆ insert() [5/5]

template<class JKey_t , class JValue_t >
template<class JElement_t >
void JTOOLS::JAutoMap< JKey_t, JValue_t >::insert ( JType< JNullType > type,
const JAutomate< JElement_t > & automate )
inlineprotected

Template specialisation to terminate insertion of data types.

Parameters
typenull type
automateelement automate by data type

Definition at line 179 of file JAutoMap.hh.

181 {}

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