15#ifndef OKS_ATTRIBUTE_H
16#define OKS_ATTRIBUTE_H
24#include <boost/regex.hpp>
145 const std::string&
type,
147 const std::string&
range,
148 const std::string& init_v,
149 const std::string& description,
177 void set_name(
const std::string& name);
185 const std::string&
get_type() const noexcept;
430 const std::string*
get_enum_value(
const char* s,
size_t length)
const;
461 const std::string*
get_enum_string(uint16_t idx)
const noexcept {
return &(*p_enumerators)[idx]; }
OksData::Type p_data_type
static const char * uid_type
static const char * s8_int_type
void set_range(const std::string &range)
Set attribute range.
static const char * u32_int_type
static const char * u8_int_type
static const char * time_type
static const char * s64_int_type
bool get_is_multi_values() const noexcept
static const char format_xml_attr[]
void set_type(const std::string &type, bool skip_init=false)
Set attribute type.
static const char description_xml_attr[]
static const char * bool_type
static const char name_xml_attr[]
void __set_data_type(const char *t, size_t len) noexcept
static const char ordered_xml_attr[]
const std::string & get_range() const noexcept
Get attribute range.
void set_is_multi_values(bool multi_values)
Set attribute is a single-value or multi-value.
void set_format(Format format)
Set attribute format.
int get_enum_index(const std::string &s) const noexcept
See get_enum_index(const char *, size_t);.
const std::string & get_name() const noexcept
out stream operator
static const char * class_type
static const char * string_type
void save(OksXmlOutputStream &) const
static const char * enum_type
static const char * s32_int_type
static const char mv_implement_xml_attr[]
static const char init_value_xml_attr[]
static bool find_token(const char *token, const char *range) noexcept
Finds token in given range.
static const char * format2str(Format) noexcept
OksAttribute(const std::string &name, OksClass *p=nullptr)
OKS attribute simple constructor.
static const char attribute_xml_tag[]
static const char * s16_int_type
OksData p_empty_init_data
OksData::Type get_data_type() const noexcept
static const char * u64_int_type
OksAttribute(OksData::Type t, const OksClass *c) noexcept
static const char * double_type
std::vector< std::string > * p_enumerators
const std::string * get_enum_string(uint16_t idx) const noexcept
Returns enumeration string by value.
const std::string & get_init_value() const noexcept
const std::string * get_enum_value(const std::string &s) const
See get_enum_value(const char *, size_t).
const std::string * get_enum_value(const char *s, size_t length) const
Returns pointer on internal enumerator data equal to given string, if such string is defined in attri...
void set_is_no_null(bool no_null)
Set attribute is-no-null property.
static const char is_multi_value_xml_attr[]
bool is_number() const noexcept
static const char * u16_int_type
std::list< std::string > get_init_values() const
Return list of initial values for mv-attribute.
int get_enum_index(const char *s, size_t length) const noexcept
Finds index of given string in attribute's range.
const std::string & get_description() const noexcept
static const char * date_type
static const char is_not_null_xml_attr[]
static const char * float_type
static Format str2format(const char *) noexcept
void set_description(const std::string &description)
Set attribute description.
void set_init_value(const std::string &init_value)
Set attribute initialisation value.
static const char type_xml_attr[]
static const char range_xml_attr[]
bool is_integer() const noexcept
bool get_is_no_null() const noexcept
static OksData::Type get_data_type(const std::string &type) noexcept
Converts string to attribute OKS data type.
void set_name(const std::string &name)
Set attribute name.
std::string p_description
Format get_format() const noexcept
Get attribute format.
OksRange(const std::string &range, OksAttribute *a)
std::list< std::pair< OksData, OksData > > m_interval
std::list< OksData > m_less
std::list< OksData > m_great
std::list< boost::regex > m_like
std::list< OksData > m_equal
void reset(const std::string &range, OksAttribute *a)
OksString()
to deallocate memory when destroyed
bool operator==(const OksString &s1, const OksString &s2)
Implementation of OksString logical equality operator.
std::ostream & operator<<(std::ostream &s, const oks::exception &ex)
DAC value out of range
Message.
std::string get_type(oks::OksData::Type oks_type, bool is_cpp)
union dunedaq::oks::OksData::Data data
void SetE(OksString *s, const OksAttribute *a)
void SetValue(const char *s, const OksAttribute *a)
enum dunedaq::oks::OksData::Type type
void set_init_value(const OksAttribute *attr, bool skip_init)
Set value defined by initial value of attribute.
void ReadFrom(const char *, Type, const OksAttribute *)
const std::string * ENUMERATION