Fawkes API
Fawkes Development Version
|
A visitor that converts a gologpp::Value to an interface field value. More...
Public Member Functions | |
ValueToFieldVisitor (InterfaceFieldIterator *field, unsigned int index=0) | |
Constructor. More... | |
void | operator() (unsigned int v) |
Convert the given value and set the field accordingly. More... | |
void | operator() (int v) |
Convert the given value and set the field accordingly. More... | |
void | operator() (unsigned long v) |
Convert the given value and set the field accordingly. More... | |
void | operator() (long v) |
Convert the given value and set the field accordingly. More... | |
void | operator() (double v) |
Convert the given value and set the field accordingly. More... | |
void | operator() (std::string v) |
Convert the given value and set the field accordingly. More... | |
void | operator() (bool v) |
Convert the given value and set the field accordingly. More... | |
void | operator() (gologpp::CompoundType::Representation v) |
Not implemented yet. More... | |
void | operator() (gologpp::ListType::Representation v) |
Convert the given list by calling a visitor recursively for each item of the list. More... | |
void | operator() (void *v) |
Golog++ does not support void* types. More... | |
A visitor that converts a gologpp::Value to an interface field value.
The visitor checks the types of the input gologpp::Value and the ouput InterfaceFieldIterator. If they match, the field is set. Otherwise, an exception is thrown.
fawkes::gpp::ValueToFieldVisitor::ValueToFieldVisitor | ( | InterfaceFieldIterator * | field, |
unsigned int | index = 0 |
||
) |
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | bool | v | ) |
Convert the given value and set the field accordingly.
v | The value to set the field to. |
Definition at line 142 of file utils.cpp.
References fawkes::InterfaceFieldIterator::get_type(), fawkes::InterfaceFieldIterator::get_typename(), fawkes::IFT_BOOL, and fawkes::InterfaceFieldIterator::set_bool().
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | double | v | ) |
Convert the given value and set the field accordingly.
v | The value to set the field to. |
Definition at line 107 of file utils.cpp.
References fawkes::InterfaceFieldIterator::get_type(), fawkes::InterfaceFieldIterator::get_typename(), fawkes::IFT_DOUBLE, fawkes::IFT_FLOAT, fawkes::InterfaceFieldIterator::set_double(), and fawkes::InterfaceFieldIterator::set_float().
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | gologpp::CompoundType::Representation | v | ) |
Not implemented yet.
v | The value to set the field to. |
Definition at line 165 of file utils.cpp.
References fawkes::InterfaceFieldIterator::get_type(), and fawkes::InterfaceFieldIterator::get_typename().
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | gologpp::ListType::Representation | v | ) |
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | int | v | ) |
Convert the given value and set the field accordingly.
v | The value to set the field to. |
Definition at line 67 of file utils.cpp.
References fawkes::InterfaceFieldIterator::get_type(), fawkes::InterfaceFieldIterator::get_typename(), fawkes::IFT_INT32, fawkes::IFT_INT64, fawkes::InterfaceFieldIterator::set_int32(), and fawkes::InterfaceFieldIterator::set_int64().
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | long | v | ) |
Convert the given value and set the field accordingly.
v | The value to set the field to. |
Definition at line 94 of file utils.cpp.
References fawkes::InterfaceFieldIterator::get_type(), fawkes::InterfaceFieldIterator::get_typename(), fawkes::IFT_INT64, fawkes::IFT_UINT32, fawkes::InterfaceFieldIterator::set_int64(), and fawkes::InterfaceFieldIterator::set_uint32().
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | std::string | v | ) |
Convert the given value and set the field accordingly.
v | The value to set the field to. |
Definition at line 120 of file utils.cpp.
References fawkes::InterfaceFieldIterator::get_type(), fawkes::InterfaceFieldIterator::get_typename(), fawkes::IFT_ENUM, fawkes::IFT_STRING, fawkes::InterfaceFieldIterator::set_enum_string(), fawkes::InterfaceFieldIterator::set_string(), and fawkes::Exception::what_no_backtrace().
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | unsigned int | v | ) |
Convert the given value and set the field accordingly.
v | The value to set the field to. |
Definition at line 51 of file utils.cpp.
References fawkes::InterfaceFieldIterator::get_type(), fawkes::InterfaceFieldIterator::get_typename(), fawkes::IFT_INT32, fawkes::IFT_INT64, fawkes::IFT_UINT16, fawkes::IFT_UINT32, fawkes::IFT_UINT64, fawkes::InterfaceFieldIterator::set_int32(), fawkes::InterfaceFieldIterator::set_int64(), fawkes::InterfaceFieldIterator::set_uint16(), fawkes::InterfaceFieldIterator::set_uint32(), and fawkes::InterfaceFieldIterator::set_uint64().
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | unsigned long | v | ) |
Convert the given value and set the field accordingly.
v | The value to set the field to. |
Definition at line 80 of file utils.cpp.
References fawkes::InterfaceFieldIterator::get_type(), fawkes::InterfaceFieldIterator::get_typename(), fawkes::IFT_INT64, fawkes::IFT_UINT32, fawkes::IFT_UINT64, fawkes::InterfaceFieldIterator::set_int64(), fawkes::InterfaceFieldIterator::set_uint32(), and fawkes::InterfaceFieldIterator::set_uint64().
void fawkes::gpp::ValueToFieldVisitor::operator() | ( | void * | v | ) |
Golog++ does not support void* types.
Thus, this always throws.
v | The value to set the field to. |
Definition at line 154 of file utils.cpp.
References fawkes::InterfaceFieldIterator::get_type(), and fawkes::InterfaceFieldIterator::get_typename().