ug4
util_overloaded.h File Reference

Go to the source code of this file.

Macros

#define ADD_CONSTRUCTOR(__theSignature)   template add_constructor<void (*) __theSignature >
 for adding of constructors with signatures. More...
 
#define OVERLOADED_CONST_METHOD_PTR(returnType, classType, methodName, arguments)    static_cast<returnType (classType::*)arguments const>(&classType::methodName)
 
#define OVERLOADED_FUNCTION_PTR(returnType, methodName, arguments)    static_cast<returnType (*)arguments >(&methodName)
 
#define OVERLOADED_METHOD_PTR(returnType, classType, methodName, arguments)    static_cast<returnType (classType::*)arguments>(&classType::methodName)
 

Macro Definition Documentation

◆ ADD_CONSTRUCTOR

#define ADD_CONSTRUCTOR (   __theSignature)    template add_constructor<void (*) __theSignature >

for adding of constructors with signatures.

example:

reg.add_class_<T, TBase>(name, grp)
.add_constructor()
. ADD_CONSTRUCTOR( (int parameter) )("parameter")
location name
Definition: checkpoint_util.lua:128
#define ADD_CONSTRUCTOR(__theSignature)
for adding of constructors with signatures.
Definition: util_overloaded.h:65

note the double brackets ! ADD_CONSTRUCTOR ( (int a, int b) )

◆ OVERLOADED_CONST_METHOD_PTR

#define OVERLOADED_CONST_METHOD_PTR (   returnType,
  classType,
  methodName,
  arguments 
)     static_cast<returnType (classType::*)arguments const>(&classType::methodName)

for a member function with signature bool MyClass::my_member_fu(double d) const : OVERLOADED_CONST_METHOD_PTR(bool, MyClass, my_member_fu, (double d) )

◆ OVERLOADED_FUNCTION_PTR

#define OVERLOADED_FUNCTION_PTR (   returnType,
  methodName,
  arguments 
)     static_cast<returnType (*)arguments >(&methodName)

for a function with signature int *MyFunction(char *name, OtherType &t) : OVERLOADED_FUNCTION_PTR(int *, MyFunction, (char *name, OtherType &t ) )

◆ OVERLOADED_METHOD_PTR

#define OVERLOADED_METHOD_PTR (   returnType,
  classType,
  methodName,
  arguments 
)     static_cast<returnType (classType::*)arguments>(&classType::methodName)

for a member function with signature void MyClass::my_member_fu() : OVERLOADED_METHOD_PTR(void, MyClass, my_member_fu, () )