5#ifndef GKO_PUBLIC_CORE_CONFIG_PROPERTY_TREE_HPP_
6#define GKO_PUBLIC_CORE_CONFIG_PROPERTY_TREE_HPP_
30 using key_type = std::string;
31 using map_type = std::map<key_type, pnode>;
32 using array_type = std::vector<pnode>;
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);
95 explicit pnode(
const map_type& map);
100 explicit operator bool() const noexcept;
105 bool operator==(const
pnode& rhs) const;
110 bool operator!=(const
pnode& rhs) const;
192 void throw_if_not_contain(
tag_t tag) const;
194 static const
pnode& empty_node();
202 std::int64_t integer_;
209template <typename T, std::enable_if_t<std::is_integral<T>::value>*>
212 if (integer > std::numeric_limits<std::int64_t>::max() ||
213 (std::is_signed<T>::value &&
214 integer < std::numeric_limits<std::int64_t>::min())) {
215 throw std::runtime_error(
"The input is out of the range of int64_t.");
217 union_data_.integer_ =
static_cast<std::int64_t
>(integer);
Definition property_tree.hpp:28
tag_t
Definition property_tree.hpp:37
pnode(const array_type &array)
pnode(const map_type &map)
const map_type & get_map() const
const pnode & get(const std::string &key) const
const std::string & get_string() const
pnode(const std::string &str)
const array_type & get_array() const
std::int64_t get_integer() const
The Ginkgo namespace.
Definition abstract_factory.hpp:20
constexpr auto real(const T &x)
Definition math.hpp:869