Pair.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2011, SRI International (R)
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 #ifndef __OpenKarto_Pair_h__
21 #define __OpenKarto_Pair_h__
22 
23 #include <OpenKarto/Types.h>
24 
25 namespace karto
26 {
27 
29 
30 
35  template<typename U, typename V>
36  class Pair
37  {
38  public:
42  Pair()
43  {
44  }
45 
51  Pair(const U& rFirst, const V& rSecond)
52  {
53  m_First = rFirst;
54  m_Second = rSecond;
55  }
56 
61  inline U& GetFirst()
62  {
63  return m_First;
64  }
65 
70  inline const U& GetFirst() const
71  {
72  return m_First;
73  }
74 
79  inline V& GetSecond()
80  {
81  return m_Second;
82  }
83 
88  inline const V& GetSecond() const
89  {
90  return m_Second;
91  }
92 
96  inline kt_bool operator==(const Pair& rPair)
97  {
98  return (m_First == rPair.m_First) && (m_Second == rPair.m_Second);
99  }
100 
101  private:
104  };
105 
107 
108 }
109 
110 #endif // __OpenKarto_Pair_h__
bool kt_bool
Definition: Types.h:145
kt_bool operator==(const Pair &rPair)
Definition: Pair.h:96
Pair(const U &rFirst, const V &rSecond)
Definition: Pair.h:51
const U & GetFirst() const
Definition: Pair.h:70
U m_First
Definition: Pair.h:102
U & GetFirst()
Definition: Pair.h:61
Pair()
Definition: Pair.h:42
V m_Second
Definition: Pair.h:103
const V & GetSecond() const
Definition: Pair.h:88
Definition: Any.cpp:20
V & GetSecond()
Definition: Pair.h:79


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Tue Nov 7 2017 06:02:36