Debian Codegraph @

Source/Reasoner/Kernel/Process/CReapplyRoleSuccessorHash.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_REASONER_KERNEL_PROCESS_CREAPPLYROLESUCCESSORHASH_H
22 #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYROLESUCCESSORHASH_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "ProcessSettings.h"
29 #include "CIndividualLinkEdge.h"
30 #include "CRoleSuccessorLinkIterator.h"
31 #include "CReapplyQueue.h"
32 #include "CProcessContext.h"
33 #include "CReapplyRoleSuccessorData.h"
34 #include "CRoleSuccessorIterator.h"
35
36
37 // Other includes
38 #include "Reasoner/Ontology/CRole.h"
39
40 // Logger includes
41 #include "Logger/CLogger.h"
42
43
44 namespace Konclude {
45
46 using namespace Utilities;
47
48 namespace Reasoner {
49
50 using namespace Ontology;
51
52 namespace Kernel {
53
54 namespace Process {
55
56 /*!
57 *
58 * \class CReapplyRoleSuccessorHash
59 * \author Andreas Steigmiller
60 * \version 0.1
61 * \brief TODO
62 *
63 */
64 class CReapplyRoleSuccessorHash {
65 // public methods
66 public:
67 //! Constructor
68 CReapplyRoleSuccessorHash(CProcessContext* context = nullptr);
69
70 CReapplyRoleSuccessorHash* initRoleSuccessorHash(CReapplyRoleSuccessorHash* prevRoleSuccHash);
71
72 cint64 insertRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link, CReapplyQueueIterator* reapplyQueueIterator = nullptr);
73
74 void ensureRoleSuccessorDataLocalated(CReapplyRoleSuccessorData &roleSuccData);
75
76 CReapplyRoleSuccessorHash* removeRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link);
77 CReapplyRoleSuccessorHash* removeRoleSuccessorLink(CRole* role, cint64 sourceIndiID, cint64 destinationIndiID);
78
79 void eliminateRoleSuccessorPreviousShareData(CReapplyRoleSuccessorData &roleSuccData, cint64 coupId);
80
81 cint64 getRoleSuccessorCount(CRole* role);
82
83
84 CRoleSuccessorLinkIterator getRoleSuccessorLinkIterator(CRole* role);
85 CRoleSuccessorLinkIterator getRoleSuccessorLinkIterator(CRole* role, cint64* linkCount);
86 CRoleSuccessorLinkIterator getRoleSuccessorLinkIterator(CRole* role, cint64* linkCount, CIndividualLinkEdge*& lastLink);
87 CRoleSuccessorLinkIterator getRoleSuccessorHistoryLinkIterator(CRole* role, CIndividualLinkEdge* lastLink);
88 CRoleSuccessorLinkIterator getRoleSuccessorHistoryLinkIterator(CRole* role, CIndividualLinkEdge* lastLink, cint64* linkCount);
89 bool hasRoleSuccessor(CRole* role);
90
91 bool hasRoleSuccessorToIndividual(CRole* role, cint64 sourceIndiID, cint64 destinationIndiID, bool locateable);
92 CIndividualLinkEdge* getRoleSuccessorToIndividualLink(CRole* role, cint64 sourceIndiID, cint64 destinationIndiID, bool locateable);
93
94
95 CReapplyQueue* getRoleReapplyQueue(CRole* role, bool create = false);
96 bool containsRoleReapplyQueue(CRole* role);
97
98 CReapplyQueueIterator getRoleReapplyIterator(CRole* role, bool clearDynamicReapplyQueue = true);
99
100 CRoleSuccessorIterator getRoleIterator();
101
102 // protected methods
103 protected:
104 cint64 getCoupledIndividualID(CIndividualLinkEdge* link);
105 cint64 getCoupledIndividualID(cint64 indi1ID, cint64 indi2ID);
106
107 // protected variables
108 protected:
109
110 CProcessContext* mContext;
111 CPROCESSHASH<CRole*,CReapplyRoleSuccessorData> mRoleSuccessorDataHash;
112 cint64 mLinkCount;
113
114 // private methods
115 private:
116
117 // private variables
118 private:
119
120
121 };
122
123 }; // end namespace Process
124
125 }; // end namespace Kernel
126
127 }; // end namespace Reasoner
128
129 }; // end namespace Konclude
130
131 #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYROLESUCCESSORHASH_H