00001
00015 #ifndef _DLR_COMMON_TRIPLE_H_
00016 #define _DLR_COMMON_TRIPLE_H_
00017
00018 namespace dlr {
00019
00020 namespace common {
00021
00029 template <class Type0, class Type1, class Type2>
00030 class Triple
00031 {
00032 public:
00033
00034
00036 typedef Type0 first_type;
00037
00039 typedef Type1 second_type;
00040
00042 typedef Type2 third_type;
00043
00044
00048 Triple() : first(Type0()), second(Type1()), third(Type2()) {}
00049
00060 Triple(const Type0& element0, const Type1& element1, const Type2& element2)
00061 : first(element0), second(element1), third(element2) {}
00062
00071 template <class OtherType0, class OtherType1, class OtherType2>
00072 Triple(const Triple<OtherType0, OtherType1, OtherType2>& other)
00073 : first(static_cast<Type0>(other.first)),
00074 second(static_cast<Type1>(other.second)),
00075 third(static_cast<Type2>(other.third)) {}
00076
00080 ~Triple() {}
00081
00082
00083
00087 Type0 first;
00088
00092 Type1 second;
00093
00097 Type2 third;
00098 };
00099
00100
00110 template <class Type0, class Type1, class Type2>
00111 inline Triple<Type0, Type1, Type2>
00112 makeTriple(const Type0& element0, const Type1& element1,
00113 const Type2& element2) {
00114 return Triple<Type0, Type1, Type2>(element0, element1, element2);
00115 }
00116
00117 }
00118
00119 }
00120
00121
00122
00123
00124 namespace dlr {
00125
00126 using common::Triple;
00127 using common::makeTriple;
00128
00129 }
00130
00131 #endif // #ifndef _DLR_COMMON_TRIPLE_H_