Skip to content

Instantly share code, notes, and snippets.

@JohnMurray
Created July 27, 2020 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohnMurray/e86978f84ee0e1c07dfaa16fcb8118d7 to your computer and use it in GitHub Desktop.
Save JohnMurray/e86978f84ee0e1c07dfaa16fcb8118d7 to your computer and use it in GitHub Desktop.
class HelloBehavior {
public:
virtual void receive(std::string const& msg) = 0;
};
class HelloActor
: public Actor
, public HelloBehavior {
std::string m_greeting;
public:
explicit HelloActor(std::string const& greeting): m_greeting(greeting) {}
void receive(std::string const& msg) override {
std::cout << m_greeting << " " << msg << "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment