ponder 3.2
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>();
}
runtime.hpp
Runtime uses for Ponder registered data.
PONDER_TYPE
#define PONDER_TYPE(...)
Macro used to register a C++ type to Ponder.
Definition: pondertype.hpp:104