Popular recipes tagged "boost"http://code.activestate.com/recipes/tags/boost/2014-11-20T20:00:27-08:00ActiveState Code RecipesBoost::Python callback triggered from Non-Python created threads (C++) 2014-11-20T20:00:27-08:00Tomáš Rampashttp://code.activestate.com/recipes/users/4179816/http://code.activestate.com/recipes/578967-boostpython-callback-triggered-from-non-python-cre/ <p style="color: grey"> C++ recipe 578967 by <a href="/recipes/users/4179816/">Tomáš Rampas</a> (<a href="/recipes/tags/boost/">boost</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>Consider we have virtual/abstract C++ class that's fully implemented in Python. And for some sake of necessity we have a callback method (e.g. as some sort of event) that is being triggered from different thread on C++ side. In such case corresponding callback methods have to manage GIL state via PyGILState_STATE. So the resulting C++ callback class definition will look like follows (notice that Python method calls are wrapped up with GIL state handling code).</p> Convert datetime.datetime objects to/from Boost.python posix time (Python) 2008-09-17T23:55:23-07:00david decotignyhttp://code.activestate.com/recipes/users/4129454/http://code.activestate.com/recipes/576395-convert-datetimedatetime-objects-tofrom-boostpytho/ <p style="color: grey"> Python recipe 576395 by <a href="/recipes/users/4129454/">david decotigny</a> (<a href="/recipes/tags/boost/">boost</a>). Revision 10. </p> <p>This recipe allows to transparently convert python's datetime.datetime objects to and from boost's boost::posix_time::ptime objects.</p>