Debian Codegraph @

Source/Reasoner/Realization/CRealizationIndividualInstanceItemReference.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_REALIZATION_CREALIZATIONINDIVIDUALINSTANCEITEMREFERENCE_H
22 #define KONCLUDE_REASONER_REALIZATION_CREALIZATIONINDIVIDUALINSTANCEITEMREFERENCE_H
23
24 // Libraries includes
25
26 // Namespace includes
27 #include "RealizationSettings.h"
28
29 // Other includes
30 #include "Reasoner/Realization/CSameInstanceItem.h"
31
32 #include "Reasoner/Ontology/CIndividualReference.h"
33
34 // Logger includes
35 #include "Logger/CLogger.h"
36
37
38
39 namespace Konclude {
40
41 namespace Reasoner {
42
43 using namespace Ontology;
44
45 namespace Realization {
46
47 /*!
48 *
49 * \class CRealizationIndividualInstanceItemReference
50 * \author Andreas Steigmiller
51 * \version 0.1
52 * \brief TODO
53 *
54 */
55 class CRealizationIndividualInstanceItemReference : public CIndividualReference {
56 // public methods
57 public:
58 //! Constructor
59 CRealizationIndividualInstanceItemReference();
60 CRealizationIndividualInstanceItemReference(cint64 indiID, CSameInstanceItem* realizationInstanceItem);
61 CRealizationIndividualInstanceItemReference(const CIndividualIdentifier& identifier, CSameInstanceItem* realizationInstanceItem);
62 CRealizationIndividualInstanceItemReference(CIndividual* individual, CSameInstanceItem* realizationInstanceItem);
63 CRealizationIndividualInstanceItemReference(CIndividual* individual, cint64 indiId, CSameInstanceItem* realizationInstanceItem);
64 CRealizationIndividualInstanceItemReference(const CIndividualReference& indiRef, CSameInstanceItem* realizationInstanceItem);
65
66
67
68
69 CSameInstanceItem* getRealizationInstanceItem() const;
70
71
72 bool operator==(const CRealizationIndividualInstanceItemReference& indiRef) const {
73 return getIndividualID() == indiRef.getIndividualID();
74 }
75
76 // protected methods
77 protected:
78
79 // protected variables
80 protected:
81 CSameInstanceItem* mRealizationInstanceItem;
82
83 // private methods
84 private:
85
86 // private variables
87 private:
88
89 };
90
91
92 inline uint qHash(const CRealizationIndividualInstanceItemReference& indiRef) {
93 qint64 key = (qint64)indiRef.getIndividualID();
94 if (sizeof(quint64) > sizeof(uint)) {
95 return uint((key >> (8 * sizeof(uint) - 1)) ^ key);
96 } else {
97 return uint(key);
98 }
99 }
100
101
102 }; // end namespace Realization
103
104 }; // end namespace Reasoner
105
106 }; // end namespace Konclude
107
108 #endif // KONCLUDE_REASONER_REALIZATION_CREALIZATIONINDIVIDUALINSTANCEITEMREFERENCE_H