| 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_CTRIBLE_H |
| 22 |
#define KONCLUDE_UTILITIES_CTRIBLE_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 CTrible |
| 46 |
* \author Andreas Steigmiller |
| 47 |
* \version 0.1 |
| 48 |
* \brief TODO |
| 49 |
* |
| 50 |
*/ |
| 51 |
template<class T> |
| 52 |
class CTrible : public QPair<QPair<T,T>,T> { |
| 53 |
|
| 54 |
// public Functions |
| 55 |
public: |
| 56 |
//! Constructor |
| 57 |
CTrible(const T &first, const T &second, const T &third); |
| 58 |
|
| 59 |
T getFirst(); |
| 60 |
T getSecond(); |
| 61 |
T getThird(); |
| 62 |
|
| 63 |
CTrible<T> *setFirst(const T &first); |
| 64 |
CTrible<T> *setSecond(const T &second); |
| 65 |
CTrible<T> *setThird(const T &third); |
| 66 |
|
| 67 |
CTrible<T> *set(const T &first, const T &second, const T &third); |
| 68 |
|
| 69 |
// private Functions |
| 70 |
private: |
| 71 |
|
| 72 |
// private Variables |
| 73 |
private: |
| 74 |
|
| 75 |
}; |
| 76 |
|
| 77 |
|
| 78 |
template<class T> |
| 79 |
CTrible<T>::CTrible(const T &first, const T &second, const T &third) { |
| 80 |
this->first.first = first; |
| 81 |
this->first.second = second; |
| 82 |
this->second = third; |
| 83 |
} |
| 84 |
|
| 85 |
template<class T> |
| 86 |
CTrible<T> *CTrible<T>::setFirst(const T &first) { |
| 87 |
this->first.first = first; |
| 88 |
} |
| 89 |
|
| 90 |
template<class T> |
| 91 |
CTrible<T> *CTrible<T>::setSecond(const T &second) { |
| 92 |
this->first.second = second; |
| 93 |
} |
| 94 |
|
| 95 |
template<class T> |
| 96 |
CTrible<T> *CTrible<T>::setThird(const T &third) { |
| 97 |
this->second = third; |
| 98 |
} |
| 99 |
|
| 100 |
template<class T> |
| 101 |
CTrible<T> *CTrible<T>::set(const T &first, const T &second, const T &third) { |
| 102 |
this->first.first = first; |
| 103 |
this->first.second = second; |
| 104 |
this->second = third; |
| 105 |
return this; |
| 106 |
} |
| 107 |
|
| 108 |
|
| 109 |
template<class T> |
| 110 |
T CTrible<T>::getFirst() { |
| 111 |
return this->first.first; |
| 112 |
} |
| 113 |
|
| 114 |
template<class T> |
| 115 |
T CTrible<T>::getSecond() { |
| 116 |
return this->first.second; |
| 117 |
} |
| 118 |
|
| 119 |
template<class T> |
| 120 |
T CTrible<T>::getThird() { |
| 121 |
return this->second; |
| 122 |
} |
| 123 |
|
| 124 |
|
| 125 |
}; // end namespace Utilities |
| 126 |
|
| 127 |
}; // end namespace Konclude |
| 128 |
|
| 129 |
#endif // KONCLUDE_UTILITIES_CTRIBLE_H |