Advertisement
Guest User

PythonExperiments.hpp

a guest
Feb 4th, 2012
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include <boost/python.hpp>
  2. #include <boost/shared_ptr.hpp>
  3. #include <boost/enable_shared_from_this.hpp>
  4.  
  5. class Communicatable
  6. {
  7. public:
  8.     virtual ~Communicatable() { }
  9.     virtual int GetMessage() = 0;
  10.     virtual void Communicate(boost::shared_ptr<Communicatable> destination) = 0;
  11.     virtual void Listen(boost::shared_ptr<Communicatable> originator) = 0;
  12. };
  13.  
  14. class CommunicatableWrapper : public Communicatable, public boost::python::wrapper<Communicatable>
  15. {
  16. public:
  17.     virtual int GetMessage();
  18.     virtual void Communicate(boost::shared_ptr<Communicatable> destination);
  19.     virtual void Listen(boost::shared_ptr<Communicatable> originator);
  20. };
  21.  
  22.  
  23. class CImplementation : public Communicatable, public boost::enable_shared_from_this<CImplementation>
  24. {
  25. protected:
  26.     int message;
  27.  
  28. public:
  29.     CImplementation(int message);
  30.     virtual int GetMessage();
  31.     virtual void Communicate(boost::shared_ptr<Communicatable> destination);
  32.     virtual void Listen(boost::shared_ptr<Communicatable> originator);
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement