is it possible to instantiate multiple Elevators classes, using the same elevator.hpp and .cpp?
husnaini798 opened this issue · 3 comments
husnaini798 commented
is it possible to instantiate multiple Elevators classes, using the same elevator.hpp and .cpp? if so, how?
Thanks
husnaini798 commented
Hi Alex,
Thanks for your reply. The multiple switches make sense at compile time.
But how do I declare all those 'defectiveswitches' at runtime?
FSM_INITIAL_STATE(DefectiveSwitch<2>, Off<2> )
I would like to use this for a warning system (and based on the user input
the warnings will move to different states). However, at the start I
wouldn't know how many warnings would I recieve. I could recieve 1000s or
more warnings as the system runs/continues or none at all.
Appreciate your help with this.
Thanks.
Kind regards,
Husnain Malik
…On Tuesday, July 5, 2022, Axel Burri ***@***.***> wrote:
Closed #35 <#35> as completed.
—
Reply to this email directly, view it on GitHub
<#35 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AU4QRYFJR3LXKQSVTOPIUYLVSM3NHANCNFSM52SGZDXQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
husnaini798 commented
Or,
If somehow I wrap the state machine's struct/class (i.e. warning),
struct warning : tinyfsm::fsm<warning>
, in another class 'like MyWarning'
And then create multiple instances of MyWarning class. Would that create
multiple MyWarnings, each containing a seperate tinyfsm's 'warning state
machine'?
Or since everything is static, multiple Mywarning instances would all be
using one tinyfsm's warning state machine?
Thanks
…On Tuesday, July 5, 2022, Husnain Malik ***@***.***> wrote:
Hi Alex,
Thanks for your reply. The multiple switches make sense at compile time.
But how do I declare all those 'defectiveswitches' at runtime?
FSM_INITIAL_STATE(DefectiveSwitch<2>, Off<2> )
I would like to use this for a warning system (and based on the user input
the warnings will move to different states). However, at the start I
wouldn't know how many warnings would I recieve. I could recieve 1000s or
more warnings as the system runs/continues or none at all.
Appreciate your help with this.
Thanks.
Kind regards,
Husnain Malik
On Tuesday, July 5, 2022, Axel Burri ***@***.***> wrote:
> Closed #35 <#35> as completed.
>
> —
> Reply to this email directly, view it on GitHub
> <#35 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AU4QRYFJR3LXKQSVTOPIUYLVSM3NHANCNFSM52SGZDXQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>