Skip to content

backmp11: Simplified functor signatures #175

@chandryan

Description

@chandryan

The Functor API in MSM supports exactly one syntax that requires 4 template parameters for Functor operators:

struct MyAction
{
    template <typename Event, typename Fsm, typename Source, typename Target>
    void operator()(const Event&, Fsm&, Source&, Target&)
    {
    }
};

By applying deeper introspection into the Functor, we can support additional API variants. For example a simpler variant that only takes the Fsm:

struct SimpleAction
{
    template <typename Fsm>
    void operator()(Fsm&)
    {
    }
};

A PoC looks promising, though the benchmark shows a slight increase in memory consumption and compile time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions