<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Tutorial</title><link>https://sourceforge.net/p/wallaroolib/wiki/Tutorial/</link><description>Recent changes to Tutorial</description><atom:link href="https://sourceforge.net/p/wallaroolib/wiki/Tutorial/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 01 Apr 2015 14:57:33 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/wallaroolib/wiki/Tutorial/feed" rel="self" type="application/rss+xml"/><item><title>Discussion for Tutorial page</title><link>https://sourceforge.net/p/wallaroolib/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Originally posted by: &lt;a class="" href="http://code.google.com/u/116451853037125231743" rel="nofollow"&gt;daniele....@gmail.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Dario, thanks for your comment: I agree with you. However, I think the tutorial is not actually wrong: In my introduction I just quoted wikipedia. Sadly, the "Dependency Injection" entry in wikipedia says DI is particularly useful for providing "mock" test implementations of complex components. Altough you can use DI for that pourpose, I believe its real advantage is to create an "Object Oriented Structure" (as defined &lt;a class="" href="http://www.carlopescio.com/2012/12/ask-not-what-object-is-but.html" rel="nofollow"&gt;here&lt;/a&gt;). As you can see in the samples contained in wallaroo, I use DI to get "real extensibility" and not to provide mock tests ;-) &lt;/p&gt;
&lt;p&gt;Anyway. Soon, wallaroo will move to release 1.0. I think this is a good time to improve the wiki pages of the project. In particular, I'd like to add some pages about DI theory and its usage in real projects. &lt;/p&gt;
&lt;p&gt;Thanks for your contribute. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 01 Apr 2015 14:57:33 -0000</pubDate><guid>https://sourceforge.net089c8045a3f7e0d6d14d139626dc377ba0118e00</guid></item><item><title>Discussion for Tutorial page</title><link>https://sourceforge.net/p/wallaroolib/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Originally posted by: &lt;a class="" href="http://code.google.com/u/112413376384851087745" rel="nofollow"&gt;oliverid...@gmail.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The tutorial is a bit wrong, DI allows to easy setup mocks yes, but main advantage is too keep Object graph simple and to allow to easily change your application wihtou having to touch zillion files and recompile everything. &lt;/p&gt;
&lt;p&gt;Also it allow to think in a little different way: If i need something I'll just inject it, without the need to create exotic stuff like "context structs/singletons/service locators" wich are all anti-patterns. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 01 Apr 2015 14:57:33 -0000</pubDate><guid>https://sourceforge.netcbd4800ca2ecfc89f49cb00c62dada423afa9ee5</guid></item><item><title>Discussion for Tutorial page</title><link>https://sourceforge.net/p/wallaroolib/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Originally posted by: &lt;a class="" href="http://code.google.com/u/116451853037125231743" rel="nofollow"&gt;daniele....@gmail.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Fabien, you're absolutely right. &lt;/p&gt;
&lt;p&gt;Actually, the current activity on wallaroo is precisely to define a mechanism to remove the constraint of the 2 parameters constructor. I think that once removed this limit, wallaroo can finally move to version 1.0 :-) &lt;/p&gt;
&lt;p&gt;The solution you propose is straightforward. I created &lt;a class="" href="https://code.google.com/p/wallaroo/wiki/CtorParameters" rel="nofollow"&gt;this wiki page&lt;/a&gt; with some notes and comments about the problem and a couple of possible solutions. I'd be glad if you can have a look and maybe comment the solutions. &lt;/p&gt;
&lt;p&gt;Thank you very much for your contribute. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 01 Apr 2015 14:57:33 -0000</pubDate><guid>https://sourceforge.netdb4042ab51b06a292ce1e2843628115521e3ee75</guid></item><item><title>Discussion for Tutorial page</title><link>https://sourceforge.net/p/wallaroolib/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Originally posted by: &lt;a class="" href="http://code.google.com/u/105171042695370489777" rel="nofollow"&gt;fabien.c...@gmail.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I dont understand the reason of 2 parameters only ... Since wallaroo is intrusive and uses boost for file config loading, the client objects could be constrained to have a kind of map&amp;lt;string, boost::any&amp;gt; as single param in the contructor. &lt;/p&gt;
&lt;p&gt;So, instead of &lt;/p&gt;
&lt;p&gt;&amp;lt;code language="xml"&amp;gt; &amp;lt;device&amp;gt; &amp;lt;name&amp;gt;ferrari_f430&amp;lt;/name&amp;gt; &amp;lt;class&amp;gt;Car&amp;lt;/class&amp;gt; &amp;lt;parameter1&amp;gt; &amp;lt;type&amp;gt;string&amp;lt;/type&amp;gt; &amp;lt;value&amp;gt;red&amp;lt;/value&amp;gt; &amp;lt;/parameter1&amp;gt; &amp;lt;/device&amp;gt; &amp;lt;/code&amp;gt;&lt;/p&gt;
&lt;p&gt;one could write : &lt;/p&gt;
&lt;p&gt;&amp;lt;code language="xml"&amp;gt; &amp;lt;device&amp;gt; &amp;lt;name&amp;gt;ferrari_f430&amp;lt;/name&amp;gt; &amp;lt;class&amp;gt;Car&amp;lt;/class&amp;gt; &amp;lt;parameter&amp;gt; &amp;lt;name&amp;gt;color&amp;lt;/name&amp;gt; &amp;lt;type&amp;gt;string&amp;lt;/type&amp;gt; &amp;lt;value&amp;gt;red&amp;lt;/value&amp;gt; &amp;lt;/parameter&amp;gt; &amp;lt;/device&amp;gt; &amp;lt;/code&amp;gt;&lt;/p&gt;
&lt;p&gt;What do you think ? &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 01 Apr 2015 14:57:33 -0000</pubDate><guid>https://sourceforge.net3c3a78b6f27fae3b0ab5249aae740ee0eb7a85e8</guid></item><item><title>Discussion for Tutorial page</title><link>https://sourceforge.net/p/wallaroolib/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Originally posted by: &lt;a class="" href="http://code.google.com/u/116451853037125231743" rel="nofollow"&gt;daniele....@gmail.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;TwoLevelSumpProbe&lt;/code&gt; and &lt;code&gt;SafeEngine&lt;/code&gt; are the concrete implementations of &lt;code&gt;SumpProbe&lt;/code&gt; and &lt;code&gt;PumpEngine&lt;/code&gt;, respectively. In the tutorial I've not shown the implementation code of these two classes because the focus was on the wiring part. &lt;/p&gt;
&lt;p&gt;However, if you want a detailed explanation of this example, you can have a look at &lt;a class="" href="http://www.carlopescio.com/2012/03/life-without-controller-case-1.html" rel="nofollow"&gt;this article&lt;/a&gt; and the implementation you can find in the wallaroo mineplant sample. &lt;/p&gt;
&lt;p&gt;Anyway, I'm going to add some explanation in the tutorial. &lt;/p&gt;
&lt;p&gt;Thanks for pointing this out. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 01 Apr 2015 14:57:33 -0000</pubDate><guid>https://sourceforge.netaaab56ecbd562595b36bb9900e6a827b567db67f</guid></item><item><title>Discussion for Tutorial page</title><link>https://sourceforge.net/p/wallaroolib/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Originally posted by: &lt;a class="" href="http://code.google.com/u/107306155064153900777" rel="nofollow"&gt;ton...@gmail.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Where does TwoLevelSumpProbe&lt;a class="" href="/p/wallaroo/w/edit/TwoLevelSumpProbe"&gt;?&lt;/a&gt; come from? &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 01 Apr 2015 14:57:33 -0000</pubDate><guid>https://sourceforge.net53ef1790b5ff2d4d9936f41e9a449761ad15a5e3</guid></item><item><title>Tutorial modified by Anonymous</title><link>https://sourceforge.net/p/wallaroolib/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;How to start simplify your (developer) life with Wallaroo.&lt;/em&gt;&lt;/p&gt;
&lt;h1 id="wallaroo-tutorial"&gt;Wallaroo Tutorial&lt;/h1&gt;
&lt;p&gt;From &lt;a class="" href="http://en.wikipedia.org/wiki/Dependency_injection" rel="nofollow"&gt;wikipedia&lt;/a&gt;: &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The primary purpose of the dependency injection pattern is to allow selection among multiple implementations of a given dependency interface at runtime, or via configuration files, instead of at compile time. The pattern is particularly useful for providing "mock" test implementations of complex components when testing; but is often used for locating plugin components, or locating and initializing software services. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="motivation"&gt;Motivation&lt;/h2&gt;
&lt;p&gt;Let's say you're coding a beautiful application that &lt;a class="" href="http://www.carlopescio.com/2012/03/life-without-controller-case-1.html" rel="nofollow"&gt;controls a sump pump&lt;/a&gt;: &lt;/p&gt;
&lt;p&gt;After a careful design phase (see &lt;a class="" href="http://www.carlopescio.com/2012/03/life-without-controller-case-1.html" rel="nofollow"&gt;this blog post&lt;/a&gt; to have an accurate description of this phase), you come up with a &lt;code&gt;SumpPump&lt;/code&gt; class: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;SumpPump&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;public:&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;Drain&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;probe&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;MustDrain&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;On&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
      &lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Off&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nl"&gt;private:&lt;/span&gt;
  &lt;span class="n"&gt;PumpEngine&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;SumpProbe&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;probe&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let's say you now have a new requirement: &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;to prevent explosions, the pump must not be operated when methane is above a certain level. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;No problem: you're using OO. You can subclass &lt;code&gt;PumpEngine&lt;/code&gt; and change the code this way: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;SafeEngine&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="n"&gt;PumpEngine&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;public:&lt;/span&gt;
  &lt;span class="n"&gt;virtual&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;On&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="n"&gt;sensor&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;IsCritical&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="n"&gt;PumpEngine&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;On&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nl"&gt;private:&lt;/span&gt;
  &lt;span class="n"&gt;GasSensor&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;sensor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;SumpPump&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;public:&lt;/span&gt;
  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;Drain&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;probe&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;MustDrain&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;On&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
      &lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Off&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nl"&gt;private:&lt;/span&gt;
  &lt;span class="n"&gt;PumpEngine&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;SumpProbe&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;probe&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;However, somewhere in the code, you must tell the class &lt;code&gt;SumpPump&lt;/code&gt; to create an instance of &lt;code&gt;SafeEngine&lt;/code&gt; instead of &lt;code&gt;PumpEngine&lt;/code&gt;. There are two solutions: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;you can create the right instance in &lt;code&gt;SumpPump&lt;/code&gt; constructor &lt;/li&gt;
&lt;li&gt;
&lt;p&gt;you can pass the instance of &lt;code&gt;SafeEngine&lt;/code&gt; as parameter in &lt;code&gt;SumpPump&lt;/code&gt; constructor &lt;br /&gt;
The two alternatives are shown below: &lt;/p&gt;
&lt;p&gt;class SumpPump&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  SumpPump( GasSensor* sensor )&lt;br /&gt;
  {&lt;br /&gt;
    // engine = new PumpEngine();&lt;br /&gt;
    engine = new SafeEngine( sensor );&lt;br /&gt;
    probe = new SumpProbe();&lt;br /&gt;
  }&lt;br /&gt;
...&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;class SumpPump&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  SumpPump( PumpEngine&lt;em&gt; pe, SumpProbe&lt;/em&gt; sp ) :&lt;br /&gt;
    engine( pe ),&lt;br /&gt;
    probe( sp )&lt;br /&gt;
  {&lt;br /&gt;
  }&lt;br /&gt;
...&lt;br /&gt;
};&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both the solutions have problems. &lt;/p&gt;
&lt;p&gt;In the first, you have to modify the code of &lt;code&gt;SumpPump&lt;/code&gt; if you want to use a different engine. Besides, you need to provide the &lt;code&gt;SafeEngine&lt;/code&gt; constructor parameters to &lt;code&gt;SumpPump&lt;/code&gt; constructor (and so, you have to modify also the code that creates SumpPump instances). &lt;/p&gt;
&lt;p&gt;The second solution is better: you don't change &lt;code&gt;SumpPump&lt;/code&gt; code, yet you can't swap the behaviour without recompiling your application. &lt;/p&gt;
&lt;h2 id="enter-wallaroo"&gt;Enter Wallaroo&lt;/h2&gt;
&lt;p&gt;Instead, I really would like to be able to change the type of the classes withouth modifying them and withouth propagate dependencies in the whole class tree. &lt;/p&gt;
&lt;p&gt;Let's say I want the freedom to choose late the concrete classes of &lt;code&gt;probe&lt;/code&gt; and &lt;code&gt;engine&lt;/code&gt; dependencies in &lt;code&gt;SumpPump&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;Using Wallaroo we can write the classes this way: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c1"&gt;// sumppump.h&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="n"&gt;SumpPump&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="n"&gt;Part&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;public:&lt;/span&gt;
  &lt;span class="n"&gt;SumpPump&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;virtual&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="n"&gt;Drain&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nl"&gt;private:&lt;/span&gt;
  &lt;span class="n"&gt;Collaborator&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;SumpProbe&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;probe&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;Collaborator&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;PumpEngine&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;and &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c1"&gt;// sumppump.cpp&lt;/span&gt;

&lt;span class="no"&gt;WALLAROO_REGISTER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;SumpPump&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;SumpPump&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;SumpPump&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;
  &lt;span class="n"&gt;probe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"probe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;RegistrationToken&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"engine"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;RegistrationToken&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="n"&gt;SumpPump&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Drain&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;probe&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;MustDrain&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;On&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Off&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, let's say I want to use &lt;code&gt;TwoLevelSumpProbe&lt;/code&gt; and &lt;code&gt;SafeEngine&lt;/code&gt; as concrete classes of &lt;code&gt;probe&lt;/code&gt; and &lt;code&gt;engine&lt;/code&gt;, respectively. &lt;/p&gt;
&lt;p&gt;Now, the wiring becomes a piece of cake: it can be performed with a DSL in the main (or wherever you want): &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;Catalog&lt;/span&gt; &lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"twoLevelsProbe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"TwoLevelSumpProbe"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"safeEngine"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"SafeEngine"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"pump"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"SumpPump"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;wallaroo_within&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;catalog&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"twoLevelsProbe"&lt;/span&gt; &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;as&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"probe"&lt;/span&gt; &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"pump"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"safeEngine"&lt;/span&gt; &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;as&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"engine"&lt;/span&gt; &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"pump"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Otherwise, you can decide to get the objects and perform the wiring loading a configuration file. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;Catalog&lt;/span&gt; &lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;XmlConfiguration&lt;/span&gt; &lt;span class="nf"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"wiring.xml"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;catalog&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CheckWiring&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// throws a WiringError exception if any collaborator is missed&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;the &lt;code&gt;xml&lt;/code&gt; file should have this syntax (see &lt;a class="" href="../WiringFiles"&gt;here&lt;/a&gt; for a detailed description): &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;wallaroo&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;parts&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;part&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;twoLevelsProbe&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt;TwoLevelSumpProbe&lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/part&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;part&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;safeEngine&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt;SafeEngine&lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/part&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;part&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;pump&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt;SumpPump&lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/part&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/parts&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;wiring&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;wire&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;source&amp;gt;&lt;/span&gt;pump&lt;span class="nt"&gt;&amp;lt;/source&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;dest&amp;gt;&lt;/span&gt;twoLevelsProbe&lt;span class="nt"&gt;&amp;lt;/dest&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;collaborator&amp;gt;&lt;/span&gt;probe&lt;span class="nt"&gt;&amp;lt;/collaborator&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/wire&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;wire&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;source&amp;gt;&lt;/span&gt;pump&lt;span class="nt"&gt;&amp;lt;/source&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;dest&amp;gt;&lt;/span&gt;safeEngine&lt;span class="nt"&gt;&amp;lt;/dest&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;collaborator&amp;gt;&lt;/span&gt;engine&lt;span class="nt"&gt;&amp;lt;/collaborator&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/wire&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/wiring&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/wallaroo&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can also decide to put your classes in shared libraries. Let's say you wanna put &lt;code&gt;SafeEngine&lt;/code&gt; class in a .dll or .so. You just substitute the macro &lt;code&gt;WALLAROO_REGISTER&lt;/code&gt; with &lt;code&gt;WALLAROO_DYNLIB_REGISTER&lt;/code&gt; in this way: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c1"&gt;// safeengine.cpp&lt;/span&gt;

&lt;span class="p"&gt;#&lt;/span&gt;&lt;span class="k"&gt;include&lt;/span&gt; &lt;span class="s"&gt;"pumpengine.h"&lt;/span&gt;
&lt;span class="p"&gt;#&lt;/span&gt;&lt;span class="k"&gt;include&lt;/span&gt; &lt;span class="s"&gt;"wallaroo/dynamic_lib.h"&lt;/span&gt; &lt;span class="c1"&gt;// once per library&lt;/span&gt;
&lt;span class="p"&gt;#&lt;/span&gt;&lt;span class="k"&gt;include&lt;/span&gt; &lt;span class="s"&gt;"wallaroo/dyn_registered.h"&lt;/span&gt; &lt;span class="c1"&gt;// once per translation unit&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="n"&gt;SafeEngine&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="n"&gt;PumpEngine&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;public:&lt;/span&gt;
  &lt;span class="k"&gt;virtual&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="n"&gt;On&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="n"&gt;sensor&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;IsCritical&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="n"&gt;PumpEngine&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;On&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nl"&gt;private:&lt;/span&gt;
  &lt;span class="n"&gt;Collaborator&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;GasSensor&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;sensor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="no"&gt;WALLAROO_DYNLIB_REGISTER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;SafeEngine&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, you should load the shared library before create your objects: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;Plugin&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"safeengine"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;Plugin&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Suffix&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// load classes in shared libraries.&lt;/span&gt;
&lt;span class="c1"&gt;// Plugin::Suffix() expands to .dll or .so according to the OS&lt;/span&gt;
&lt;span class="n"&gt;Catalog&lt;/span&gt; &lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;XmlConfiguration&lt;/span&gt; &lt;span class="nf"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"wiring.xml"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;catalog&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CheckWiring&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// throws a WiringError exception if any collaborator is missing&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The shared library can also be specified in the xml configuration file: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;wallaroo&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;plugins&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;shared&amp;gt;&lt;/span&gt;safeengine&lt;span class="nt"&gt;&amp;lt;/shared&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/plugins&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;parts&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;part&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;twoLevelsProbe&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt;TwoLevelSumpProbe&lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/part&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;part&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;safeEngine&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt;SafeEngine&lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/part&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;part&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;pump&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt;SumpPump&lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/part&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/parts&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;wiring&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;wire&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;source&amp;gt;&lt;/span&gt;pump&lt;span class="nt"&gt;&amp;lt;/source&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;dest&amp;gt;&lt;/span&gt;twoLevelsProbe&lt;span class="nt"&gt;&amp;lt;/dest&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;collaborator&amp;gt;&lt;/span&gt;probe&lt;span class="nt"&gt;&amp;lt;/collaborator&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/wire&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;wire&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;source&amp;gt;&lt;/span&gt;pump&lt;span class="nt"&gt;&amp;lt;/source&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;dest&amp;gt;&lt;/span&gt;safeEngine&lt;span class="nt"&gt;&amp;lt;/dest&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;collaborator&amp;gt;&lt;/span&gt;engine&lt;span class="nt"&gt;&amp;lt;/collaborator&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/wire&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/wiring&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/wallaroo&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this case, you should load the shared libraries in this way: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;Catalog&lt;/span&gt; &lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;XmlConfiguration&lt;/span&gt; &lt;span class="nf"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"wiring.xml"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LoadPlugins&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// load the shared libraries specified in the configuration file&lt;/span&gt;
&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;catalog&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CheckWiring&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// throws a WiringError exception if any collaborator is missing&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Finally, you can get the entry point and start the main loop: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;shared_ptr&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;SumpPump&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;pump&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="s"&gt;"pump"&lt;/span&gt; &lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;pump&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Drain&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That's all. If you want, you can have a look at the wallaroo mineplant sample to see all the details about this example. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 01 Apr 2015 14:57:32 -0000</pubDate><guid>https://sourceforge.netda2c5ccd2f3c1cd8f9895cc3fa6c1e6822bbee4b</guid></item></channel></rss>