Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import experiments
- from experiments import *
- class PythonImplementation(Communicatable):
- def __init__(self, number):
- Communicatable.__init__(self)
- self.number = number
- def GetMessage(self):
- return self.number
- def Communicate(self, destination):
- destination.Listen(self)
- def Listen(self, originator):
- print "Python: Get message of " + str(originator.GetMessage())
- c = CImplementation(1337)
- p = PythonImplementation(8888)
- c.Communicate(p)
- #When entered manually, c.Communicate(p) yields
- #Traceback (most recent call last):
- # File "<stdin>", line 1, in <module>
- #TypeError: No to_python (by-value) converter found for C++ type: class boost::shared_ptr<class Communicatable>
- p.Communicate(c) # This works okay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement