jp-embedded / scxmlcc

The SCXML state machine to C++ compiler
GNU General Public License v3.0
138 stars 34 forks source link

Forward declaration of `sc_XXX::user_model ` #85

Closed sstiller closed 2 years ago

sstiller commented 5 years ago

I have a problem with the type of data_model::user:

Wouldn't it be better to use void* user, as done in other libraries?

jp-embedded commented 5 years ago

Can't you declare the user model like this?

struct sc::user_model 
{
    int timer;
};

int main()
{
  sc::user_model m;
  sc sc(&m);
  sc.init();
}
sstiller commented 5 years ago

In my case I want to provide a more complex structure, declared in a header file which does not know about the state machine. Also this structure shall be used inside Githubissues.

  • Githubissues is a development platform for aggregating issues.