Menu

#175 Class Attribute Initializer

QM
closed
None
1
2020-04-23
2020-04-20
No

Hi,

Currently, QM only supports adding initializer for Free Attribute. Given that C++ allows member initialization, I would like to have the option to do that in the tool itself.

class BLE : public QP::QActive {
private:
    std::uint8_t m_timeout{0};

public:
    BLE();

protected:
    Q_STATE_DECL(initial);
    Q_STATE_DECL(off);
    Q_STATE_DECL(on);
};

As you can see the initialization of private member m_timeout could be generated in the tool.

Thanks,
Aleksa

Discussion

  • Quantum Leaps

    Quantum Leaps - 2020-04-21
    • status: open --> accepted
     
  • Quantum Leaps

    Quantum Leaps - 2020-04-21

    Makes sense. The initializer filed will be added to the class attributes as well. The "initialzier" filed will be disabled (glayed out) in C, i.e., models based on qpc or qpn.

    This feature request is accepted into the next QM release.

    --MMS

     
  • Quantum Leaps

    Quantum Leaps - 2020-04-23
    • status: accepted --> closed
     
  • Quantum Leaps

    Quantum Leaps - 2020-04-23

    Implemented in QM 5.0.1.
    --MMS

     

Anonymous
Anonymous

Add attachments
Cancel