KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Pair.h
Go to the documentation of this file.
1 #ifndef PAIR_H_
2 #define PAIR_H_
3 
11 namespace spear {
12 
16  template <class T1, class T2>
17  class Pair
18  {
19  public:
20 
21  Pair(const T1 & t1, const T2 & t2) : _first(t1), _second(t2) {};
22 
23  const T1 & getFirst() const { return _first; };
24 
25  const T2 & getSecond() const { return _second; };
26 
27  T2 & getSecond() { return _second; };
28 
29  void setFirst(const T1 & t1) { _first = t1; }
30 
31  void setSecond(const T2 & t2) { _second = t2; }
32 
33  private:
34 
35  T1 _first;
36 
37  T2 _second;
38  };
39 
40 } // end namespace spear
41 
42 #endif
Pair(const T1 &t1, const T2 &t2)
Definition: Pair.h:21
const T1 & getFirst() const
Definition: Pair.h:23
void setSecond(const T2 &t2)
Definition: Pair.h:31
const T2 & getSecond() const
Definition: Pair.h:25
T2 & getSecond()
Definition: Pair.h:27
void setFirst(const T1 &t1)
Definition: Pair.h:29
Definition: Pair.h:17