Class Visitable

Class Documentation

class Visitable

interface for values that are visitable using the visit functions below

Public Functions

inline virtual ~Visitable()
inline virtual bool visit(const std::string &desc, const std::function<void(VisitablePtr)>&)

visit the sub-elements described by desc returns true if desc is valid forthis type of value

virtual std::any as_any() = 0

get the held value as a std::any

template<typename T>
inline auto as_t()

get the hald value

inline virtual std::string get_description()

get a description for this element

  • for elements with an ID, returns the ID

  • for single elements (e.g. name), return the name of the element (possibly shortened for elements whose name contains the parent element name)

  • for repeated elements, returns the type and something which identifies them (e.g. the value itself or a name)