Debian Codegraph @

Source/Reasoner/Classifier/CClassificationClassPseudoModelData.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 "CClassificationClassPseudoModelData.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Classifier {
29
30
31 CClassificationClassPseudoModelData::CClassificationClassPseudoModelData(CContext* context) : mContext(context) {
32 mLocConceptMap = nullptr;
33 mUseConceptMap = nullptr;
34 mLocRoleMap = nullptr;
35 mUseRoleMap = nullptr;
36 mValidConceptMap = false;
37 mValidRoleMap = false;
38 }
39
40
41 CClassificationClassPseudoModelData* CClassificationClassPseudoModelData::initPseudoModelData(CClassificationClassPseudoModelData* data) {
42 if (data) {
43 mUseConceptMap = data->mUseConceptMap;
44 mUseRoleMap = data->mUseRoleMap;
45 mValidConceptMap = data->mValidConceptMap;
46 mValidRoleMap = data->mValidRoleMap;
47 }
48 return this;
49 }
50
51
52 CClassificationClassPseudoModelConceptMap* CClassificationClassPseudoModelData::getPseudoModelConceptMap(bool create) {
53 if (!mLocConceptMap && create) {
54 mLocConceptMap = CObjectParameterizingAllocator< CClassificationClassPseudoModelConceptMap,CContext* >::allocateAndConstructAndParameterize(mContext->getMemoryAllocationManager(),mContext);
55 mLocConceptMap->initPseudoModelConceptMap(mUseConceptMap);
56 mUseConceptMap = mLocConceptMap;
57 }
58 return mUseConceptMap;
59 }
60
61
62 CClassificationClassPseudoModelRoleMap* CClassificationClassPseudoModelData::getPseudoModelRoleMap(bool create) {
63 if (!mLocRoleMap && create) {
64 mLocRoleMap = CObjectParameterizingAllocator< CClassificationClassPseudoModelRoleMap,CContext* >::allocateAndConstructAndParameterize(mContext->getMemoryAllocationManager(),mContext);
65 mLocRoleMap->initPseudoModelRoleMap(mUseRoleMap);
66 mUseRoleMap = mLocRoleMap;
67 }
68 return mUseRoleMap;
69 }
70
71 bool CClassificationClassPseudoModelData::hasValidRoleMap() {
72 return mValidRoleMap;
73 }
74
75 bool CClassificationClassPseudoModelData::hasValidConceptMap() {
76 return mValidConceptMap;
77 }
78
79 CClassificationClassPseudoModelData* CClassificationClassPseudoModelData::setValidRoleMap(bool valid) {
80 mValidRoleMap = valid;
81 return this;
82 }
83
84 CClassificationClassPseudoModelData* CClassificationClassPseudoModelData::setValidConceptMap(bool valid) {
85 mValidConceptMap = valid;
86 return this;
87 }
88
89 }; // end namespace Classifier
90
91 }; // end namespace Reasoner
92
93 }; // end namespace Konclude