|
Ginkgo
Generated from pipelines/1554403166 branch based on develop. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
|
5 #ifndef GKO_PUBLIC_CORE_CONFIG_PROPERTY_TREE_HPP_
6 #define GKO_PUBLIC_CORE_CONFIG_PROPERTY_TREE_HPP_
14 #include <type_traits>
30 using key_type = std::string;
31 using map_type = std::map<key_type, pnode>;
32 using array_type = std::vector<pnode>;
49 explicit pnode(
bool boolean);
59 std::enable_if_t<std::is_integral<T>::value>* =
nullptr>
60 explicit pnode(T integer);
67 explicit pnode(
const std::string& str);
74 explicit pnode(
const char* str);
81 explicit pnode(
double real);
95 explicit pnode(
const map_type& map);
100 explicit operator bool() const noexcept;
123 const map_type&
get_map() const;
169 const
pnode&
get(const std::
string& key) const;
182 void throw_if_not_contain(
tag_t tag) const;
184 static const
pnode& empty_node();
192 std::int64_t integer_;
199 template <typename T, std::enable_if_t<std::is_integral<T>::value>*>
202 if (integer > std::numeric_limits<std::int64_t>::max() ||
203 (std::is_signed<T>::value &&
204 integer < std::numeric_limits<std::int64_t>::min())) {
205 throw std::runtime_error(
"The input is out of the range of int64_t.");
207 union_data_.integer_ = static_cast<std::int64_t>(integer);
214 #endif // GKO_PUBLIC_CORE_CONFIG_PROPERTY_TREE_HPP_
std::int64_t get_integer() const
pnode describes a tree of properties.
Definition: property_tree.hpp:28
const array_type & get_array() const
Access the array stored in this property node.
const std::string & get_string() const
Access the string stored in this property node.
tag_t get_tag() const
Get the current node tag.
The Ginkgo namespace.
Definition: abstract_factory.hpp:20
An array is a container which encapsulates fixed-sized arrays, stored on the Executor tied to the arr...
Definition: array.hpp:26
bool get_boolean() const
Access the boolean value stored in this property node.
double get_real() const
Access the real floating point value stored in this property node.
const map_type & get_map() const
Access the map stored in this property node.
tag_t
tag_t is the indicator for the current node storage.
Definition: property_tree.hpp:37
const pnode & get(const std::string &key) const
This function is to access the data under the map.
pnode()
Default constructor: create an empty node.
constexpr auto real(const T &x)
Returns the real part of the object.
Definition: math.hpp:884