Debian Codegraph @

Source/Test/Evaluation/CReasonerEvaluationDataValue.cpp

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 #include "CReasonerEvaluationDataValue.h"
22
23
24 namespace Konclude {
25
26 namespace Test {
27
28 namespace Evaluation {
29
30
31
32 CReasonerEvaluationDataValue::CReasonerEvaluationDataValue() : CLinkerBase<CReasonerEvaluationDataValue*,CReasonerEvaluationDataValue>(this) {
33 mDataFlags = 0;
34 }
35
36
37 CReasonerEvaluationDataValue::~CReasonerEvaluationDataValue() {
38 }
39
40 bool CReasonerEvaluationDataValue::hasDataFlags(cint64 flags, bool testPartial) {
41 if (testPartial) {
42 return (mDataFlags & flags) != 0;
43 } else {
44 return (mDataFlags & flags) == flags;
45 }
46 }
47
48 CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::setDataFlags(cint64 flags) {
49 mDataFlags |= flags;
50 return this;
51 }
52
53 CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::clearDataFlags(cint64 flags) {
54 mDataFlags = mDataFlags & ~flags;
55 return this;
56 }
57
58 CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::setDataFlags(cint64 flags, bool value) {
59 if (value) {
60 return setDataFlags(flags);
61 } else {
62 return clearDataFlags(flags);
63 }
64 }
65
66
67 bool CReasonerEvaluationDataValue::hasErrorOccuredFlag() {
68 return hasDataFlags(REDFDATAERROROCCURED,true);
69 }
70
71 CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::setErrorOccuredFlag(bool value) {
72 return setDataFlags(REDFDATAERROROCCURED,value);
73 }
74
75 bool CReasonerEvaluationDataValue::hasDataNotAvailableFlag() {
76 return hasDataFlags(REDFDATANOTAVAILABLE,true);
77 }
78
79 CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::setDataNotAvailableFlag(bool value) {
80 return setDataFlags(REDFDATANOTAVAILABLE,value);
81 }
82
83
84 cint64 CReasonerEvaluationDataValue::getDataFlags() {
85 return mDataFlags;
86 }
87
88
89 }; // end namespace Evaluation
90
91 }; // end namespace Test
92
93 }; // end namespace Konclude