MACE  1.0.0
 All Classes Namespaces Files Functions Variables Enumerations Defines
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
mace::reflect::value_base Class Reference

Provides runtime access to class members. More...

#include <value_base.hpp>

Inheritance diagram for mace::reflect::value_base:
mace::reflect::value mace::reflect::value_cref mace::reflect::value_ref

List of all members.

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 >
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

Detailed Description

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.


Member Function Documentation

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...


The documentation for this class was generated from the following file: