Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BaseClassCode (unexpectedly?) applied to Vars in Cpp Transpiler #427

@ElFishle

Description

@ElFishle

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;
[...]
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions