ULAPI  8.0
Public Member Functions | Public Attributes | List of all members
ULPair< T, U > Class Template Reference

A ULPair<T, U> object is an ordered pair of objects of the specified types. More...

#include <ulcontainers.h>

Public Member Functions

 ULPair ()
 
 ULPair (const T &firstItem, const U &secondItem)
 
 ULPair (const ULPair< T, U > &p)
 
ULPair< T, U > & operator= (const ULPair< T, U > &p)
 
bool operator== (const ULPair< T, U > &p) const
 
bool operator< (const ULPair< T, U > &p) const
 
bool operator!= (const ULPair< T, U > &p) const
 
const T & getFirst () const
 
const U & getSecond () const
 
void setFirst (const T &f)
 
void setSecond (const U &s)
 

Public Attributes

first
 
second
 

Detailed Description

template<class T, class U>
class ULPair< T, U >

A ULPair<T, U> object is an ordered pair of objects of the specified types.

The generic types T and U must have operators == and < defined.

Constructor & Destructor Documentation

template<class T , class U >
ULPair< T, U >::ULPair ( )

Default constructor.

template<class T, class U>
ULPair< T, U >::ULPair ( const T &  firstItem,
const U &  secondItem 
)

Constructor that assigns the parameters to the ULPair's components.

template<class T, class U>
ULPair< T, U >::ULPair ( const ULPair< T, U > &  p)

Copy constructor.

Member Function Documentation

template<class T , class U >
const T & ULPair< T, U >::getFirst ( ) const
Returns
the first component of this pair.
template<class T , class U >
const U & ULPair< T, U >::getSecond ( ) const
Returns
the second component of this pair.
template<class T, class U>
bool ULPair< T, U >::operator!= ( const ULPair< T, U > &  p) const

Inequality operator.

Returns
false if both the first and second components of this pair and p are equal, and true otherwise. Depends on operator== for both T and U.
template<class T, class U>
bool ULPair< T, U >::operator< ( const ULPair< T, U > &  p) const

Comparison operator. Tests for lexigraphical ordering of the ULPairs. The U element is only used to determine order if the T elements are of equal value.

Parameters
pThe second pair in the evaluation
Returns
True if this pair is lexicographically strictly less than p.
template<class T, class U>
ULPair< T, U > & ULPair< T, U >::operator= ( const ULPair< T, U > &  p)

Assignment operator.

template<class T, class U>
bool ULPair< T, U >::operator== ( const ULPair< T, U > &  p) const

Equality operator.

Returns
true if both the first and second components of this pair and p are equal. Depends on operator== for both T and U.
template<class T, class U >
void ULPair< T, U >::setFirst ( const T &  f)

Assigns a new value to this pair's first component.

Parameters
[in]fThe new value.
template<class T , class U>
void ULPair< T, U >::setSecond ( const U &  s)

Assigns a new value to this pair's second component.

Parameters
[in]sThe new value.

Member Data Documentation

template<class T, class U>
T ULPair< T, U >::first
template<class T, class U>
U ULPair< T, U >::second

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