Debian Codegraph @

Source/Reasoner/Query/CVariableBindingsAnswerResultHasher.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_QUERY_CVARIABLEBINDINGSANSWERRESULTHASHER_H
22 #define KONCLUDE_REASONER_QUERY_CVARIABLEBINDINGSANSWERRESULTHASHER_H
23
24 // Libraries includes
25 #include "CVariableBindingsAnswerResult.h"
26
27 // Namespace includes
28
29 // Other includes
30
31 // Logger includes
32 #include "Logger/CLogger.h"
33
34
35 namespace Konclude {
36
37 namespace Reasoner {
38
39 namespace Query {
40
41 /*!
42 *
43 * \class CVariableBindingsAnswerResultHasher
44 * \author Andreas Steigmiller
45 * \version 0.1
46 * \brief TODO
47 *
48 */
49 class CVariableBindingsAnswerResultHasher {
50 // public methods
51 public:
52 //! Constructor
53 CVariableBindingsAnswerResultHasher(CVariableBindingsAnswerResult* bindingResult);
54
55 bool operator==(const CVariableBindingsAnswerResultHasher& hasher) const;
56
57 cint64 getHashValue() const;
58 CVariableBindingsAnswerResult* getBindingResult() const;
59
60 // protected methods
61 protected:
62
63 // protected variables
64 protected:
65 CVariableBindingsAnswerResult* mBindingResult;
66 cint64 mHashValue;
67
68 // private methods
69 private:
70
71 // private variables
72 private:
73
74 };
75
76
77 inline uint qHash(const CVariableBindingsAnswerResultHasher& hasher) {
78 qint64 key = (qint64)hasher.getHashValue();
79 if (sizeof(quint64) > sizeof(uint)) {
80 return uint((key >> (8 * sizeof(uint) - 1)) ^ key);
81 }
82 else {
83 return uint(key);
84 }
85 }
86
87 }; // end namespace Query
88
89 }; // end namespace Reasoner
90
91 }; // end namespace Konclude
92
93 #endif // KONCLUDE_REASONER_QUERY_CVARIABLEBINDINGSANSWERRESULTHASHER_H