Wolframe, 0.0.3

moduleFrameMacros.hpp File Reference

Macros for defining the frame of a Wolframe application extension module. More...

Go to the source code of this file.

Macros

#define WF_MODULE_BEGIN(NAME, DESCRIPTION)
 Marks the start of the Wolframe C++ custom datatype module after the includes section. More...
 
#define WF_MODULE_END
 

Detailed Description

Macros for defining the frame of a Wolframe application extension module.

Macro Definition Documentation

#define WF_MODULE_BEGIN (   NAME,
  DESCRIPTION 
)
Value:
static const char* _Wolframe__moduleName()\
{\
return NAME;\
}\
namespace {\
struct CreateBuilderArray\
{\
enum {MaxNofBuilders=64};\
std::size_t size;\
CreateBuilderArray()\
:size(0)\
{\
ar[0] = 0;\
}\
CreateBuilderArray operator()( _Wolframe::module::createBuilderFunc func)\
{\
if (size +1 >= MaxNofBuilders) throw std::logic_error("too many builder objects defined in module '" #NAME "' (maximum of 64 objects)");\
ar[ size] = func;\
ar[ size+1] = 0;\
size += 1;\
return *this;\
}\
};\
struct CreateBuilderArrayImpl :public CreateBuilderArray\
{\
CreateBuilderArrayImpl()\
{
BuilderBase *(* createBuilderFunc)()
Function that constructs a builder. This function is specific for each of the configured builders in ...
Definition: moduleInterface.hpp:156

Marks the start of the Wolframe C++ custom datatype module after the includes section.

#define WF_MODULE_END
Value:
}\
};\
}\
static CreateBuilderArrayImpl createBuilderArray;\
extern "C" { \
_Wolframe::module::ModuleEntryPoint entryPoint( 0, _Wolframe__moduleName(), createBuilderArray.ar); \
}
ModuleEntryPoint entryPoint
Definition: moduleInterface.hpp:180