Skip to content

Instantly share code, notes, and snippets.

@JohnMurray
Created July 25, 2020 16:57
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/e51729c527006fe1274dd7a4ae8bb034 to your computer and use it in GitHub Desktop.
Save JohnMurray/e51729c527006fe1274dd7a4ae8bb034 to your computer and use it in GitHub Desktop.
class HelloBehavior: public Behavior {
virtual void receive(std::string const& msg) = 0;
};
class HelloActor
: public Actor
, public HelloBehavior {
std::string m_greeting;
public:
HelloActor(std::string const& greeting): m_greeting(greeting){};
void receive(std::string const& msg) {
std::cout << m_greeting << " " << msg << "\n";
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment