ponder 3.1
C++ reflection library
Declaration Example
#include <ponder/classbuilder.hpp>
#include <iostream>
// Templated class.
template <typename T>
struct Data
{
typedef T Type;
Data(Type v) : m_value(v) {}
Type m_value;
};
template <typename T>
static void declare_Data()
{
// Declare type Data<T>
ponder::Class::declare<Data<T>>()
.template constructor<T>()
.property("value", &Data<T>::m_value)
;
}
// Register the types with Ponder
PONDER_TYPE(Data<int>);
PONDER_TYPE(Data<float>);
PONDER_TYPE(Data<double>);
void declare()
{
// Declare the type instances
declare_Data<int>();
declare_Data<float>();
declare_Data<double>();
}