| 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 "CIndividualSaturationProcessNodeStatusFlags.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Kernel { |
| 29 |
|
| 30 |
namespace Process { |
| 31 |
|
| 32 |
|
| 33 |
CIndividualSaturationProcessNodeStatusFlags::CIndividualSaturationProcessNodeStatusFlags() { |
| 34 |
initStatusFlags(); |
| 35 |
} |
| 36 |
|
| 37 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::initStatusFlags() { |
| 38 |
mStatusFlags = 0; |
| 39 |
return this; |
| 40 |
} |
| 41 |
|
| 42 |
bool CIndividualSaturationProcessNodeStatusFlags::hasClashedFlag() { |
| 43 |
return hasFlags(INDSATFLAGCLASHED,false); |
| 44 |
} |
| 45 |
|
| 46 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setClashedFlag(bool value) { |
| 47 |
setFlags(INDSATFLAGCLASHED,value); |
| 48 |
return this; |
| 49 |
} |
| 50 |
|
| 51 |
bool CIndividualSaturationProcessNodeStatusFlags::hasInsufficientFlag() { |
| 52 |
return hasFlags(INDSATFLAGINSUFFICIENT,false); |
| 53 |
} |
| 54 |
|
| 55 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setInsufficientFlag(bool value) { |
| 56 |
setFlags(INDSATFLAGINSUFFICIENT,value); |
| 57 |
return this; |
| 58 |
} |
| 59 |
|
| 60 |
bool CIndividualSaturationProcessNodeStatusFlags::hasCriticalFlag() { |
| 61 |
return hasFlags(INDSATFLAGCRITICAL,false); |
| 62 |
} |
| 63 |
|
| 64 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setCriticalFlag(bool value) { |
| 65 |
setFlags(INDSATFLAGCRITICAL,value); |
| 66 |
return this; |
| 67 |
} |
| 68 |
|
| 69 |
bool CIndividualSaturationProcessNodeStatusFlags::hasNominalConnectionFlag() { |
| 70 |
return hasFlags(INDSATFLAGNOMINALCONNECTION,false); |
| 71 |
} |
| 72 |
|
| 73 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setNominalConnectionFlag(bool value) { |
| 74 |
setFlags(INDSATFLAGNOMINALCONNECTION,value); |
| 75 |
return this; |
| 76 |
} |
| 77 |
|
| 78 |
|
| 79 |
bool CIndividualSaturationProcessNodeStatusFlags::hasEQCandidateProplematicFlag() { |
| 80 |
return hasFlags(INDSATFLAGEQCANDPROPLEMATIC,false); |
| 81 |
} |
| 82 |
|
| 83 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setEQCandidateProplematicFlag(bool value) { |
| 84 |
setFlags(INDSATFLAGEQCANDPROPLEMATIC,value); |
| 85 |
return this; |
| 86 |
} |
| 87 |
|
| 88 |
bool CIndividualSaturationProcessNodeStatusFlags::hasCardinalityProplematicFlag() { |
| 89 |
return hasFlags(INDSATFLAGCARDINALITYPROPLEMATIC,false); |
| 90 |
} |
| 91 |
|
| 92 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setCardinalityProplematicFlag(bool value) { |
| 93 |
setFlags(INDSATFLAGCARDINALITYPROPLEMATIC,value); |
| 94 |
return this; |
| 95 |
} |
| 96 |
|
| 97 |
bool CIndividualSaturationProcessNodeStatusFlags::hasCardinalityRestrictedFlag() { |
| 98 |
return hasFlags(INDSATFLAGCARDINALITYRESTRICTED,false); |
| 99 |
} |
| 100 |
|
| 101 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setCardinalityRestrictedFlag(bool value) { |
| 102 |
setFlags(INDSATFLAGCARDINALITYRESTRICTED,value); |
| 103 |
return this; |
| 104 |
} |
| 105 |
|
| 106 |
|
| 107 |
bool CIndividualSaturationProcessNodeStatusFlags::hasInitializedFlag() { |
| 108 |
return hasFlags(INDSATFLAGINITIALIZED,false); |
| 109 |
} |
| 110 |
|
| 111 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setInitializedFlag(bool value) { |
| 112 |
setFlags(INDSATFLAGINITIALIZED,value); |
| 113 |
return this; |
| 114 |
} |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
bool CIndividualSaturationProcessNodeStatusFlags::hasCompletedFlag() { |
| 120 |
return hasFlags(INDSATFLAGCOMPLETED,false); |
| 121 |
} |
| 122 |
|
| 123 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setCompletedFlag(bool value) { |
| 124 |
setFlags(INDSATFLAGCOMPLETED,value); |
| 125 |
return this; |
| 126 |
} |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
bool CIndividualSaturationProcessNodeStatusFlags::hasMissedABoxConsistencyFlag() { |
| 131 |
return hasFlags(INDMISSEDABOXCONSISTENCYDATA,false); |
| 132 |
} |
| 133 |
|
| 134 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setMissedABoxConsistencyFlag(bool value) { |
| 135 |
setFlags(INDMISSEDABOXCONSISTENCYDATA,value); |
| 136 |
return this; |
| 137 |
} |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
bool CIndividualSaturationProcessNodeStatusFlags::hasSuccessorNodeExtensionsFlag() { |
| 142 |
return hasFlags(INDSUCCESSORNODEEXTENSIONS,false); |
| 143 |
} |
| 144 |
|
| 145 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setSuccessorNodeExtensionsFlag(bool value) { |
| 146 |
setFlags(INDSUCCESSORNODEEXTENSIONS,value); |
| 147 |
return this; |
| 148 |
} |
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
bool CIndividualSaturationProcessNodeStatusFlags::hasPropagationIncompleteFlag() { |
| 153 |
return hasFlags(INDSATFLAGPROPAGATIONINCOMPLETE,false); |
| 154 |
} |
| 155 |
|
| 156 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setPropagationIncompleteFlag(bool value) { |
| 157 |
setFlags(INDSATFLAGPROPAGATIONINCOMPLETE,value); |
| 158 |
return this; |
| 159 |
} |
| 160 |
|
| 161 |
|
| 162 |
bool CIndividualSaturationProcessNodeStatusFlags::hasUnregisteredPropagationFlag() { |
| 163 |
return hasFlags(INDSATFLAGUNREGISTEREDPROPAGATION, false); |
| 164 |
} |
| 165 |
|
| 166 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setUnregisteredPropagationFlag(bool value) { |
| 167 |
setFlags(INDSATFLAGUNREGISTEREDPROPAGATION, value); |
| 168 |
return this; |
| 169 |
} |
| 170 |
|
| 171 |
|
| 172 |
bool CIndividualSaturationProcessNodeStatusFlags::hasUnprocessedFlag() { |
| 173 |
return hasFlags(INDSATFLAGUNPROCESSED, false); |
| 174 |
} |
| 175 |
|
| 176 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setUnprocessedFlag(bool value) { |
| 177 |
setFlags(INDSATFLAGUNPROCESSED, value); |
| 178 |
return this; |
| 179 |
} |
| 180 |
|
| 181 |
|
| 182 |
bool CIndividualSaturationProcessNodeStatusFlags::hasUnmarkedRoleAssertionFlag() { |
| 183 |
return hasFlags(INDSATFLAGUNMARKEDROLEASSERTION, false); |
| 184 |
} |
| 185 |
|
| 186 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setUnmarkedRoleAssertionFlag(bool value) { |
| 187 |
setFlags(INDSATFLAGUNMARKEDROLEASSERTION, value); |
| 188 |
return this; |
| 189 |
} |
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
bool CIndividualSaturationProcessNodeStatusFlags::hasFlags(cint64 flags, bool checkAllFlags) { |
| 194 |
if (flags == 0) { |
| 195 |
return true; |
| 196 |
} |
| 197 |
if (checkAllFlags) { |
| 198 |
return (~mStatusFlags & flags) == 0; |
| 199 |
} else { |
| 200 |
return (mStatusFlags & flags) != 0; |
| 201 |
} |
| 202 |
} |
| 203 |
|
| 204 |
|
| 205 |
bool CIndividualSaturationProcessNodeStatusFlags::hasFlags(CIndividualSaturationProcessNodeStatusFlags* flags, bool checkAllFlags) { |
| 206 |
return hasFlags(flags->getFlags(),checkAllFlags); |
| 207 |
} |
| 208 |
|
| 209 |
|
| 210 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setFlags(cint64 flags, bool value) { |
| 211 |
if (value) { |
| 212 |
mStatusFlags |= flags; |
| 213 |
} else { |
| 214 |
mStatusFlags = (mStatusFlags & ~flags); |
| 215 |
} |
| 216 |
return this; |
| 217 |
} |
| 218 |
|
| 219 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::addFlags(CIndividualSaturationProcessNodeStatusFlags* flags) { |
| 220 |
addFlags(flags->getFlags()); |
| 221 |
return this; |
| 222 |
} |
| 223 |
|
| 224 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::addFlags(cint64 flags) { |
| 225 |
mStatusFlags |= flags; |
| 226 |
return this; |
| 227 |
} |
| 228 |
|
| 229 |
CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::clearFlags(cint64 flags) { |
| 230 |
mStatusFlags = (mStatusFlags & ~flags); |
| 231 |
return this; |
| 232 |
} |
| 233 |
|
| 234 |
|
| 235 |
cint64 CIndividualSaturationProcessNodeStatusFlags::getFlags() { |
| 236 |
return mStatusFlags; |
| 237 |
} |
| 238 |
|
| 239 |
|
| 240 |
}; // end namespace Process |
| 241 |
|
| 242 |
}; // end namespace Kernel |
| 243 |
|
| 244 |
}; // end namespace Reasoner |
| 245 |
|
| 246 |
}; // end namespace Konclude |