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

Template specialisation for a pair of values. More...

#include <JPair.hh>

Public Types

typedef JKey_t key_type
 
typedef JValue_t mapped_type
 

Public Member Functions

 JPair ()
 Default constructor.
 
 JPair (typename JLANG::JClass< key_type > ::argument_type key, typename JLANG::JClass< mapped_type >::argument_type value)
 Constructor.
 
const key_typegetKey () const
 
const mapped_typegetValue () const
 
mapped_typegetValue ()
 

Public Attributes

JKey_t first
 
JValue_t second
 

Friends

std::istream & operator>> (std::istream &in, JPair< JKey_t, JValue_t > &pair)
 Read pair from input.
 
std::ostream & operator<< (std::ostream &out, const JPair< JKey_t, JValue_t > &pair)
 Write pair to output.
 
JReaderoperator>> (JReader &in, JPair< JKey_t, JValue_t > &pair)
 Read pair from input.
 
JWriteroperator<< (JWriter &out, const JPair< JKey_t, JValue_t > &pair)
 Write pair to output.
 

Detailed Description

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

Template specialisation for a pair of values.

Definition at line 28 of file JPair.hh.

Member Typedef Documentation

◆ key_type

template<class JKey_t , class JValue_t >
JKey_t JTOOLS::JPair< JKey_t, JValue_t >::key_type

Definition at line 32 of file JPair.hh.

◆ mapped_type

template<class JKey_t , class JValue_t >
JValue_t JTOOLS::JPair< JKey_t, JValue_t >::mapped_type

Definition at line 33 of file JPair.hh.

Constructor & Destructor Documentation

◆ JPair() [1/2]

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

Default constructor.

Definition at line 39 of file JPair.hh.

39 :
40 first (),
41 second()
42 {}
JKey_t first
Definition JPair.hh:128
JValue_t second
Definition JPair.hh:129

◆ JPair() [2/2]

template<class JKey_t , class JValue_t >
JTOOLS::JPair< JKey_t, JValue_t >::JPair ( typename JLANG::JClass< key_type > ::argument_type key,
typename JLANG::JClass< mapped_type >::argument_type value )
inline

Constructor.

Parameters
keyJKey_t
valueJValue_t

Definition at line 51 of file JPair.hh.

52 :
53 first (key),
54 second(value)
55 {}

Member Function Documentation

◆ getKey()

template<class JKey_t , class JValue_t >
const key_type & JTOOLS::JPair< JKey_t, JValue_t >::getKey ( ) const
inline

Definition at line 123 of file JPair.hh.

123{ return this->first; }

◆ getValue() [1/2]

template<class JKey_t , class JValue_t >
const mapped_type & JTOOLS::JPair< JKey_t, JValue_t >::getValue ( ) const
inline

Definition at line 124 of file JPair.hh.

124{ return this->second; }

◆ getValue() [2/2]

template<class JKey_t , class JValue_t >
mapped_type & JTOOLS::JPair< JKey_t, JValue_t >::getValue ( )
inline

Definition at line 126 of file JPair.hh.

126{ return this->second; }

Friends And Related Symbol Documentation

◆ operator>> [1/2]

template<class JKey_t , class JValue_t >
std::istream & operator>> ( std::istream & in,
JPair< JKey_t, JValue_t > & pair )
friend

Read pair from input.

Parameters
ininput stream
pairpair
Returns
input stream

Definition at line 65 of file JPair.hh.

66 {
67 in >> pair.first;
68 in >> pair.second;
69
70 return in;
71 }

◆ operator<< [1/2]

template<class JKey_t , class JValue_t >
std::ostream & operator<< ( std::ostream & out,
const JPair< JKey_t, JValue_t > & pair )
friend

Write pair to output.

Parameters
outoutput stream
pairpair
Returns
output stream

Definition at line 81 of file JPair.hh.

82 {
83 out << pair.first;
84 out << ' ';
85 out << pair.second;
86
87 return out;
88 }

◆ operator>> [2/2]

template<class JKey_t , class JValue_t >
JReader & operator>> ( JReader & in,
JPair< JKey_t, JValue_t > & pair )
friend

Read pair from input.

Parameters
inreader
pairpair
Returns
reader

Definition at line 98 of file JPair.hh.

99 {
100 in >> pair.first;
101 in >> pair.second;
102
103 return in;
104 }

◆ operator<< [2/2]

template<class JKey_t , class JValue_t >
JWriter & operator<< ( JWriter & out,
const JPair< JKey_t, JValue_t > & pair )
friend

Write pair to output.

Parameters
outwriter
pairpair
Returns
writer

Definition at line 114 of file JPair.hh.

115 {
116 out << pair.first;
117 out << pair.second;
118
119 return out;
120 }

Member Data Documentation

◆ first

template<class JKey_t , class JValue_t >
JKey_t JTOOLS::JPair< JKey_t, JValue_t >::first

Definition at line 128 of file JPair.hh.

◆ second

template<class JKey_t , class JValue_t >
JValue_t JTOOLS::JPair< JKey_t, JValue_t >::second

Definition at line 129 of file JPair.hh.


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