I manually reflect on my bindable classes like:
class Test1
{
public:
eiBind(Test1);
int DoStuff() { return 0; }
private:
int m_stuff;
};
eiBindClass( Test1 )
eiBeginMethods()
eiBindMethod( DoStuff )
eiEndMethods()
eiBeginData()
eiBindData( m_stuff )
eiEndData()
eiEndBind();And then to bind it to a specific scripting VM, I can fetch the above info withconst TypeBinding& b = ReflectTest1();Which gives me structures like
typedef void (FnTask)( void* obj, void* args, uint argSize );
struct DataBinding
{
const char* name;
memptr memvar;
uint offset, size;
Type type;
};
struct MethodBinding
{
const char* name;
FnTask* task;
const DataBinding* args;
uint argCount;
};
struct TypeBinding
{
const DataBinding* data;
uint dataCount;
const MethodBinding* method;
uint methodCount;
};