Debian Codegraph @

Source/Utilities/Container/CLinker.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_UTILITIES_CONTAINER_CLINKER_H
22 #define KONCLUDE_UTILITIES_CONTAINER_CLINKER_H
23
24 // Namespace includes
25 #include "ContainerSettings.h"
26
27 // Library includes
28
29 // Other includes
30
31 // Logger includes
32
33
34 namespace Konclude {
35
36 namespace Utilities {
37
38 namespace Container {
39
40
41 /*!
42 *
43 * \class CLinkerBase
44 * \author Andreas Steigmiller
45 * \version 0.1
46 * \brief TODO
47 *
48 */
49 template<class T, class S>
50 class CLinkerBase {
51 // public methods
52 public:
53 //! Constructor
54 inline CLinkerBase();
55 inline CLinkerBase(const T& dataElement, CLinkerBase<T,S>* nextLink = nullptr);
56
57 //! Destructor
58 inline ~CLinkerBase();
59
60 inline S* initLinker(const T& dataElement, CLinkerBase<T,S>* nextLink = nullptr);
61
62 inline bool hasNext() const;
63
64
65 inline S* insertNext(CLinkerBase<T,S>* nextLink);
66 inline S* getNext() const;
67
68 inline S* clearNext();
69
70 inline S* setNext(CLinkerBase<T,S>* nextLink);
71
72 inline T& getData();
73 inline S* setData(const T& dataElement);
74
75
76 inline S* append(CLinkerBase<T,S>* appendingList);
77
78 inline S* getRemovedNext();
79
80 inline S* getLastListLink() const;
81
82 inline cint64 getCount() const;
83 inline cint64 size() const;
84
85 inline bool contains(const T& dataElement) const;
86
87 inline S* removeOne(const T& dataElement);
88 inline S* removeAll(const T& dataElement);
89
90
91 // protected methods
92 protected:
93
94 // protected variables
95 protected:
96 CLinkerBase<T,S>* next;
97 T data;
98
99 // private methods
100 private:
101
102 // private variables
103 private:
104 };
105
106
107 /*!
108 *
109 * \class CLinker
110 * \author Andreas Steigmiller
111 * \version 0.1
112 * \brief TODO
113 *
114 */
115 template<class T>
116 class CXLinker : public CLinkerBase<T,CXLinker<T> > {
117 // public methods
118 public:
119 // Constructor
120 inline CXLinker() : CLinkerBase<T,CXLinker<T> >() {};
121 inline CXLinker(const T& dataElement, CLinkerBase<T,CXLinker<T> >* nextLink = nullptr) : CLinkerBase<T,CXLinker<T> >(dataElement,nextLink) {};
122
123 //! Destructor
124 inline ~CXLinker() {};
125 };
126
127
128 }; // end namespace Container
129
130 }; // end namespace Utilities
131
132 }; // end namespace Konclude
133
134 #include "CLinker.cpp"
135
136 #endif // KONCLUDE_UTILITIES_CONTAINER_CLINKER_H