Wolframe, 0.0.3

Normalize function module
class MyNormalizeFunction
{
public:
MyNormalizeFunction( const std::vector<_Wolframe::types::Variant>& arg)
{
// ... the WF_NORMALIZER* template needs a constructor with this signature
}
virtual const char* name() const
{
// ... return the identifier of the function here
}
{
// ... execure this function on the input variant here
}
{
// ... return a copy of this here
}
};
WF_MODULE_BEGIN( "My normalizer", "my normalizer module")
WF_NORMALIZER( "mynormalize", MyNormalizeFunction)

If your normalizer functions use common resources, you can declare them as follows:

class MyResources
{
// ... put your common data structure (normalizer resources) decrarations here
};

The MyNormalizeFunction has a slighly different constructor signature required. The first parameter is the base resource handle reference. The consructor can use a dynamic_cast to get his resource object: :

MyNormalizeFunction::MyNormalizeFunction( _Wolframe::types::NormalizeResourceHandle* reshnd, const std::vector<_Wolframe::types::Variant>& arg)
{
MyResources* myreshnd = dynamic_cast<MyResources*>(reshnd);
// ... do other initializations
}

We then declare the resources and the function with the following macro after WF_MODULE_BEGIN:

WF_NORMALIZER_WITH_RESOURCE( "mynormalize", MyNormalizeFunction, MyResources)