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

Pair.hpp

Go to the documentation of this file.
00001 
00027 // *************************************************************
00028 //
00029 //  Class Pair<C,D> for implementing pairs
00030 //
00031 //  14/04/2000 Breckenridge
00032 //  02/06/2000 Manchester, == added
00033 //
00034 // *************************************************************
00035 
00036 #ifndef __pair__
00037 #  define __pair__
00038 
00039 
00040 #include "Memory.hpp"
00041 
00042 
00043 // *******************Class Pair*******************************
00044 
00045 
00046 template <class C, class D, ClassID cid>
00047 class Pair
00048 #   if DEBUG_PREPRO
00049     : public Memory <cid>
00050 #   endif
00051 {
00052  public:
00053 
00054   // constructors
00055   inline
00056   Pair ( C left, D right )
00057     :
00058     _left ( left ),
00059     _right ( right ) {}
00060 
00061   inline
00062   Pair () {}
00063 
00064   // structure quering
00065   inline C left () const { return _left; }
00066   inline D right () const { return _right; }
00067 
00068   // change left/right elements
00069   inline void left ( C lft ) { _left = lft; }
00070   inline void right ( D rht ) { _right = rht; }
00071 
00072   // equality
00073   inline 
00074   bool operator == ( Pair& rhs ) const 
00075     { return left() == rhs.left() &&
00076              right() == rhs.right(); }
00077 
00078  protected:  // structure
00079   C _left;
00080   D _right;
00081 };  // class Pair
00082 
00083 
00084 // ******************* Class Pair, definitions ****************************
00085 
00086 
00087 #endif
00088 
00089 

Generated on Sat Jun 28 15:08:58 2003 for Vampire by doxygen 1.3.2