Wolframe, 0.0.3

Runtime environment host structure module

The configuration of the runtime environment module example is defined in a descriptive way. If you want to learn more about how to define a configuration by declaring first the data members and then the description for introspection, you will find an example at Descriptive configuration declaration example

static int initMyRuntimeEnvironment()
{
// ... put your global initializations here
// ... return 0 on success, an error code != 0 else
}
class MyRuntimeEnvironmentConfig
{
public:
// ... define your runtime environment configuration data members here
static const _Wolframe::serialize::StructDescriptionBase* getStructDescription()
{
// ... return your introspection description reference of the configuration here
}
MyRuntimeEnvironmentConfig( const char* classname, const char* title, const char* logprefix, const char* subsection)
:_Wolframe::serialize::DescriptiveConfiguration( title, "authentication", logprefix, getStructDescription())
{
setBasePtr( (void*)this); // ... mandatory to set pointer to start of configuration
}
};
class MyRuntimeEnvironment
{
public:
// ... put your runtime environment host structures here
MyRuntimeEnvironment( const MyRuntimeEnvironmentConfig* cfg)
{
// ... create your runtime environment from its configuration here
}
virtual _Wolframe::langbind::FormFunctionClosure* createClosure( const std::string& funcname) const
{
// ... create and return a closure to execute the function 'funcname' here
}
virtual std::vector<std::string> functions() const
{
// ... return the list of functions that are exported by the runtime environment here
}
virtual const char* name() const
{
// ... return the name of the runtime environment here
}
};
WF_MODULE_BEGIN( "MyRuntimeEnvironment", "runtime environment for my programs")
WF_RUNTIME_ENVIRONMENT( "my runtime environment", "runtimeenv", "myrunenv", MyRuntimeEnvironment, MyRuntimeEnvironmentConfig, initMyRuntimeEnvironment)