-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Description
I'm playing around with the C++ transpiler and tried to get some inheritance pattern to work. It basically plays well, but behaves somewhat unexpected. I use this as my RenderConfig.Cpp:
[RenderConfig]
AutoExpandedVars = """
int count;
"""
[RenderConfig.Cpp]
BaseClassCode = "public LightController"
[SmRunnerSettings]
transpilerId = "Cpp"
This results expectedly in:
[...]
// Generated state machine
class LightSm : public LightController
{
public:
enum class EventId: uint8_t
{
[...]
But also in:
[...]
// State machine variables. Can be used for inputs, outputs, user variables...
class Vars : public LightController
{
public:
int count;
};
[...]
Is this intended that the BaseClassCode is attached to the contained Vars class? Or did I get something else wrong? Otherwise I would expect that the Vars class should not receive the "BaseClassCode".
Why that hits me: I'm using something like this as base class to be able to directly call the start method:
class LightController
{
public:
virtual void start() = 0;
[...]
};