| 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 "COntologyRevision.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Revision { |
| 29 |
|
| 30 |
|
| 31 |
COntologyRevision::COntologyRevision(CConcreteOntology *ontology, COntologyRevision *previousOntologyRevision, COntologyConfigurationExtension *ontRevConfig) { |
| 32 |
revisionDepth = 0; |
| 33 |
rootRev = 0; |
| 34 |
revisionPath = 0; |
| 35 |
prevRev = previousOntologyRevision; |
| 36 |
onto = ontology; |
| 37 |
config = ontRevConfig; |
| 38 |
if (prevRev) { |
| 39 |
revisionDepth = prevRev->getOntologyRevisionDepth() + 1; |
| 40 |
rootRev = prevRev->getRootOntologyRevision(); |
| 41 |
revisionPath = prevRev->getOntologyRevisionPath(); |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
COntologyRevision::~COntologyRevision() { |
| 47 |
delete config; |
| 48 |
delete onto; |
| 49 |
} |
| 50 |
|
| 51 |
COntologyRevision *COntologyRevision::getPreviousOntologyRevision() { |
| 52 |
return prevRev; |
| 53 |
} |
| 54 |
|
| 55 |
COntologyRevision *COntologyRevision::getRootOntologyRevision() { |
| 56 |
return rootRev; |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
CConcreteOntology *COntologyRevision::getOntology() { |
| 62 |
return onto; |
| 63 |
} |
| 64 |
|
| 65 |
COntologyRevision *COntologyRevision::setOntology(CConcreteOntology *ontology) { |
| 66 |
onto = ontology; |
| 67 |
return this; |
| 68 |
} |
| 69 |
|
| 70 |
qint64 COntologyRevision::getOntologyRevisionDepth() { |
| 71 |
return revisionDepth; |
| 72 |
} |
| 73 |
|
| 74 |
COntologyRevision *COntologyRevision::setOntologyRevisionDepth(qint64 depth) { |
| 75 |
revisionDepth = depth; |
| 76 |
return this; |
| 77 |
} |
| 78 |
|
| 79 |
qint64 COntologyRevision::getOntologyRevisionPath() { |
| 80 |
return revisionPath; |
| 81 |
} |
| 82 |
|
| 83 |
COntologyRevision *COntologyRevision::setOntologyRevisionPath(qint64 ontologyRevisionPath) { |
| 84 |
revisionPath = ontologyRevisionPath; |
| 85 |
return this; |
| 86 |
} |
| 87 |
|
| 88 |
COntologyConfigurationExtension *COntologyRevision::getOntologyConfiguration() { |
| 89 |
return config; |
| 90 |
} |
| 91 |
|
| 92 |
COntologyRevision *COntologyRevision::setOntologyConfiguration(COntologyConfigurationExtension *ontRevConfig) { |
| 93 |
config = ontRevConfig; |
| 94 |
return this; |
| 95 |
} |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
}; // end namespace Revision |
| 100 |
|
| 101 |
}; // end namespace Reasoner |
| 102 |
|
| 103 |
}; // end namespace Konclude |