Lecrapouille / PlantUMLStatecharts

[Tool][Functional] Generate state machine in C++ from PlantUML statecharts
GNU General Public License v3.0
6 stars 1 forks source link

Param to constructor #13

Closed Lecrapouille closed 2 years ago

Lecrapouille commented 2 years ago

Make it works (missing : m_arg1(arg1) + generate value for unit tests

'[header] struct Arg1 { int foo; };
'[header] struct Arg2 { int bar; };
'[param] Arg1 arg1
'[param] Arg2 arg2
'[init] m_arg1 = arg1;
'[init] m_arg2 = arg2;

Generating

    SimpleController(Arg1 arg1, Arg2 arg2)
        : StateMachine(SimpleControllerStates::CONSTRUCTOR)
    {
        m_arg1 = arg1;
        m_arg2 = arg2;

but desired:

    SimpleController(Arg1 arg1, Arg2 arg2)
        : StateMachine(SimpleControllerStates::CONSTRUCTOR),
          m_arg1(arg1), m_arg2(arg2)
    {