4064 |
05 Aug 21 |
peter |
1 |
#ifndef theplu_yat_utility_detail_node_value |
4064 |
05 Aug 21 |
peter |
2 |
#define theplu_yat_utility_detail_node_value |
4064 |
05 Aug 21 |
peter |
3 |
|
4064 |
05 Aug 21 |
peter |
// $Id$ |
4064 |
05 Aug 21 |
peter |
5 |
|
4064 |
05 Aug 21 |
peter |
6 |
/* |
4064 |
05 Aug 21 |
peter |
Copyright (C) 2021 Peter Johansson |
4064 |
05 Aug 21 |
peter |
8 |
|
4064 |
05 Aug 21 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
4064 |
05 Aug 21 |
peter |
10 |
|
4064 |
05 Aug 21 |
peter |
The yat library is free software; you can redistribute it and/or |
4064 |
05 Aug 21 |
peter |
modify it under the terms of the GNU General Public License as |
4064 |
05 Aug 21 |
peter |
published by the Free Software Foundation; either version 3 of the |
4064 |
05 Aug 21 |
peter |
License, or (at your option) any later version. |
4064 |
05 Aug 21 |
peter |
15 |
|
4064 |
05 Aug 21 |
peter |
The yat library is distributed in the hope that it will be useful, |
4064 |
05 Aug 21 |
peter |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4064 |
05 Aug 21 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4064 |
05 Aug 21 |
peter |
General Public License for more details. |
4064 |
05 Aug 21 |
peter |
20 |
|
4064 |
05 Aug 21 |
peter |
You should have received a copy of the GNU General Public License |
4064 |
05 Aug 21 |
peter |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
4064 |
05 Aug 21 |
peter |
23 |
*/ |
4064 |
05 Aug 21 |
peter |
24 |
|
4065 |
05 Aug 21 |
peter |
// This is a private file used by yat/utility/Ranking.h |
4065 |
05 Aug 21 |
peter |
26 |
|
4064 |
05 Aug 21 |
peter |
27 |
#include "NodeBase.h" |
4064 |
05 Aug 21 |
peter |
28 |
|
4064 |
05 Aug 21 |
peter |
29 |
#include <memory> |
4064 |
05 Aug 21 |
peter |
30 |
|
4064 |
05 Aug 21 |
peter |
31 |
namespace theplu { |
4064 |
05 Aug 21 |
peter |
32 |
namespace yat { |
4064 |
05 Aug 21 |
peter |
33 |
namespace utility { |
4064 |
05 Aug 21 |
peter |
34 |
|
4065 |
05 Aug 21 |
peter |
/// \cond IGNORE_DOXYGEN |
4065 |
05 Aug 21 |
peter |
36 |
|
4064 |
05 Aug 21 |
peter |
// namespace for internal classes used in class Ranking |
4064 |
05 Aug 21 |
peter |
38 |
namespace ranking { |
4064 |
05 Aug 21 |
peter |
39 |
|
4064 |
05 Aug 21 |
peter |
40 |
template<typename T> |
4064 |
05 Aug 21 |
peter |
41 |
class NodeValue : public NodeBase |
4064 |
05 Aug 21 |
peter |
42 |
{ |
4064 |
05 Aug 21 |
peter |
43 |
public: |
4064 |
05 Aug 21 |
peter |
44 |
NodeValue(const T& value) |
4064 |
05 Aug 21 |
peter |
45 |
: value_(value) |
4064 |
05 Aug 21 |
peter |
46 |
{} |
4064 |
05 Aug 21 |
peter |
47 |
|
4064 |
05 Aug 21 |
peter |
48 |
NodeValue(T&& value) |
4064 |
05 Aug 21 |
peter |
49 |
: value_(std::move(value)) |
4064 |
05 Aug 21 |
peter |
50 |
{} |
4064 |
05 Aug 21 |
peter |
51 |
|
4064 |
05 Aug 21 |
peter |
52 |
const T& value(void) const { return value_; } |
4064 |
05 Aug 21 |
peter |
53 |
private: |
4064 |
05 Aug 21 |
peter |
54 |
T value_; |
4064 |
05 Aug 21 |
peter |
55 |
}; |
4064 |
05 Aug 21 |
peter |
56 |
|
4064 |
05 Aug 21 |
peter |
57 |
} // end of namespace ranking |
4064 |
05 Aug 21 |
peter |
58 |
|
4065 |
05 Aug 21 |
peter |
/// \endcond |
4065 |
05 Aug 21 |
peter |
60 |
|
4064 |
05 Aug 21 |
peter |
61 |
}}} // of namespace utility, yat, and theplu |
4064 |
05 Aug 21 |
peter |
62 |
#endif |