Public Types | Public Member Functions | Private Attributes

mln::util::ord_pair< T > Struct Template Reference
[Utilities]

Ordered pair structure s.a. More...

#include <ord_pair.hh>

Inheritance diagram for mln::util::ord_pair< T >:
Inheritance graph

List of all members.

Public Types

typedef Object< void > category
typedef ord_pair< T > exact_t

Public Member Functions

void change_both (const T &first, const T &second)
 Replace both members of the pair by val, while keeping the relative order.
void change_first (const T &val)
 Replace the first member of the pair by val, while keeping the relative order.
void change_second (const T &val)
 Replace the second member of the pair by val, while keeping the relative order.
 ord_pair ()
 ord_pair (const T &val1, const T &val2)

const T & first () const
 Get the first (lowest) member of the pair.
T & first ()

const T & second () const
 Get the second (highest) member of the pair.
T & second ()

Private Attributes

first_
second_

Detailed Description

template<typename T>
struct mln::util::ord_pair< T >

Ordered pair structure s.a.

this->first <= this->second; ordered pairs are partially ordered using lexicographical ordering.

Definition at line 50 of file ord_pair.hh.


Member Typedef Documentation

typedef Object<void> mln::Object< ord_pair< T > >::category [inherited]

Definition at line 174 of file object.hh.

typedef ord_pair< T > mln::Object< ord_pair< T > >::exact_t [inherited]

Definition at line 173 of file object.hh.


Constructor & Destructor Documentation

template<typename T >
mln::util::ord_pair< T >::ord_pair (  )  [inline]

Definition at line 131 of file ord_pair.hh.

template<typename T>
mln::util::ord_pair< T >::ord_pair ( const T &  val1,
const T &  val2 
) [inline]

Definition at line 137 of file ord_pair.hh.

References mln::util::ord_pair< T >::change_both().


Member Function Documentation

template<typename T>
void mln::util::ord_pair< T >::change_both ( const T &  first,
const T &  second 
) [inline]

Replace both members of the pair by val, while keeping the relative order.

Postcondition:
first_ <= second_ (with <= being the mln::util::ord_weak relationship).

Definition at line 211 of file ord_pair.hh.

References mln::util::ord_pair< T >::first_, mln::util::ord_strict(), mln::util::ord_weak(), and mln::util::ord_pair< T >::second_.

Referenced by mln::util::ord_pair< T >::ord_pair().

template<typename T>
void mln::util::ord_pair< T >::change_first ( const T &  val  )  [inline]

Replace the first member of the pair by val, while keeping the relative order.

Postcondition:
first_ <= second_ (with <= being the mln::util::ord_weak relationship).

Definition at line 181 of file ord_pair.hh.

References mln::util::ord_pair< T >::first_, mln::util::ord_strict(), mln::util::ord_weak(), and mln::util::ord_pair< T >::second_.

template<typename T>
void mln::util::ord_pair< T >::change_second ( const T &  val  )  [inline]

Replace the second member of the pair by val, while keeping the relative order.

Postcondition:
first_ <= second_ (with <= being the mln::util::ord_weak relationship).

Definition at line 196 of file ord_pair.hh.

References mln::util::ord_pair< T >::first_, mln::util::ord_strict(), mln::util::ord_weak(), and mln::util::ord_pair< T >::second_.

template<typename T >
T & mln::util::ord_pair< T >::first (  )  [inline]

Definition at line 157 of file ord_pair.hh.

References mln::util::ord_pair< T >::first_.

template<typename T >
const T & mln::util::ord_pair< T >::first (  )  const [inline]

Get the first (lowest) member of the pair.

Definition at line 149 of file ord_pair.hh.

References mln::util::ord_pair< T >::first_.

Referenced by mln::util::graph::add_edge(), mln::util::site_pair< P >::first(), and mln::util::operator==().

template<typename T >
const T & mln::util::ord_pair< T >::second (  )  const [inline]

Get the second (highest) member of the pair.

Definition at line 165 of file ord_pair.hh.

References mln::util::ord_pair< T >::second_.

Referenced by mln::util::graph::add_edge(), mln::util::operator==(), and mln::util::site_pair< P >::second().

template<typename T >
T & mln::util::ord_pair< T >::second (  )  [inline]

Definition at line 173 of file ord_pair.hh.

References mln::util::ord_pair< T >::second_.


Member Data Documentation

template<typename T>
T mln::util::ord_pair< T >::first_ [private]
template<typename T>
T mln::util::ord_pair< T >::second_ [private]