29 #ifndef CPP_INTROSPECTION_FIELD_H 30 #define CPP_INTROSPECTION_FIELD_H 44 virtual const char*
getName()
const = 0;
47 virtual std::size_t
getIndex()
const = 0;
48 virtual const std::type_info&
getTypeId()
const = 0;
51 virtual bool isArray()
const = 0;
59 virtual boost::any
get(std::size_t i = 0)
const {
return boost::any(); }
60 template <
typename T> T
as(std::size_t i = 0)
const {
return getType()->as<T>(
get(i)); }
62 virtual void setAny(
const boost::any& value, std::size_t i = 0)
const { }
63 template <
typename T>
void set(
const T& value, std::size_t i = 0)
const {
setAny(
getType()->from(value), i); }
65 virtual std::size_t
size()
const {
return 1; }
66 virtual void resize(
size_t new_size)
const {}
67 virtual bool empty()
const {
return false; }
68 virtual std::size_t
capacity()
const {
return 1; }
76 #endif // CPP_INTROSPECTION_FIELD_H virtual const std::type_info & getTypeId() const =0
virtual TypePtr getType() const
virtual bool isSimple() const =0
virtual bool isFixedSize() const =0
virtual bool isContainer() const =0
virtual bool isMessage() const =0
virtual std::size_t capacity() const
virtual void resize(size_t new_size) const
virtual MessagePtr expand(std::size_t i=0) const
TypePtr type(const std::string &name)
virtual const char * getValueType() const =0
virtual bool isVector() const =0
virtual bool hasInstance() const
virtual bool empty() const
virtual void setAny(const boost::any &value, std::size_t i=0) const
virtual bool isArray() const =0
virtual const char * getDataType() const =0
virtual FieldPtr access(AccessorBase &accessor) const =0
virtual const Message & message() const =0
T as(std::size_t i=0) const
virtual std::size_t size() const
virtual std::size_t getIndex() const =0
virtual const char * getName() const =0