Re: [C++-sig] [boost.python] Register a Python-callable with C++ code and call it from C++ code?

2012-10-27 Thread Paul O. Seidon
echanism nicely. And still you can use a raw function > pointer as before. > > -Holger > > On Sat, Oct 27, 2012 at 6:37 PM, Paul O. Seidon > wrote: >> I see, thank you Holger, >> >> I did something similar at first, I did the registering and calling in a >&g

Re: [C++-sig] [boost.python] Register a Python-callable with C++ code and call it from C++ code?

2012-10-27 Thread Paul O. Seidon
n I derive from > that class. Then in python I instantiate those derived classes and can > pass them to the register method. (Usually I like to create a class in > python that in the constructor takes a lambda function.) > > -Holger > > On Sat, Oct 27, 2012 at 4:12 PM, Paul O

[C++-sig] [boost.python] Register a Python-callable with C++ code and call it from C++ code?

2012-10-27 Thread Paul O. Seidon
I want to register Python-callables with my VariableFloat-class (which is a subclass of a template-class Variable) and call them if the variable's value changes. For this I added an instance of class EventEmitter, which should hold references to those callbacks. So, VariableFloat delegates to E

[C++-sig] [SOLVED] Re: [boost.python] Can't import a wrapped template class

2012-10-27 Thread Paul O. Seidon
Paul O. Seidon wrote: > That didn't make any difference. And it would have surprised me, if it > did: varbls.h contains the declaration, varbls.cpp contains the > definition, the wrapper is in main.cpp. So if the compiler sees any need > to include sometihng, it will and the

Re: [C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Paul O. Seidon
Stefan Seefeld wrote: > On 10/26/2012 02:24 PM, Paul O. Seidon wrote: >> Paul O. Seidon wrote: >> >> That doesn't do it either. I can't help but post the compete code here to >> be sure I'm not misunderstood. The lib consists of varbls.cp

Re: [C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Paul O. Seidon
Paul O. Seidon wrote: > Stefan Seefeld wrote: > >> On 10/26/2012 01:50 PM, Paul O. Seidon wrote: >>> The ctor is decl'ed in varbls.h as >>> >>> _Variable(); >>> >>> and it's def'ed in varbls.cpp like so: >>>

Re: [C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Paul O. Seidon
Stefan Seefeld wrote: > On 10/26/2012 01:50 PM, Paul O. Seidon wrote: >> The ctor is decl'ed in varbls.h as >> >> _Variable(); >> >> and it's def'ed in varbls.cpp like so: >> >> template >> _Variable::_Variable() >> : _valu

Re: [C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Paul O. Seidon
Stefan Seefeld wrote: > On 10/26/2012 07:42 AM, Paul O. Seidon wrote: >> Hi all, >> >> right now I'm doing my first stepps in wrapping C++ code by ude of Boost. > > [...] > > Where is the definition of your _Variable template instances ? Your > newly co

[C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Paul O. Seidon
Hi all, right now I'm doing my first stepps in wrapping C++ code by ude of Boost. So, there's a template class _Variable with ctor, dtor, an inspector TYPE value() const and a mutator void value( const TYPE& value). The boost wrapper looks like this: #include #include using namespace bo