Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

vlCouple< T > Class Template Reference

This class defines a datatype for storing two entries of the same type. More...

#include <vlcouple.h>

List of all members.

Public Member Functions

 vlCouple (T const &x=0, T const &y=0)
 default constructor

 ~vlCouple ()
 default destructor

x () const
 get value of x

y () const
 get value of y

T const & xRef () const
 get value of x

T const & yRef () const
 get value of y

template<class S> void x (const S &value)
 set value of x

template<class S> void y (const S &value)
 set value of y

vlCouple< T > & operator= (vlCouple< T > const &other)
 override for = operator

bool operator== (vlCouple< T > const &other) const
 checks if the two couple are equal

bool operator!= (vlCouple< T > const &other) const
 checks if the two couple are unequal

vlCouple< T > operator+ () const
 multiples couple elements with +1

vlCouple< T > operator- () const
 multiples couple elements with -1

vlCouple< T > operator+ (vlCouple< T > const &other) const
 adds another couple to self and returns the sum

vlCouple< T > operator+ (T const &value) const
 adds a const value to self and returns the sum

vlCouple< T > operator- (vlCouple< T > const &other) const
 subtracts another couple from self and returns the result

vlCouple< T > operator- (T const &value) const
 subtracts a const value from self and returns the result

vlCouple< T > & operator+= (vlCouple< T > const &other)
 adds another couple to self

vlCouple< T > & operator-= (vlCouple< T > const &other)
 subtracts another couple from self

vlCouple< T > operator * (T const &other) const
 multiples self with other and returns the result

vlCouple< T > operator/ (T const &other) const
 divides other from self and returns the result

void operator *= (T const &other)
 multiples self with other (self changes)

void operator/= (T const &other)
 divides other from self (self changes)


Protected Attributes

m_x
 member variables storing the 2 entries in the couple

m_y
 member variables storing the 2 entries in the couple


Friends

std::ostream & operator<< (std::ostream &os, vlCouple< T > const *const v)
 overriding << to enable writing couple to a stream

std::ostream & operator<< (std::ostream &os, vlCouple< T > const &v)
 overriding << to enable writing couple to a stream


Detailed Description

template<class T>
class vlCouple< T >

The entries can be accessed using the x() and y() member functions.

Author:
Sarang Lakare <sarang@users.sf.net>

Definition at line 42 of file vlcouple.h.


Constructor & Destructor Documentation

template<class T>
vlCouple< T >::vlCouple T const &  x = 0,
T const &  y = 0
 

Parameters:
T data type.
x the x value.
y the y value.
z the z value

Definition at line 143 of file vlcouple.h.

References x, and y.

Referenced by vlCouple< T >::operator *(), and vlCouple< T >::operator/().

template<class T>
vlCouple< T >::~vlCouple  ) 
 

Parameters:
T data type.

Definition at line 157 of file vlcouple.h.


Member Function Documentation

template<class T>
vlCouple< T > vlCouple< T >::operator * T const &  value  )  const [inline]
 

Parameters:
T data type.
value the value vector to multiply.
Returns:
another couple with the result.

Definition at line 379 of file vlcouple.h.

References vlCouple< T >::m_x, vlCouple< T >::m_y, and vlCouple< T >::vlCouple().

template<class T>
void vlCouple< T >::operator *= T const &  other  )  [inline]
 

Parameters:
T data type.
value the value vector to multiply.
Returns:
self with the new value.

Definition at line 436 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
bool vlCouple< T >::operator!= vlCouple< T > const &  other  )  const [inline]
 

Parameters:
T data type.
other the other couple to compare with.
Returns:
true if the two couples are unequal.

Definition at line 230 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
vlCouple< T > vlCouple< T >::operator+ T const &  value  )  const [inline]
 

Parameters:
T data type.
value the constant value to add.
Returns:
another couple with the sum.

Definition at line 311 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
vlCouple< T > vlCouple< T >::operator+ vlCouple< T > const &  other  )  const [inline]
 

Parameters:
T data type.
other the other couple.
Returns:
another couple with the sum.

Definition at line 298 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
vlCouple< T > vlCouple< T >::operator+  )  const [inline]
 

Parameters:
T data type.
Returns:
another couple with the result.

Definition at line 273 of file vlcouple.h.

template<class T>
vlCouple< T > & vlCouple< T >::operator+= vlCouple< T > const &  other  )  [inline]
 

Parameters:
T data type.
other the other couple.
Returns:
self with the new value.

Definition at line 350 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
vlCouple< T > vlCouple< T >::operator- T const &  value  )  const [inline]
 

Parameters:
T data type.
value the constant value to subtract.
Returns:
another couple with the result.

Definition at line 337 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
vlCouple< T > vlCouple< T >::operator- vlCouple< T > const &  other  )  const [inline]
 

Parameters:
T data type.
other the other couple.
Returns:
another couple with the result.

Definition at line 324 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
vlCouple< T > vlCouple< T >::operator-  )  const [inline]
 

Parameters:
T data type
Returns:
another couple with the result.

Definition at line 285 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
vlCouple< T > & vlCouple< T >::operator-= vlCouple< T > const &  other  )  [inline]
 

Parameters:
T data type.
other the other couple.
Returns:
self with the new value.

Definition at line 364 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
vlCouple< T > vlCouple< T >::operator/ T const &  value  )  const [inline]
 

Parameters:
T data type.
value the value vector to devide with.
Returns:
another couple with the result.

Definition at line 392 of file vlcouple.h.

References vlCouple< T >::m_x, vlCouple< T >::m_y, and vlCouple< T >::vlCouple().

template<class T>
void vlCouple< T >::operator/= T const &  other  )  [inline]
 

Parameters:
T data type.
value the value vector to divide.
Returns:
self with the new value.

Definition at line 450 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
vlCouple< T > & vlCouple< T >::operator= vlCouple< T > const &  other  )  [inline]
 

Parameters:
T data type.
other the other couple to copy.
Returns:
pointer to self.

Definition at line 171 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
bool vlCouple< T >::operator== vlCouple< T > const &  other  )  const [inline]
 

Parameters:
T data type.
other the other couple to compare with.
Returns:
true if the two couples are equal.

Definition at line 186 of file vlcouple.h.

References vlCouple< T >::m_x, and vlCouple< T >::m_y.

template<class T>
template<class S>
void vlCouple< T >::x const S &  value  )  [inline]
 

Definition at line 65 of file vlcouple.h.

References vlCouple< T >::m_x.

template<class T>
T vlCouple< T >::x  )  const [inline]
 

Definition at line 52 of file vlcouple.h.

References vlCouple< T >::m_x.

Referenced by vlTxFunction::addPoint(), and vlTxFunction::updateTable().

template<class T>
T const& vlCouple< T >::xRef  )  const [inline]
 

Definition at line 58 of file vlcouple.h.

References vlCouple< T >::m_x.

template<class T>
template<class S>
void vlCouple< T >::y const S &  value  )  [inline]
 

Definition at line 69 of file vlcouple.h.

References vlCouple< T >::m_y.

template<class T>
T vlCouple< T >::y  )  const [inline]
 

Definition at line 55 of file vlcouple.h.

References vlCouple< T >::m_y.

Referenced by vlTxFunction::addPoint(), and vlTxFunction::updateTable().

template<class T>
T const& vlCouple< T >::yRef  )  const [inline]
 

Definition at line 61 of file vlcouple.h.

References vlCouple< T >::m_y.


Friends And Related Function Documentation

template<class T>
std::ostream& operator<< std::ostream &  os,
vlCouple< T > const &  v
[friend]
 

Definition at line 123 of file vlcouple.h.

template<class T>
std::ostream& operator<< std::ostream &  os,
vlCouple< T > const *const  v
[friend]
 

Definition at line 118 of file vlcouple.h.


Member Data Documentation

template<class T>
T vlCouple< T >::m_x [protected]
 

Definition at line 129 of file vlcouple.h.

Referenced by vlCouple< T >::operator *(), vlCouple< T >::operator *=(), vlCouple< T >::operator!=(), vlCouple< T >::operator+(), vlCouple< T >::operator+=(), vlCouple< T >::operator-(), vlCouple< T >::operator-=(), vlCouple< T >::operator/(), vlCouple< T >::operator/=(), vlCouple< T >::operator=(), vlCouple< T >::operator==(), vlCouple< T >::x(), and vlCouple< T >::xRef().

template<class T>
T vlCouple< T >::m_y [protected]
 

Definition at line 129 of file vlcouple.h.

Referenced by vlCouple< T >::operator *(), vlCouple< T >::operator *=(), vlCouple< T >::operator!=(), vlCouple< T >::operator+(), vlCouple< T >::operator+=(), vlCouple< T >::operator-(), vlCouple< T >::operator-=(), vlCouple< T >::operator/(), vlCouple< T >::operator/=(), vlCouple< T >::operator=(), vlCouple< T >::operator==(), vlCouple< T >::y(), and vlCouple< T >::yRef().


The documentation for this class was generated from the following file:
Generated on Fri Mar 18 11:33:18 2005 for OpenVL by doxygen 1.3.3