23 #include <blackboard/blackboard.h>
24 #include <golog++/model/value.h>
43 : field(field), index(index)
125 throw Exception(
"Invalid cast, string arrays are not supported");
179 throw Exception(
"Invalid cast, cannot convert a list with an offset or nested lists");
181 for (
size_t i = 0; i < v.size(); i++) {
183 boost::apply_visitor(visitor, v[i]->representation());
191 boost::apply_visitor(visitor, value.representation());
197 using namespace gologpp;
215 throw Exception(
"Unhandled interface field type");
Base class for exceptions in Fawkes.
virtual const char * what_no_backtrace() const
Get primary string (does not implicitly print the back trace).
Expected parameter is missing.
Interface field iterator.
const char * get_enum_string(unsigned int index=0) const
Get value of current enum field as string.
float get_float(unsigned int index=0) const
Get value of current field as float.
int16_t get_int16(unsigned int index=0) const
Get value of current field as integer.
void set_int64(int64_t i, unsigned int index=0)
Set value of current field as integer.
int8_t get_int8(unsigned int index=0) const
Get value of current field as integer.
int32_t get_int32(unsigned int index=0) const
Get value of current field as integer.
void set_string(const char *s)
Set value of current field as string.
int64_t get_int64(unsigned int index=0) const
Get value of current field as integer.
void set_double(double f, unsigned int index=0)
Set value of current field as double.
uint64_t get_uint64(unsigned int index=0) const
Get value of current field as unsigned integer.
uint16_t get_uint16(unsigned int index=0) const
Get value of current field as unsigned integer.
double get_double(unsigned int index=0) const
Get value of current field as double.
uint32_t get_uint32(unsigned int index=0) const
Get value of current field as unsigned integer.
void set_uint64(uint64_t i, unsigned int index=0)
Set value of current field as unsigned integer.
interface_fieldtype_t get_type() const
Get type of current field.
void set_float(float f, unsigned int index=0)
Set value of current field as float.
void set_enum_string(const char *e, unsigned int index=0)
Set value of current field as enum (from an integer).
void set_uint16(uint16_t i, unsigned int index=0)
Set value of current field as unsigned integer.
void set_int32(int32_t i, unsigned int index=0)
Set value of current field as integer.
const char * get_string() const
Get value of current field as string.
uint8_t get_byte(unsigned int index=0) const
Get value of current field as byte.
uint8_t get_uint8(unsigned int index=0) const
Get value of current field as unsigned integer.
bool get_bool(unsigned int index=0) const
Get value of current field as bool.
void set_bool(bool b, unsigned int index=0)
Set value of current field as bool.
void set_uint32(uint32_t i, unsigned int index=0)
Set value of current field as unsigned integer.
const char * get_typename() const
Get type of current field as string.
A visitor that converts a gologpp::Value to an interface field value.
void operator()(unsigned int v)
Convert the given value and set the field accordingly.
ValueToFieldVisitor(InterfaceFieldIterator *field, unsigned int index=0)
Constructor.
Fawkes library namespace.
@ IFT_INT8
8 bit integer field
@ IFT_UINT32
32 bit unsigned integer field
@ IFT_BYTE
byte field, alias for uint8
@ IFT_UINT64
64 bit unsigned integer field
@ IFT_UINT16
16 bit unsigned integer field
@ IFT_INT32
32 bit integer field
@ IFT_INT64
64 bit integer field
@ IFT_INT16
16 bit integer field
@ IFT_ENUM
field with interface specific enum type
@ IFT_UINT8
8 bit unsigned integer field