Provides runtime access to class members. More...
#include <value_base.hpp>
Public Member Functions | |
value_base (const value_base &) | |
bool | is_array () const |
bool | is_function () const |
size_t | size () const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
value | operator() () const |
value | operator() () |
template<typename P1 > | |
value | operator() (P1) const |
template<typename P1 > | |
value | operator() (P1) |
template<typename P1 , typename P2 > | |
value | operator() (P1, P2) const |
template<typename P1 , typename P2 > | |
value | operator() (P1, P2) |
const char * | type () const |
void | visit (read_value_visitor &&v) const |
void | visit (write_value_visitor &&v) |
template<typename T > | |
T | as () const |
template<typename T > | |
void | set_as (const T &&) |
bool | operator! () const |
template<typename T > | |
T & | get () |
template<typename T > | |
const T & | get () const |
template<typename T > | |
const T * | ptr () const |
template<typename T > | |
T * | ptr () |
bool | has_field (const std::string &field) const |
Protected Member Functions | |
const detail::place_holder * | get_holder () const |
detail::place_holder * | get_holder () |
Protected Attributes | |
char | held [3 *sizeof(void *)] |
Friends | |
class | value |
class | value_ref |
class | value_cref |
This class serves as the base for value_ref, value_cref, and value which handle the copy and ownership semantics while value_base deals with the interface semantics.
struct test { int num; std::string str; int print( std::string& ); }; BOOST_REFLECT( test, (num)(str)(print) ) value v(test()); v["num"].as<int>(); v["num"].as<std::string>(); v["str"].as<std::string>(); v["str"].as<int>(); v["print"]( "hello world" );
Given a value you can iterate over its members and perform actions.
Definition at line 43 of file value_base.hpp.
iterator mace::reflect::value_base::begin | ( | ) |
If a struct, iterates over fields If a map, over keys if an array, over indexes
value mace::reflect::value_base::operator() | ( | ) | const |
If a function, calls it...