Debian Codegraph @

Source/Utilities/Container/CNegator.h

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_CONTAINER_CNEGATOR_H
22 #define KONCLUDE_UTILITIES_CONTAINER_CNEGATOR_H
23
24 // Namespace includes
25 #include "ContainerSettings.h"
26
27 // Library includes
28
29
30 // Other includes
31
32
33 // Logger includes
34 #include "Logger/CLogger.h"
35
36
37 namespace Konclude {
38
39 namespace Utilities {
40
41 namespace Container {
42
43
44 /*!
45 *
46 * \class CNegator
47 * \author Andreas Steigmiller
48 * \version 0.1
49 * \brief TODO
50 *
51 */
52 class CNegator {
53 // public methods
54 public:
55 //! Constructor
56 inline CNegator() : mNegation(false) {}
57
58 inline CNegator(const CNegator& negator) {
59 mNegation = negator.mNegation;
60 }
61
62 inline CNegator(const bool& negated) {
63 mNegation = negated;
64 }
65
66 //! Destructor
67 inline ~CNegator() {}
68
69 inline bool isNegated() const {
70 return mNegation;
71 }
72
73 inline CNegator* initNeg(bool negation) {
74 mNegation = negation;
75 return this;
76 }
77
78 inline bool getNegation() const {
79 return isNegated();
80 }
81
82 inline CNegator* setNegation(bool negated) {
83 mNegation = negated;
84 return this;
85 }
86
87 inline bool toggleNegation(bool toggle = true) {
88 return mNegation = mNegation^toggle;
89 }
90
91 // protected methods
92 protected:
93
94 // protected variables
95 protected:
96 bool mNegation;
97
98 // private methods
99 private:
100
101 // private variables
102 private:
103 };
104
105
106 }; // end namespace Container
107
108 }; // end namespace Utilities
109
110 }; // end namespace Konclude
111
112
113 #endif // KONCLUDE_UTILITIES_CONTAINER_CNEGATOR_H