Debian Codegraph @

Source/Reasoner/Triples/CRedlandStoredTriplesIndividualResolvingHashMemoryManaged.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 #ifdef KONCLUDE_REDLAND_INTEGRATION
21
22 #include "CRedlandStoredTriplesIndividualResolvingHashMemoryManaged.h"
23
24
25 namespace Konclude {
26
27 namespace Reasoner {
28
29 namespace Triples {
30
31
32 CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::CRedlandStoredTriplesIndividualResolvingHashMemoryManaged(CConcreteOntology* ontology, CConfiguration* configuration, const QString& anonymousOntologyIdentifier)
33 : CMemoryPoolNewAllocationIncreasingContext(500, 500000, 2), CQtManagedRestrictedModificationHash<CRedlandNodeHasher, CIndividual*>(this), mIndiDataMemAllocManager(ontology, configuration), mAnonymousOntologyIdentifier(anonymousOntologyIdentifier) {
34 }
35
36
37 CIndividual*& CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::getIndividual(const CRedlandNodeHasher& indiNodeHasher) {
38 CIndividual*& indi = CQtManagedRestrictedModificationHash<CRedlandNodeHasher, CIndividual*>::operator[](indiNodeHasher);
39 return indi;
40 }
41
42 CRedlandStoredTriplesIndividualResolvingHashMemoryManaged* CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::insertIndividual(const CRedlandNodeHasher& indiNode, CIndividual* indi) {
43 CQtManagedRestrictedModificationHash<CRedlandNodeHasher, CIndividual*>::insert(indiNode, indi);
44 return this;
45 }
46
47
48 CIndividual*& CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::getIndividual(librdf_node* indiNode) {
49 return getIndividual(CRedlandNodeHasher(indiNode));
50 }
51
52 CConceptAssertionLinker* CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::createAssertionConceptLinker() {
53 ++mConceptAssertionCount;
54 return CObjectAllocator<CConceptAssertionLinker>::allocateAndConstruct(mIndiDataMemAllocManager.getMemoryAllocationManager());
55 }
56 CRoleAssertionLinker* CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::createAssertionRoleLinker() {
57 ++mObjectPropertyAssertionCount;
58 return CObjectAllocator<CRoleAssertionLinker>::allocateAndConstruct(mIndiDataMemAllocManager.getMemoryAllocationManager());
59 }
60
61 CDataAssertionLinker* CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::createAssertionDataLinker() {
62 ++mDataPropertyAssertionCount;
63 return CObjectAllocator<CDataAssertionLinker>::allocateAndConstruct(mIndiDataMemAllocManager.getMemoryAllocationManager());
64 }
65
66 CReverseRoleAssertionLinker* CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::createReverseAssertionRoleLinker() {
67 return CObjectAllocator<CReverseRoleAssertionLinker>::allocateAndConstruct(mIndiDataMemAllocManager.getMemoryAllocationManager());
68 }
69
70 CRedlandStoredTriplesIndividualPreProcessMemoryManagingContext* CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::getIndividualDataMemoryManager() {
71 return &mIndiDataMemAllocManager;
72 }
73
74 CDataLiteralNormalizerPreProcess* CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::getIndividualDataLiteralNormalizer() {
75 return &mIndiDataLiteralNormalizer;
76 }
77
78 CMemoryPool* CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::takeIndividualDataMemoryPools() {
79 return mIndiDataMemAllocManager.takeMemoryPools();
80 }
81
82 cint64 CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::getConceptAssertionCount() {
83 return mConceptAssertionCount;
84 }
85
86 cint64 CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::getObjectPropertyAssertionCount() {
87 return mObjectPropertyAssertionCount;
88 }
89
90 cint64 CRedlandStoredTriplesIndividualResolvingHashMemoryManaged::getDataPropertyAssertionCount() {
91 return mDataPropertyAssertionCount;
92 }
93
94
95
96 }; // end namespace Triples
97
98 }; // end namespace Reasoner
99
100 }; // end namespace Konclude
101
102 #endif // !KONCLUDE_REDLAND_INTEGRATION