How do you subclass the MessageStoreFactory class in Python when using the Python bindings for QuickFix?
When I attempt this the object is not "seen" as a MessageStoreFactory:
NotImplementedError: Wrong number of arguments for overloaded function 'new_SocketInitiatorBase'.
Possible C/C++ prototypes are:
FIX::SocketInitiator(FIX::Application &,FIX::MessageStoreFactory &,FIX::SessionSettings const &)
FIX::SocketInitiator(FIX::Application &,FIX::MessageStoreFactory &,FIX::SessionSettings const &,FIX::LogFactory &)
This error seems to be returned by SWIG when the types are wrong. (I've only used Boost in the past - is subclassing of a C++ class in Python even possible in SWIG?)
Updated The Python bindings are the ones packaged for Ubuntu 12.04. I'm fairly sure I've got the arguments correct as the error only occurs when I swap out one of the QuickFix objects with the one below when I create a SocketInitiator:
class TestStoreFactory(quickfix.MessageStoreFactory):
def __init__(self):
logging.info("TestStoreFactory()")
def create(self, sessionId):
logging.info("Create %s"%sessionId)
def destroy(self, messageStore):
logging.info("Destroy %s" % messageStore)
Got around this problem by placing a call to the base class constructor.
class TestStoreFactory(quickfix.MessageStoreFactory):
def __init__(self):
quickfix.MessageStoreFactory.__init__(self)
logging.info("TestStoreFactory()")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With