<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[boost::python + observer pattern]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe da mal eine Frage zu boost::python. Ich habe da ein Beobachtermuster in C++ moduliert und moechte nun als konkreten Beobachter eine Pythonklasse definiern. Prinzipiell sollte es ja kein Problem sein, nur weiss ich nicht wie ich die abstrakte Callbackmethode in boost definieren soll, damit sie in richtung Python richtig funktioniert.</p>
<p>hier erstmal einwenig vereinfachten code, damit ihr wisst was ich meine :</p>
<pre><code class="language-cpp">class Observable;

class Observer
{
   public :
     virtual void performEvent(Observable* observable) = 0;
};

class Observable
{
   private :
      Observer* observer;
   public :
      void addObserver(Observer* observer); 
      void delObserver();
      void notify();
};

void Observable::addObserver(Observer*)
{
   this-&gt;observer = observer;
}

void Observable::delObserver()
{
   this-&gt;observer = NULL;
}

void Observable::notify()
{
   if (observer != NULL)
      observer-&gt;eventPerform(this);
}
</code></pre>
<p>Soweit ist es ja alles noch klar, da es sich (fast) um das Standardversion des Observer Pattern handelt. Wenn ich jetzt eine konkrete Observable definiere ist es auch noch kein problem.</p>
<pre><code class="language-cpp">class MyObservable : Observable
{
   private :
      int wert;
   public :
      void setWert(int arg);
      int  getWert();
};

void MyObservable::setWert(int arg)
{
   wert = arg;
   notify();
}

int  MyObservable::getWert()
{
   return wert;
}
</code></pre>
<p>Meine Pythondefiniton wuerde sieht dafuer dann wie folgt aus :</p>
<pre><code class="language-cpp">BOOST_PYTHON_MODULE(MyObservable)
{
    class_&lt;MyObservable&gt;(&quot;MyObservable&quot;)
        .def(&quot;setWert&quot;,          &amp;MyObservable::setWert)
        .def(&quot;getWert&quot;,          &amp;MyObservable::getWert)
        .def(&quot;addObserver&quot;,      &amp;MyObservable::addObserver)
        .def(&quot;delObserver&quot;,      &amp;MyObservable::delObserver)
    ;
}
</code></pre>
<p>Soweit, so gut. Wie definiere ich aber das Observerinterface mit der abstrakten Methode, das ich sie in Python benutzen kann? zB so :</p>
<pre><code>class MyObserver(Observer):
   def __init__(self):
      self.__myobservable = MyObservable()
      self.__myobservable.addObserver(self)

   def eventPerform(self, observable) :
      print &quot;treffer !!! ;) &quot;
</code></pre>
<p>Lange Rede, kurzer Sinn. Kann mir jemand weiterhelfen? bin fuer jede Idee dankbar.</p>
<p>gruss<br />
tyr377</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/177696/boost-python-observer-pattern</link><generator>RSS for Node</generator><lastBuildDate>Sat, 27 Jun 2026 15:29:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/177696.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Apr 2007 08:33:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to boost::python + observer pattern on Tue, 03 Apr 2007 08:33:27 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe da mal eine Frage zu boost::python. Ich habe da ein Beobachtermuster in C++ moduliert und moechte nun als konkreten Beobachter eine Pythonklasse definiern. Prinzipiell sollte es ja kein Problem sein, nur weiss ich nicht wie ich die abstrakte Callbackmethode in boost definieren soll, damit sie in richtung Python richtig funktioniert.</p>
<p>hier erstmal einwenig vereinfachten code, damit ihr wisst was ich meine :</p>
<pre><code class="language-cpp">class Observable;

class Observer
{
   public :
     virtual void performEvent(Observable* observable) = 0;
};

class Observable
{
   private :
      Observer* observer;
   public :
      void addObserver(Observer* observer); 
      void delObserver();
      void notify();
};

void Observable::addObserver(Observer*)
{
   this-&gt;observer = observer;
}

void Observable::delObserver()
{
   this-&gt;observer = NULL;
}

void Observable::notify()
{
   if (observer != NULL)
      observer-&gt;eventPerform(this);
}
</code></pre>
<p>Soweit ist es ja alles noch klar, da es sich (fast) um das Standardversion des Observer Pattern handelt. Wenn ich jetzt eine konkrete Observable definiere ist es auch noch kein problem.</p>
<pre><code class="language-cpp">class MyObservable : Observable
{
   private :
      int wert;
   public :
      void setWert(int arg);
      int  getWert();
};

void MyObservable::setWert(int arg)
{
   wert = arg;
   notify();
}

int  MyObservable::getWert()
{
   return wert;
}
</code></pre>
<p>Meine Pythondefiniton wuerde sieht dafuer dann wie folgt aus :</p>
<pre><code class="language-cpp">BOOST_PYTHON_MODULE(MyObservable)
{
    class_&lt;MyObservable&gt;(&quot;MyObservable&quot;)
        .def(&quot;setWert&quot;,          &amp;MyObservable::setWert)
        .def(&quot;getWert&quot;,          &amp;MyObservable::getWert)
        .def(&quot;addObserver&quot;,      &amp;MyObservable::addObserver)
        .def(&quot;delObserver&quot;,      &amp;MyObservable::delObserver)
    ;
}
</code></pre>
<p>Soweit, so gut. Wie definiere ich aber das Observerinterface mit der abstrakten Methode, das ich sie in Python benutzen kann? zB so :</p>
<pre><code>class MyObserver(Observer):
   def __init__(self):
      self.__myobservable = MyObservable()
      self.__myobservable.addObserver(self)

   def eventPerform(self, observable) :
      print &quot;treffer !!! ;) &quot;
</code></pre>
<p>Lange Rede, kurzer Sinn. Kann mir jemand weiterhelfen? bin fuer jede Idee dankbar.</p>
<p>gruss<br />
tyr377</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1258355</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1258355</guid><dc:creator><![CDATA[tyr377]]></dc:creator><pubDate>Tue, 03 Apr 2007 08:33:27 GMT</pubDate></item><item><title><![CDATA[Reply to boost::python + observer pattern on Tue, 03 Apr 2007 10:12:38 GMT]]></title><description><![CDATA[<p>Schon mal pyste probiert?<br />
Evtl. hilft dir auch die Doku von pyste weiter:<br />
<a href="http://boost.org/libs/python/pyste/index.html" rel="nofollow">http://boost.org/libs/python/pyste/index.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1258426</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1258426</guid><dc:creator><![CDATA[phlox81]]></dc:creator><pubDate>Tue, 03 Apr 2007 10:12:38 GMT</pubDate></item><item><title><![CDATA[Reply to boost::python + observer pattern on Tue, 03 Apr 2007 11:18:23 GMT]]></title><description><![CDATA[<p>Eigentlich wollte ich das mit den Generatoren sein lassen. Zum einen ist das meine Schnittstelle nicht so groß dass ich es nicht auch von hand schreiben könnte und zum anderen würde ich gerne wissen wie es prinzipiell geht, wenn ich später mal einen Generator einsetzen sollte. Habe auch schon ne lösung unter <a href="http://www.boost.org/libs/python/doc/v2/wrapper.html" rel="nofollow">http://www.boost.org/libs/python/doc/v2/wrapper.html</a> gefunden. Nur will er noch nicht kompilieren.</p>
<p>Die allgemeine Info dazu ist, dass man nen Wrapper braucht. Mein Wrapper sieht so aus:</p>
<pre><code class="language-cpp">#include &quot;observer.hpp&quot;

#include &lt;boost/python/module.hpp&gt;
#include &lt;boost/python/class.hpp&gt;
#include &lt;boost/python/wrapper.hpp&gt;
#include &lt;boost/python/call.hpp&gt;

using namespace boost::python;

class PyObserver : public Observer, wrapper&lt;Observer&gt;
{
	public :
	   void performEvent(Observable* observable);
};
void PyObserver::performEvent(Observable* observable)
{
	this-&gt;get_override(&quot;performEvent&quot;)(observable);	
}
</code></pre>
<p>und die definition fürs Pythonmodul :</p>
<pre><code class="language-cpp">BOOST_PYTHON_MODULE(MyObservable)
{
    class_&lt;MyObservable&gt;(&quot;MyObservable&quot;)
        .def(&quot;setWert&quot;,          &amp;MyObservable::setWert)
        .def(&quot;getWert&quot;,          &amp;MyObservable::getWert)
        .def(&quot;addObserver&quot;,      &amp;MyObservable::addObserver)
        .def(&quot;delObserver&quot;,      &amp;MyObservable::delObserver)
    ;
    class_&lt;PyOserver,boost::noncopyable&gt;(&quot;PyObserver&quot;)
        .def(&quot;performEvent&quot;, pure_virtual(&amp;PyObserver::performEvent))
    ;
}
</code></pre>
<p>Es kann nur noch ne Kleinigkeit sein, die ich übersehe. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1258469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1258469</guid><dc:creator><![CDATA[tyr377]]></dc:creator><pubDate>Tue, 03 Apr 2007 11:18:23 GMT</pubDate></item><item><title><![CDATA[Reply to boost::python + observer pattern on Tue, 03 Apr 2007 11:25:23 GMT]]></title><description><![CDATA[<p>tyr377 schrieb:</p>
<blockquote>
<p>Nur will er noch nicht kompilieren.</p>
</blockquote>
<p>Ich glaube kaum, daß dein Compiler sich da auf ein &quot;das geht nicht&quot; beschränkt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> (will sagen: Normalerweise geben Compiler recht detaillierte Hinweise darauf, was (und wo) nicht richtig ist)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1258480</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1258480</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 03 Apr 2007 11:25:23 GMT</pubDate></item><item><title><![CDATA[Reply to boost::python + observer pattern on Tue, 03 Apr 2007 12:30:00 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>Ich glaube kaum, daß dein Compiler sich da auf ein &quot;das geht nicht&quot; beschränkt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
</blockquote>
<p>wäre was, oder? Würde die Fehlersuche noch wesentlich spannender machen :D. Scherz beiseite, natürlich gibt er ne fehlermeldung aus.</p>
<p>g++ -I../DCDEventLayer/boost/include/ -I/usr/include/python2.3 -c -o pyBoost.o pyBoost.cpp<br />
../DCDEventLayer/boost/include/boost/python/class.hpp: In constructor <code>boost::python::class_&lt;T, X1, X2, X3&gt;::id\_vector::id\_vector() \[with W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]': ../DCDEventLayer/boost/include/boost/python/class.hpp:628: instantiated from</code>boost::python::class_&lt;T, X1, X2, X3&gt;::class_(const char*, const char*) [with W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]'<br />
pyBoost.cpp:48: instantiated from here<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:179: error: `boost::python::wrapper&lt;Observer&gt;' is an inaccessible base of `PyObserver'<br />
../DCDEventLayer/boost/include/boost/python/object/class_metadata.hpp: In static member function <code>static void boost::python::objects::class\_metadata&lt;T, X1, X2, X3&gt;::register_() \[with T = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]': ../DCDEventLayer/boost/include/boost/python/class.hpp:496: instantiated from</code>void boost::python::class_&lt;T, X1, X2, X3&gt;::initialize(const DefVisitor&amp;) [with DefVisitor = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]'<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:629: instantiated from <code>boost::python::class_&lt;T, X1, X2, X3&gt;::class_(const char*, const char*) \[with W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]' pyBoost.cpp:48: instantiated from here ../DCDEventLayer/boost/include/boost/python/object/class_metadata.hpp:205: error: \</code>boost::python::wrapper&lt;Observer&gt;' is an inaccessible base of `PyObserver'<br />
../DCDEventLayer/boost/include/boost/python/detail/is_wrapper.hpp: At global scope:<br />
../DCDEventLayer/boost/include/boost/python/detail/is_wrapper.hpp: In instantiation of <code>boost::python::detail::is\_wrapper&lt;PyObserver&gt;': ../DCDEventLayer/boost/include/boost/utility/enable\_if.hpp:59: instantiated from</code>boost::disable_if&lt;boost::python::detail::is_wrapper&lt;PyObserver&gt;, PyObserver*&gt;'<br />
../DCDEventLayer/boost/include/boost/python/detail/enable_if.hpp:66: instantiated from <code>boost::python::detail::disable\_if\_ret&lt;boost::python::detail::is\_wrapper&lt;PyObserver&gt;, PyObserver*&gt;' ../DCDEventLayer/boost/include/boost/python/class.hpp:608: instantiated from</code>void boost::python::class_&lt;T, X1, X2, X3&gt;::def_maybe_overloads(const char*, Fn, const A1&amp;, ...) [with Fn = boost::python::api::object, A1 = const char*, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]'<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:244: instantiated from <code>boost::python::class_&lt;T, X1, X2, X3&gt;&amp; boost::python::class_&lt;T, X1, X2, X3&gt;::def(const char*, A1, const A2&amp;) \[with A1 = boost::python::api::object, A2 = const char*, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]' ../DCDEventLayer/boost/include/boost/python/init.hpp:330: instantiated from</code>void boost::python::detail::def_init_aux(ClassT&amp;, const Signature&amp;, NArgs, const CallPoliciesT&amp;, const char*, const boost::python::detail::keyword_range&amp;) [with ClassT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not_specified, boost::python::detail::not_specified&gt;, CallPoliciesT = boost::python::default_call_policies, Signature = boost::mpl::vector0&lt;mpl_::na&gt;, NArgs = boost::mpl::size&lt;boost::mpl::vector0&lt;mpl_::na&gt; &gt;]'<br />
../DCDEventLayer/boost/include/boost/python/init.hpp:399: instantiated from <code>static void boost::python::detail::define\_class\_init\_helper&lt;0&gt;::apply(ClassT&amp;, const CallPoliciesT&amp;, const Signature&amp;, NArgs, const char*, const boost::python::detail::keyword\_range&amp;) \[with ClassT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not\_specified, boost::python::detail::not\_specified&gt;, CallPoliciesT = boost::python::default\_call\_policies, Signature = boost::mpl::vector0&lt;mpl_::na&gt;, NArgs = boost::mpl::size&lt;boost::mpl::vector0&lt;mpl_::na&gt; &gt;\]' ../DCDEventLayer/boost/include/boost/python/init.hpp:171: instantiated from</code>void boost::python::init_base&lt;DerivedT&gt;::visit(classT&amp;) const [with classT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not_specified, boost::python::detail::not_specified&gt;, DerivedT = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;]'<br />
../DCDEventLayer/boost/include/boost/python/def_visitor.hpp:31: instantiated from <code>static void boost::python::def\_visitor\_access::visit(const V&amp;, classT&amp;) \[with V = boost::python::def\_visitor&lt;boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt; &gt;, classT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not\_specified, boost::python::detail::not\_specified&gt;\]' ../DCDEventLayer/boost/include/boost/python/def\_visitor.hpp:67: instantiated from</code>void boost::python::def_visitor&lt;DerivedVisitor&gt;::visit(classT&amp;) const [with classT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not_specified, boost::python::detail::not_specified&gt;, DerivedVisitor = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;]'<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:225: instantiated from <code>boost::python::class_&lt;T, X1, X2, X3&gt;&amp; boost::python::class_&lt;T, X1, X2, X3&gt;::def(const boost::python::def\_visitor&lt;Derived&gt;&amp;) \[with Derived = boost::python::init&lt;mpl\_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]' ../DCDEventLayer/boost/include/boost/python/class.hpp:501: instantiated from</code>void boost::python::class_&lt;T, X1, X2, X3&gt;::initialize(const DefVisitor&amp;) [with DefVisitor = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]'<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:629: instantiated from <code>boost::python::class_&lt;T, X1, X2, X3&gt;::class_(const char*, const char*) \[with W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]' pyBoost.cpp:48: instantiated from here ../DCDEventLayer/boost/include/boost/python/detail/is_wrapper.hpp:25: error: \</code>boost::python::wrapper&lt;Observer&gt;' is an inaccessible base of `PyObserver'<br />
../DCDEventLayer/boost/include/boost/python/class.hpp: In member function <code>void boost::python::class_&lt;T, X1, X2, X3&gt;::def\_maybe\_overloads(const char*, Fn, const A1&amp;, ...) \[with Fn = boost::python::api::object, A1 = const char*, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]': ../DCDEventLayer/boost/include/boost/python/class.hpp:244: instantiated from</code>boost::python::class_&lt;T, X1, X2, X3&gt;&amp; boost::python::class_&lt;T, X1, X2, X3&gt;::def(const char*, A1, const A2&amp;) [with A1 = boost::python::api::object, A2 = const char*, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]'<br />
../DCDEventLayer/boost/include/boost/python/init.hpp:330: instantiated from <code>void boost::python::detail::def\_init\_aux(ClassT&amp;, const Signature&amp;, NArgs, const CallPoliciesT&amp;, const char*, const boost::python::detail::keyword\_range&amp;) \[with ClassT = boost::python::class\_&lt;PyObserver, boost::noncopyable, boost::python::detail::not\_specified, boost::python::detail::not\_specified&gt;, CallPoliciesT = boost::python::default\_call\_policies, Signature = boost::mpl::vector0&lt;mpl_::na&gt;, NArgs = boost::mpl::size&lt;boost::mpl::vector0&lt;mpl_::na&gt; &gt;\]' ../DCDEventLayer/boost/include/boost/python/init.hpp:399: instantiated from</code>static void boost::python::detail::define_class_init_helper&lt;0&gt;::apply(ClassT&amp;, const CallPoliciesT&amp;, const Signature&amp;, NArgs, const char*, const boost::python::detail::keyword_range&amp;) [with ClassT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not_specified, boost::python::detail::not_specified&gt;, CallPoliciesT = boost::python::default_call_policies, Signature = boost::mpl::vector0&lt;mpl_::na&gt;, NArgs = boost::mpl::size&lt;boost::mpl::vector0&lt;mpl_::na&gt; &gt;]'<br />
../DCDEventLayer/boost/include/boost/python/init.hpp:171: instantiated from <code>void boost::python::init\_base&lt;DerivedT&gt;::visit(classT&amp;) const \[with classT = boost::python::class\_&lt;PyObserver, boost::noncopyable, boost::python::detail::not\_specified, boost::python::detail::not\_specified&gt;, DerivedT = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;\]' ../DCDEventLayer/boost/include/boost/python/def\_visitor.hpp:31: instantiated from</code>static void boost::python::def_visitor_access::visit(const V&amp;, classT&amp;) [with V = boost::python::def_visitor&lt;boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt; &gt;, classT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not_specified, boost::python::detail::not_specified&gt;]'<br />
../DCDEventLayer/boost/include/boost/python/def_visitor.hpp:67: instantiated from <code>void boost::python::def\_visitor&lt;DerivedVisitor&gt;::visit(classT&amp;) const \[with classT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not\_specified, boost::python::detail::not\_specified&gt;, DerivedVisitor = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;\]' ../DCDEventLayer/boost/include/boost/python/class.hpp:225: instantiated from</code>boost::python::class_&lt;T, X1, X2, X3&gt;&amp; boost::python::class_&lt;T, X1, X2, X3&gt;::def(const boost::python::def_visitor&lt;Derived&gt;&amp;) [with Derived = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]'<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:501: instantiated from <code>void boost::python::class_&lt;T, X1, X2, X3&gt;::initialize(const DefVisitor&amp;) \[with DefVisitor = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]' ../DCDEventLayer/boost/include/boost/python/class.hpp:629: instantiated from</code>boost::python::class_&lt;T, X1, X2, X3&gt;::class_(const char*, const char*) [with W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]'<br />
pyBoost.cpp:48: instantiated from here<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:608: error: `boost::python::wrapper&lt;Observer&gt;' is an inaccessible base of `PyObserver'<br />
../DCDEventLayer/boost/include/boost/python/object/value_holder.hpp: In constructor <code>boost::python::objects::value\_holder&lt;Value&gt;::value_holder(PyObject*) \[with Value = PyObserver\]': ../DCDEventLayer/boost/include/boost/python/object/make\_holder.hpp:83: instantiated from</code>static void boost::python::objects::make_holder&lt;0&gt;::apply&lt;Holder, ArgList&gt;::execute(PyObject*) [with Holder = boost::python::objects::value_holder&lt;PyObserver&gt;, ArgList = boost::mpl::vector0&lt;mpl_::na&gt;]'<br />
../DCDEventLayer/boost/include/boost/python/detail/make_keyword_range_fn.hpp:60: instantiated from <code>boost::python::api::object boost::python::detail::make\_keyword\_range\_constructor(const CallPolicies&amp;, const boost::python::detail::keyword\_range&amp;, Holder*, ArgList*, Arity*) \[with ArgList = boost::mpl::vector0&lt;mpl\_::na&gt;, Arity = boost::mpl::size&lt;boost::mpl::vector0&lt;mpl_::na&gt; &gt;, Holder = boost::python::objects::value\_holder&lt;PyObserver&gt;, CallPolicies = boost::python::default\_call_policies\]' ../DCDEventLayer/boost/include/boost/python/init.hpp:330: instantiated from</code>void boost::python::detail::def_init_aux(ClassT&amp;, const Signature&amp;, NArgs, const CallPoliciesT&amp;, const char*, const boost::python::detail::keyword_range&amp;) [with ClassT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not_specified, boost::python::detail::not_specified&gt;, CallPoliciesT = boost::python::default_call_policies, Signature = boost::mpl::vector0&lt;mpl_::na&gt;, NArgs = boost::mpl::size&lt;boost::mpl::vector0&lt;mpl_::na&gt; &gt;]'<br />
../DCDEventLayer/boost/include/boost/python/init.hpp:399: instantiated from <code>static void boost::python::detail::define\_class\_init\_helper&lt;0&gt;::apply(ClassT&amp;, const CallPoliciesT&amp;, const Signature&amp;, NArgs, const char*, const boost::python::detail::keyword\_range&amp;) \[with ClassT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not\_specified, boost::python::detail::not\_specified&gt;, CallPoliciesT = boost::python::default\_call\_policies, Signature = boost::mpl::vector0&lt;mpl_::na&gt;, NArgs = boost::mpl::size&lt;boost::mpl::vector0&lt;mpl_::na&gt; &gt;\]' ../DCDEventLayer/boost/include/boost/python/init.hpp:171: instantiated from</code>void boost::python::init_base&lt;DerivedT&gt;::visit(classT&amp;) const [with classT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not_specified, boost::python::detail::not_specified&gt;, DerivedT = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;]'<br />
../DCDEventLayer/boost/include/boost/python/def_visitor.hpp:31: instantiated from <code>static void boost::python::def\_visitor\_access::visit(const V&amp;, classT&amp;) \[with V = boost::python::def\_visitor&lt;boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt; &gt;, classT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not\_specified, boost::python::detail::not\_specified&gt;\]' ../DCDEventLayer/boost/include/boost/python/def\_visitor.hpp:67: instantiated from</code>void boost::python::def_visitor&lt;DerivedVisitor&gt;::visit(classT&amp;) const [with classT = boost::python::class_&lt;PyObserver, boost::noncopyable, boost::python::detail::not_specified, boost::python::detail::not_specified&gt;, DerivedVisitor = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;]'<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:225: instantiated from <code>boost::python::class_&lt;T, X1, X2, X3&gt;&amp; boost::python::class_&lt;T, X1, X2, X3&gt;::def(const boost::python::def\_visitor&lt;Derived&gt;&amp;) \[with Derived = boost::python::init&lt;mpl\_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]' ../DCDEventLayer/boost/include/boost/python/class.hpp:501: instantiated from</code>void boost::python::class_&lt;T, X1, X2, X3&gt;::initialize(const DefVisitor&amp;) [with DefVisitor = boost::python::init&lt;mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_&gt;, W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]'<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:629: instantiated from <code>boost::python::class_&lt;T, X1, X2, X3&gt;::class_(const char*, const char*) \[with W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]' pyBoost.cpp:48: instantiated from here ../DCDEventLayer/boost/include/boost/python/object/value\_holder.hpp:136: error: \</code>boost::python::detail::wrapper_base' is an inaccessible base of `PyObserver'<br />
make: *** [pyBoost.o] Error 1</p>
<p>Zwei drei kleinere Fehler hatte ich auch im source, aber diese Meldung kommt von der Definition im BOOST_PYTHON_MODULE_INIT.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1258572</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1258572</guid><dc:creator><![CDATA[tyr377]]></dc:creator><pubDate>Tue, 03 Apr 2007 12:30:00 GMT</pubDate></item><item><title><![CDATA[Reply to boost::python + observer pattern on Tue, 03 Apr 2007 12:33:43 GMT]]></title><description><![CDATA[<p>tyr377 schrieb:</p>
<blockquote>
<p>g++ -I../DCDEventLayer/boost/include/ -I/usr/include/python2.3 -c -o pyBoost.o pyBoost.cpp<br />
../DCDEventLayer/boost/include/boost/python/class.hpp: In constructor <code>boost::python::class_&lt;T, X1, X2, X3&gt;::id\_vector::id\_vector() \[with W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not\_specified, X3 = boost::python::detail::not\_specified\]': ../DCDEventLayer/boost/include/boost/python/class.hpp:628: instantiated from</code>boost::python::class_&lt;T, X1, X2, X3&gt;::class_(const char*, const char*) [with W = PyObserver, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]'<br />
pyBoost.cpp:48: instantiated from here<br />
../DCDEventLayer/boost/include/boost/python/class.hpp:179: error: `boost::python::wrapper&lt;Observer&gt;' is an inaccessible base of `PyObserver'</p>
</blockquote>
<p>Da fehlt anscheindend ein 'public' vor dem 'wrapper&lt;Observer&gt;' (Default-Ableitung ist 'private' - und die erlaubt keine implizite Typumwandlung).</p>
<p>Kleiner Tip: Wenn's die Übersicht stört, kannst du die ganzen &quot;instanciated from&quot;-Zeilen auch überlesen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1258575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1258575</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 03 Apr 2007 12:33:43 GMT</pubDate></item><item><title><![CDATA[Reply to boost::python + observer pattern on Tue, 03 Apr 2007 12:53:51 GMT]]></title><description><![CDATA[<p>Ich geb zu, die Ausgabe hat mich erschlagen. Aber du hast recht. nun macht er's. vielen Dank, du hast meinen Tag gerettet. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1258594</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1258594</guid><dc:creator><![CDATA[tyr377]]></dc:creator><pubDate>Tue, 03 Apr 2007 12:53:51 GMT</pubDate></item></channel></rss>