Debian Codegraph @

Source/Utilities/CVariantTrible.hpp

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef KONCLUDE_UTILITIES_CVARIANTTRIBLEBASE_H
22 #define KONCLUDE_UTILITIES_CVARIANTTRIBLEBASE_H
23
24 // Libraries includes
25 #include <QPair>
26
27 // Namespace includes
28
29
30 // Other includes
31
32
33 // Logger includes
34 #include "Logger/CLogger.h"
35
36 using namespace Konclude::Logger;
37
38
39 namespace Konclude {
40
41 namespace Utilities {
42
43 /*!
44 *
45 * \class CVariantTribleBase
46 * \author Andreas Steigmiller
47 * \version 0.1
48 * \brief TODO
49 *
50 */
51 template<class BASE, class T1, class T2, class T3>
52 class CVariantTribleBase : public QPair<QPair<T1,T2>,T3> {
53
54 // public Functions
55 public:
56 //! Constructor
57 CVariantTribleBase(const T1& first, const T2& second, const T3& third);
58
59 const T1& getFirst() const;
60 const T2& getSecond() const;
61 const T3& getThird() const;
62
63 BASE* setFirst(const T1& first);
64 BASE* setSecond(const T2& second);
65 BASE* setThird(const T3& third);
66
67 BASE* set(const T1& first, const T2& second, const T3& third);
68
69 // private Functions
70 private:
71
72 // private Variables
73 private:
74
75 };
76
77
78 template<class BASE, class T1, class T2, class T3>
79 CVariantTribleBase<BASE,T1,T2,T3>::CVariantTribleBase(const T1 &first, const T2 &second, const T3 &third) {
80 this->first.first = first;
81 this->first.second = second;
82 this->second = third;
83 }
84
85 template<class BASE, class T1, class T2, class T3>
86 BASE* CVariantTribleBase<BASE,T1,T2,T3>::setFirst(const T1 &first) {
87 this->first.first = first;
88 return (BASE*)this;
89 }
90
91 template<class BASE, class T1, class T2, class T3>
92 BASE* CVariantTribleBase<BASE,T1,T2,T3>::setSecond(const T2 &second) {
93 this->first.second = second;
94 return (BASE*)this;
95 }
96
97 template<class BASE, class T1, class T2, class T3>
98 BASE* CVariantTribleBase<BASE,T1,T2,T3>::setThird(const T3 &third) {
99 this->second = third;
100 return (BASE*)this;
101 }
102
103 template<class BASE, class T1, class T2, class T3>
104 BASE* CVariantTribleBase<BASE,T1,T2,T3>::set(const T1 &first, const T2 &second, const T3 &third) {
105 this->first.first = first;
106 this->first.second = second;
107 this->second = third;
108 return (BASE*)this;
109 }
110
111
112 template<class BASE, class T1, class T2, class T3>
113 const T1& CVariantTribleBase<BASE,T1,T2,T3>::getFirst() const {
114 return this->first.first;
115 }
116
117 template<class BASE, class T1, class T2, class T3>
118 const T2& CVariantTribleBase<BASE,T1,T2,T3>::getSecond() const {
119 return this->first.second;
120 }
121
122 template<class BASE, class T1, class T2, class T3>
123 const T3& CVariantTribleBase<BASE,T1,T2,T3>::getThird() const {
124 return this->second;
125 }
126
127
128
129 template<class T1, class T2, class T3>
130 class CVariantTrible : public CVariantTribleBase<CVariantTrible<T1,T2,T3>,T1,T2,T3> {
131 public:
132 CVariantTrible(const T1 &first, const T2 &second, const T3 &third) : CVariantTribleBase<CVariantTrible<T1,T2,T3>,T1,T2,T3>(first,second,third) {
133 }
134 };
135
136
137 }; // end namespace Utilities
138
139 }; // end namespace Konclude
140
141 #endif // KONCLUDE_UTILITIES_CVARIANTTRIBLEBASE_H