Debian Codegraph @

Source/Parser/Expressions/CSubObjectPropertyOfExpression.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 "CSubObjectPropertyOfExpression.h"
22
23
24 namespace Konclude {
25
26 namespace Parser {
27
28 namespace Expression {
29
30
31 CSubObjectPropertyOfExpression::CSubObjectPropertyOfExpression(CObjectPropertyTermExpression *subObjectPropertyExpression1, CObjectPropertyTermExpression *superbObjectPropertyExpression2)
32 : CObjectPropertyTermExpressionAssociator(superbObjectPropertyExpression2), COrderedListObjectPropertyTermExpressionAssociator(subObjectPropertyExpression1) {
33 }
34
35 CSubObjectPropertyOfExpression::CSubObjectPropertyOfExpression(const CEXPRESSIONLIST<CObjectPropertyTermExpression*>& subObjectPropertyExpressionList, CObjectPropertyTermExpression *superbObjectPropertyExpression)
36 : CObjectPropertyTermExpressionAssociator(superbObjectPropertyExpression), COrderedListObjectPropertyTermExpressionAssociator(subObjectPropertyExpressionList) {
37 }
38
39 CSubObjectPropertyOfExpression::~CSubObjectPropertyOfExpression() {
40 }
41
42 CEXPRESSIONLIST<CObjectPropertyTermExpression*>* CSubObjectPropertyOfExpression::getSubObjectPropertyTermExpressionList() {
43 return getOrderedObjectPropertyTermExpressionList();
44 }
45
46 CObjectPropertyTermExpression* CSubObjectPropertyOfExpression::getSuperObjectPropertyTermExpression() {
47 return getObjectPropertyTermExpression();
48 }
49
50
51 CBuildExpression::ExpressionType CSubObjectPropertyOfExpression::getType() {
52 return BETSUBOBJECTPROPERTYOF;
53 }
54
55 cint64 CSubObjectPropertyOfExpression::getStructuralHashValue() {
56 cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),COrderedListObjectPropertyTermExpressionAssociator::getStructuralHashValue());
57 return hashValue;
58 }
59
60 bool CSubObjectPropertyOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) {
61 CSubObjectPropertyOfExpression* compExpCast = dynamic_cast<CSubObjectPropertyOfExpression*>(compareExpression);
62 if (!compExpCast) {
63 return false;
64 }
65 return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && COrderedListObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast);
66 }
67
68
69 bool CSubObjectPropertyOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) {
70 if (subExpressionVisitor) {
71 CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor);
72 COrderedListObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor);
73 return true;
74 }
75 return false;
76 }
77
78 }; // end namespace Expression
79
80 }; // end namespace Parser
81
82 }; // end namespace Konclude