|
Jpp 21.0.0-rc.1
the software that should make you happy
|
Multidimensional key. More...
#include <JMultiKey.hh>
Public Types | |
| typedef JKey_t | key_type |
| typedef JMultiKey< N-1, JKey_t > | mapped_type |
| typedef std::pair< key_type, mapped_type > | pair_type |
| typedef std::array< key_type, N > | array_type |
| typedef std::conditional< std::is_const< key_type >::value, typenamestd::remove_const< key_type >::type, typenamestd::add_const< key_type >::type >::type | U |
Public Member Functions | |
| JMultiKey () | |
| Default constructor. | |
| JMultiKey (typename JClass< mapped_type >::argument_type first, typename JClass< key_type > ::argument_type second) | |
| Append constructor. | |
| JMultiKey (typename JClass< key_type > ::argument_type first, typename JClass< mapped_type >::argument_type second) | |
| Insert constructor. | |
| JMultiKey (const JMultiKey &first, typename JClass< key_type >::argument_type second) | |
| Shift constructor. | |
| JMultiKey (const JMultiKey< N, U > &key) | |
| Copy constructor. | |
| JMultiKey (const std::array< key_type, N > &array) | |
| Copy constructor. | |
| operator array_type () const | |
| Type conversion operator. | |
| bool | less (const JMultiKey &key) const |
| Less than method. | |
| JMultiKey< N-1, key_type > | front () const |
| Get frontend key. | |
| key_type | back () const |
| Get backend key. | |
Private Member Functions | |
| template<class ... Args> | |
| std::array< key_type, N-1 > | pop_front (const key_type key, const Args &...args) |
| Auxiliary method to pop front array. | |
| template<size_t ... i> | |
| std::array< key_type, N-1 > | pop_front (const std::array< key_type, N > &array, const std::index_sequence< i... > &ls) |
| Pop front array. | |
Static Private Member Functions | |
| template<size_t ... i> | |
| static array_type | to_array (const key_type &key, const typename mapped_type::array_type &array, std::index_sequence< i... >) |
| Auxiliary method to convert keys to array. | |
Friends | |
| std::istream & | operator>> (std::istream &in, JMultiKey &key) |
| Read key from input. | |
| std::ostream & | operator<< (std::ostream &out, const JMultiKey &key) |
| Write key to output. | |
Multidimensional key.
This class reproduces the key of a multidimensional map. The individual data members can be accessed as, e.g:
JMultiKey<3, key_type> key;
key[[.second].second].first;
Definition at line 41 of file JMultiKey.hh.
| JKey_t JTOOLS::JMultiKey< N, JKey_t >::key_type |
Definition at line 47 of file JMultiKey.hh.
| JMultiKey<N-1, JKey_t> JTOOLS::JMultiKey< N, JKey_t >::mapped_type |
Definition at line 48 of file JMultiKey.hh.
| std::pair<key_type, mapped_type> JTOOLS::JMultiKey< N, JKey_t >::pair_type |
Definition at line 49 of file JMultiKey.hh.
| std::array<key_type, N> JTOOLS::JMultiKey< N, JKey_t >::array_type |
Definition at line 50 of file JMultiKey.hh.
| std::conditional<std::is_const<key_type>::value,typenamestd::remove_const<key_type>::type,typenamestd::add_const<key_type>::type>::type JTOOLS::JMultiKey< N, JKey_t >::U |
Definition at line 54 of file JMultiKey.hh.
|
inline |
|
inline |
Append constructor.
The secondary key is appended to the end of the primary keys.
| first | primary keys |
| second | secondary key |
Definition at line 71 of file JMultiKey.hh.
|
inline |
Insert constructor.
The primary key is inserted at the start of the secondary keys.
| first | primary key |
| second | secondary keys |
Definition at line 84 of file JMultiKey.hh.
|
inline |
Shift constructor.
The first of the primary keys is removed and the secondary key is appended to the end of the remainder of the primary keys.
| first | primary keys |
| second | secondary key |
Definition at line 97 of file JMultiKey.hh.
|
inline |
|
inline |
Copy constructor.
| array | array |
Definition at line 117 of file JMultiKey.hh.
|
inline |
Type conversion operator.
Definition at line 127 of file JMultiKey.hh.
|
inline |
Less than method.
| key | key |
Definition at line 139 of file JMultiKey.hh.
|
inline |
Get frontend key.
Definition at line 153 of file JMultiKey.hh.
|
inline |
Get backend key.
Definition at line 164 of file JMultiKey.hh.
|
inlinestaticprivate |
Auxiliary method to convert keys to array.
| key | key |
| array | array |
Definition at line 214 of file JMultiKey.hh.
|
inlineprivate |
Auxiliary method to pop front array.
| key | key |
| args | values |
Definition at line 229 of file JMultiKey.hh.
|
inlineprivate |
Pop front array.
| array | array |
| ls | indices of array |
Definition at line 242 of file JMultiKey.hh.
|
friend |
Read key from input.
| in | input stream |
| key | key |
Definition at line 177 of file JMultiKey.hh.
|
friend |
Write key to output.
| out | output stream |
| key | key |
Definition at line 193 of file JMultiKey.hh.