Skip to content

How to provide alternatives in sequence #67

@Flamefire

Description

@Flamefire

Suppose I have the following class:

struct Foo{
  virtual void before();
  virtual void do();
  virtual void after();
};

With the sequence approach I can make sure, those functions are called in order when having a single instance.

But what do I do when I have multiple instances? Example:

Foo* f1 = new Foo;
Foo* f2 = new Foo;
container.add(f1, f2);
// Expect (f1.before && f2.before) + (f1.do && f2.do)  + (f1.after && f2.after) 
container.process();

How can I ensure, that both before are called first, then both do etc while the order of the calls to the same function do not matter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions