Base Framework
Public Types | Public Member Functions | Protected Attributes | List of all members
Pair< FIRST, SECOND > Class Template Reference

Value pair binder. More...

#include <base/collection/Pair.h>

Public Types

typedef FIRST First
 
typedef SECOND Second
 

Public Member Functions

 Pair ()
 
 Pair (const First &_first)
 
 Pair (const First &_first, const Second &_second)
 
 Pair (First &&_first, Second &&_second)
 
 Pair (const First &_first, Second &&_second)
 
 Pair (First &&_first, const Second &_second)
 
 Pair (const Pair &copy)
 
 Pair (Pair &&move)
 
Pairoperator= (const Pair &assign)
 
Pairoperator= (Pair &&assign)
 
const FirstgetFirst () const noexcept
 
const SecondgetSecond () const noexcept
 
void setFirst (const First &value)
 
void setFirst (First &&value)
 
void setSecond (const Second &value)
 
void setSecond (Second &&value)
 
bool operator== (const Pair &compare) const
 
bool operator!= (const Pair &compare) const
 
bool operator< (const Pair &compare) const
 

Protected Attributes

First first
 
Second second
 

Detailed Description

template<class FIRST, class SECOND>
class Pair< FIRST, SECOND >

Value pair binder.

Binder of two values.

Version
1.0

Member Typedef Documentation

◆ First

template<class FIRST , class SECOND >
typedef FIRST Pair< FIRST, SECOND >::First

The type of the first value.

◆ Second

template<class FIRST , class SECOND >
typedef SECOND Pair< FIRST, SECOND >::Second

The type of the second value.

Constructor & Destructor Documentation

◆ Pair() [1/8]

template<class FIRST , class SECOND >
Pair< FIRST, SECOND >::Pair ( )
inline

Initializes a pair with default values.

◆ Pair() [2/8]

template<class FIRST , class SECOND >
Pair< FIRST, SECOND >::Pair ( const First _first)
inline

Initializes a pair with the specified first value.

Parameters
firstThe first value.
secondThe second value.

◆ Pair() [3/8]

template<class FIRST , class SECOND >
Pair< FIRST, SECOND >::Pair ( const First _first,
const Second _second 
)
inline

Initializes a pair with the specified values.

Parameters
firstThe first value.
secondThe second value.

◆ Pair() [4/8]

template<class FIRST , class SECOND >
Pair< FIRST, SECOND >::Pair ( First &&  _first,
Second &&  _second 
)
inline

Initializes a pair with the specified values.

Parameters
firstThe first value.
secondThe second value.

◆ Pair() [5/8]

template<class FIRST , class SECOND >
Pair< FIRST, SECOND >::Pair ( const First _first,
Second &&  _second 
)
inline

Initializes a pair with the specified values.

Parameters
firstThe first value.
secondThe second value.

◆ Pair() [6/8]

template<class FIRST , class SECOND >
Pair< FIRST, SECOND >::Pair ( First &&  _first,
const Second _second 
)
inline

Initializes a pair with the specified values.

Parameters
firstThe first value.
secondThe second value.

◆ Pair() [7/8]

template<class FIRST , class SECOND >
Pair< FIRST, SECOND >::Pair ( const Pair< FIRST, SECOND > &  copy)
inline

Initializes a pair from other pair.

◆ Pair() [8/8]

template<class FIRST , class SECOND >
Pair< FIRST, SECOND >::Pair ( Pair< FIRST, SECOND > &&  move)
inline

Initializes a pair from other pair.

Member Function Documentation

◆ getFirst()

template<class FIRST , class SECOND >
const First& Pair< FIRST, SECOND >::getFirst ( ) const
inlinenoexcept

Returns the first value.

◆ getSecond()

template<class FIRST , class SECOND >
const Second& Pair< FIRST, SECOND >::getSecond ( ) const
inlinenoexcept

Returns the second value.

◆ operator!=()

template<class FIRST , class SECOND >
bool Pair< FIRST, SECOND >::operator!= ( const Pair< FIRST, SECOND > &  compare) const
inline

Returns true if this pair is equal to the specified pair.

◆ operator<()

template<class FIRST , class SECOND >
bool Pair< FIRST, SECOND >::operator< ( const Pair< FIRST, SECOND > &  compare) const
inline

Returns true if this pair is less than the specified pair.

◆ operator=() [1/2]

template<class FIRST , class SECOND >
Pair& Pair< FIRST, SECOND >::operator= ( const Pair< FIRST, SECOND > &  assign)
inline

Assignment of pair by pair.

◆ operator=() [2/2]

template<class FIRST , class SECOND >
Pair& Pair< FIRST, SECOND >::operator= ( Pair< FIRST, SECOND > &&  assign)
inline

Assignment of pair by pair.

◆ operator==()

template<class FIRST , class SECOND >
bool Pair< FIRST, SECOND >::operator== ( const Pair< FIRST, SECOND > &  compare) const
inline

Returns true if this pair is equal to the specified pair.

◆ setFirst() [1/2]

template<class FIRST , class SECOND >
void Pair< FIRST, SECOND >::setFirst ( const First value)
inline

Sets the first value.

◆ setFirst() [2/2]

template<class FIRST , class SECOND >
void Pair< FIRST, SECOND >::setFirst ( First &&  value)
inline

Sets the first value.

◆ setSecond() [1/2]

template<class FIRST , class SECOND >
void Pair< FIRST, SECOND >::setSecond ( const Second value)
inline

Sets the second value.

◆ setSecond() [2/2]

template<class FIRST , class SECOND >
void Pair< FIRST, SECOND >::setSecond ( Second &&  value)
inline

Sets the second value.

Member Data Documentation

◆ first

template<class FIRST , class SECOND >
First Pair< FIRST, SECOND >::first
protected

The first value.

◆ second

template<class FIRST , class SECOND >
Second Pair< FIRST, SECOND >::second
protected

The second value.