Jpp  18.4.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 | Public Attributes | List of all members
JTOOLS::JMultiPair< N, JKey_t, JValue_t > Class Template Reference

Multidimensional pair. More...

#include <JMultiPair.hh>

Public Types

typedef JKey_t key_type
 
typedef JValue_t value_type
 
typedef JMultiPair< N-1,
key_type, value_type
mapped_type
 
typedef JLANG::JClass
< value_type >::reference_type 
reference_type
 
typedef JMultiKey< N, key_typemultikey_type
 

Public Member Functions

 JMultiPair ()
 Default constructor. More...
 
 JMultiPair (typename JClass< key_type >::argument_type __first, typename JClass< mapped_type >::argument_type __second)
 Constructor. More...
 
 JMultiPair (typename JClass< mapped_type >::argument_type __first, typename JClass< key_type >::argument_type __second)
 Constructor. More...
 
 JMultiPair (typename JClass< multikey_type >::argument_type key, typename JClass< value_type >::argument_type value)
 Constructor. More...
 
multikey_type getKey () const
 Get multidimensional key. More...
 
reference_type getValue ()
 Get value. More...
 
const reference_type getValue () const
 Get value. More...
 

Public Attributes

key_type first
 
mapped_type second
 

Detailed Description

template<unsigned int N, class JKey_t, class JValue_t>
class JTOOLS::JMultiPair< N, JKey_t, JValue_t >

Multidimensional pair.

This class reproduces the element of a multidimensional map. The individual data members can be accessed as:

          JMultiPair<3, key_type, mapped_type>  pair;
          pair[[.second].second].first;
          pair[[.second].second].second;

Definition at line 30 of file JMultiPair.hh.

Member Typedef Documentation

template<unsigned int N, class JKey_t, class JValue_t>
typedef JKey_t JTOOLS::JMultiPair< N, JKey_t, JValue_t >::key_type

Definition at line 34 of file JMultiPair.hh.

template<unsigned int N, class JKey_t, class JValue_t>
typedef JValue_t JTOOLS::JMultiPair< N, JKey_t, JValue_t >::value_type

Definition at line 35 of file JMultiPair.hh.

template<unsigned int N, class JKey_t, class JValue_t>
typedef JMultiPair<N-1, key_type, value_type> JTOOLS::JMultiPair< N, JKey_t, JValue_t >::mapped_type

Definition at line 36 of file JMultiPair.hh.

template<unsigned int N, class JKey_t, class JValue_t>
typedef JLANG::JClass<value_type>::reference_type JTOOLS::JMultiPair< N, JKey_t, JValue_t >::reference_type

Definition at line 37 of file JMultiPair.hh.

template<unsigned int N, class JKey_t, class JValue_t>
typedef JMultiKey<N, key_type> JTOOLS::JMultiPair< N, JKey_t, JValue_t >::multikey_type

Definition at line 38 of file JMultiPair.hh.

Constructor & Destructor Documentation

template<unsigned int N, class JKey_t, class JValue_t>
JTOOLS::JMultiPair< N, JKey_t, JValue_t >::JMultiPair ( )
inline

Default constructor.

Definition at line 44 of file JMultiPair.hh.

44  :
45  first (),
46  second()
47  {}
mapped_type second
Definition: JMultiPair.hh:125
template<unsigned int N, class JKey_t, class JValue_t>
JTOOLS::JMultiPair< N, JKey_t, JValue_t >::JMultiPair ( typename JClass< key_type >::argument_type  __first,
typename JClass< mapped_type >::argument_type  __second 
)
inline

Constructor.

The primary key is inserted at the start of the secondary keys.

Parameters
__firstprimary key
__secondsecondary keys and value

Definition at line 57 of file JMultiPair.hh.

58  :
59  first (__first),
60  second(__second)
61  {}
mapped_type second
Definition: JMultiPair.hh:125
template<unsigned int N, class JKey_t, class JValue_t>
JTOOLS::JMultiPair< N, JKey_t, JValue_t >::JMultiPair ( typename JClass< mapped_type >::argument_type  __first,
typename JClass< key_type >::argument_type  __second 
)
inline

Constructor.

The secondary key is appended to the end of the primary keys.

Parameters
__firstprimary keys and value
__secondsecondary key

Definition at line 71 of file JMultiPair.hh.

72  :
73  first (__first.first),
74  second(mapped_type(__first.second, __second))
75  {}
mapped_type second
Definition: JMultiPair.hh:125
JMultiPair< N-1, key_type, value_type > mapped_type
Definition: JMultiPair.hh:36
template<unsigned int N, class JKey_t, class JValue_t>
JTOOLS::JMultiPair< N, JKey_t, JValue_t >::JMultiPair ( typename JClass< multikey_type >::argument_type  key,
typename JClass< value_type >::argument_type  value 
)
inline

Constructor.

Parameters
keymultidimensional key
valuevalue

Definition at line 84 of file JMultiPair.hh.

85  :
86  first (key.first),
87  second(mapped_type(key.second, value))
88  {}
mapped_type second
Definition: JMultiPair.hh:125
JMultiPair< N-1, key_type, value_type > mapped_type
Definition: JMultiPair.hh:36

Member Function Documentation

template<unsigned int N, class JKey_t, class JValue_t>
multikey_type JTOOLS::JMultiPair< N, JKey_t, JValue_t >::getKey ( ) const
inline

Get multidimensional key.

Returns
multidimensional key

Definition at line 96 of file JMultiPair.hh.

97  {
98  return multikey_type(this->first, this->second.getKey());
99  }
multikey_type getKey() const
Get multidimensional key.
Definition: JMultiPair.hh:96
mapped_type second
Definition: JMultiPair.hh:125
JMultiKey< N, key_type > multikey_type
Definition: JMultiPair.hh:38
template<unsigned int N, class JKey_t, class JValue_t>
reference_type JTOOLS::JMultiPair< N, JKey_t, JValue_t >::getValue ( )
inline

Get value.

Returns
value

Definition at line 107 of file JMultiPair.hh.

108  {
109  return this->second.getValue();
110  }
mapped_type second
Definition: JMultiPair.hh:125
reference_type getValue()
Get value.
Definition: JMultiPair.hh:107
template<unsigned int N, class JKey_t, class JValue_t>
const reference_type JTOOLS::JMultiPair< N, JKey_t, JValue_t >::getValue ( ) const
inline

Get value.

Returns
value

Definition at line 118 of file JMultiPair.hh.

119  {
120  return this->second.getValue();
121  }
mapped_type second
Definition: JMultiPair.hh:125
reference_type getValue()
Get value.
Definition: JMultiPair.hh:107

Member Data Documentation

template<unsigned int N, class JKey_t, class JValue_t>
key_type JTOOLS::JMultiPair< N, JKey_t, JValue_t >::first

Definition at line 124 of file JMultiPair.hh.

template<unsigned int N, class JKey_t, class JValue_t>
mapped_type JTOOLS::JMultiPair< N, JKey_t, JValue_t >::second

Definition at line 125 of file JMultiPair.hh.


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