2#include "attributes.hpp"
8namespace horizon::ODB {
13 template <
typename Tr,
typename Ta>
void add_attribute(Tr &r, Ta v)
16 static_assert(Tc::value);
19 if constexpr (std::is_enum_v<Ta>)
20 r.attributes.emplace_back(
id, std::to_string(
static_cast<int>(v)));
22 r.attributes.emplace_back(
id, attr_to_string(v));
26 unsigned int get_or_create_attribute_name(
const std::string &name);
28 void write_attributes(std::ostream &ost,
const std::string &prefix =
"")
const;
32 unsigned int get_or_create_attribute_text(
const std::string &name);
34 static std::string double_to_string(
double v,
unsigned int n);
38 return double_to_string(a.value, a.ndigits);
48 return std::to_string(get_or_create_attribute_text(a.value));
52 std::map<std::string, unsigned int> attribute_names;
53 std::map<std::string, unsigned int> attribute_texts;
59 void write_attributes(std::ostream &ost)
const;
62 std::vector<std::pair<unsigned int, std::string>> attributes;
Definition: attribute_util.hpp:10
Definition: attribute_util.hpp:56
I P I S j decltype(detail::insert_impl(static_cast< Cont && >(cont), static_cast< P && >(p), static_cast< I && >(i), static_cast< S && >(j), meta::bool_< random_access_reservable< Cont > &&//sized_sentinel_for< S, I > >{})) template(typename Cont, typename I, typename Rng)(AND input_iterator< I > AND range< Rng >) auto insert(Cont &&cont
function template any_of
Definition: insert.hpp:188
Definition: attributes.hpp:10
Definition: attributes.hpp:21
Definition: attributes.hpp:15
Definition: attributes.hpp:26