Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/Cacheable_threeNumbers.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/Cacheable_threeNumbers.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/Cacheable_threeNumbers.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,81 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2015 Frederik Heber. All rights reserved.
+ *
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Cacheable_threeNumbers.cpp
+ *
+ *  Created on: Jun 19, 2015
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "Cacheable_threeNumbers.hpp"
+
+#include <algorithm>
+
+#include "CodePatterns/Observer/Channels.hpp"
+
+void Cacheable_threeNumbers::setX(int _x)
+{
+  OBSERVE;
+  NOTIFY(XChanged);
+  x = _x;
+}
+
+void Cacheable_threeNumbers::setY(int _y)
+{
+  OBSERVE;
+  NOTIFY(YChanged);
+  y = _y;
+}
+
+void Cacheable_threeNumbers::setZ(int _z)
+{
+  OBSERVE;
+  NOTIFY(ZChanged);
+  z = _z;
+}
+
+int Cacheable_threeNumbers::calcSum() const
+{
+  hasRecalced = true;
+  return x+y+z;
+}
+
+Cacheable_threeNumbers::Cacheable_threeNumbers(
+    int _x,
+    int _y,
+    int _z,
+    Observable::channels_t channels) :
+  Observable(
+      "Cacheable_threeNumbers",
+      Observable::getChannelList(Cacheable_threeNumbers::NotificationType_MAX)),
+  x(_x),y(_y),z(_z),
+  sum(this,boost::bind(&Cacheable_threeNumbers::calcSum,this),"sum", channels),
+  hasRecalced(false)
+{}
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/Cacheable_threeNumbers.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/Cacheable_threeNumbers.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/Cacheable_threeNumbers.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,48 @@
+/*
+ * Cacheable_threeNumbers.hpp
+ *
+ *  Created on: Jun 19, 2015
+ *      Author: heber
+ */
+
+#ifndef CACHEABLETHREENUMBERS_HPP_
+#define CACHEABLETHREENUMBERS_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/Cacheable.hpp"
+#include "CodePatterns/Observer/Observable.hpp"
+#include "CodePatterns/Observer/Notification.hpp"
+
+class Cacheable_threeNumbers : public Observable {
+public:
+  int x;
+  int y;
+  int z;
+  Cacheable<int> sum;
+  mutable bool hasRecalced;
+
+  enum NotificationType {
+    XChanged,
+    YChanged,
+    ZChanged,
+    NotificationType_MAX
+  };
+
+  void setX(int _x);
+  void setY(int _y);
+  void setZ(int _z);
+
+  int calcSum() const;
+
+  Cacheable_threeNumbers(
+      int _x,
+      int _y,
+      int _z,
+      Observable::channels_t channels = Observable::channels_t());
+};
+
+#endif /* CACHEABLETHREENUMBERS_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CloneStub.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CloneStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CloneStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,42 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * CloneStub.cpp
+ *
+ *  Created on: Jan 4, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CloneStub.hpp"
+
+#include "CommonStub.hpp"
+
+/************ Prototype 1 *******************/
+
+template <>
+IPrototype* Prototype<teststubs::Aclass>::clone() const
+{
+  IPrototype *MyClone = new Prototype<teststubs::Aclass>();
+  MyClone->setcount(getcount());
+  return MyClone;
+}
+
+/************ Prototype 2 *******************/
+
+template <>
+IPrototype* Prototype<teststubs::Bclass>::clone() const
+{
+  IPrototype *MyClone = new Prototype<teststubs::Bclass>();
+  MyClone->setcount(getcount());
+  return MyClone;
+}
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CloneStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CloneStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CloneStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,69 @@
+/*
+ * CloneStub.hpp
+ *
+ *  Created on: Jan 4, 2011
+ *      Author: heber
+ */
+
+#ifndef CLONESTUB_HPP_
+#define CLONESTUB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/Clone.hpp"
+
+struct IPrototype
+{
+  virtual ~IPrototype() {};
+  virtual void count()=0;
+  virtual int getcount() const =0;
+  virtual void setcount(int const _counter)=0;
+};
+
+class CloneTest;
+class PrototypeFactoryStub;
+
+template <class T>
+class Prototype :
+  public IPrototype,
+  public Clone<IPrototype>
+{
+    /**
+     * Prototype Factory is friend because it needs to access protected cstor
+     * to instantiate prototypes.
+     */
+    friend class PrototypeFactoryStub;
+
+    /**
+     * Tests are friend such that it can access protected cstor.
+     */
+    friend class CloneTest;
+    friend class PrototypeFactoryTest;
+
+protected:
+    Prototype() {
+      member.setcount(0);
+    }
+    ~Prototype() {};
+
+public:
+    void count() {
+      member.count();
+    }
+    int getcount() const {
+      return member.getcount();
+    }
+    void setcount(int const _counter) {
+      member.setcount(_counter);
+    }
+
+    IPrototype* clone() const;
+private:
+    T member;
+};
+
+
+#endif /* CLONESTUB_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonNamedStub.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonNamedStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonNamedStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,39 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * CommonNamedStub.cpp
+ *
+ *  Created on: Jan 16, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CommonNamedStub.hpp"
+
+namespace teststubs {
+  INamedclass::~INamedclass() {};
+  INamedclass::INamedclass(const std::string &_name) :
+    name(_name)
+  {};
+
+  ANamedclass::ANamedclass() :
+    INamedclass("ANamedclass")
+  {};
+
+  ANamedclass::~ANamedclass() {};
+
+  BNamedclass::BNamedclass() :
+    INamedclass("BNamedclass")
+  {};
+
+  BNamedclass::~BNamedclass() {};
+};
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonNamedStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonNamedStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonNamedStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,50 @@
+/*
+ * CommonNamedStub.hpp
+ *
+ *  Created on: Jan 16, 2011
+ *      Author: heber
+ */
+
+#ifndef COMMONNAMEDSTUB_HPP_
+#define COMMONNAMEDSTUB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string>
+
+namespace teststubs {
+  class INamedclass
+  {
+  public:
+    INamedclass(const std::string &_name);
+    virtual ~INamedclass();
+
+    std::string getName() const {
+      return name;
+    }
+
+  private:
+    std::string name;
+  };
+
+  class ANamedclass :
+    public INamedclass
+  {
+  public:
+    ANamedclass();
+    ~ANamedclass();
+  };
+
+  class BNamedclass :
+    public INamedclass
+  {
+  public:
+    BNamedclass();
+    ~BNamedclass();
+  };
+};
+
+#endif /* COMMONNAMEDSTUB_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonParametersStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonParametersStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonParametersStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,18 @@
+/*
+ * CommonParametersStub.hpp
+ *
+ *  Created on: Jan 6, 2011
+ *      Author: heber
+ */
+
+#ifndef COMMONPARAMETERSSTUB_HPP_
+#define COMMONPARAMETERSSTUB_HPP_
+
+namespace teststubs {
+  struct classParameters
+  {
+    int counter;
+  };
+}
+
+#endif /* COMMONPARAMETERSSTUB_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonStub.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,61 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * CommonStub.cpp
+ *
+ *  Created on: Jan 4, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CommonStub.hpp"
+
+namespace teststubs {
+  Iclass::~Iclass() {};
+
+  Aclass::Aclass() :
+    counter(0)
+  {};
+
+  Aclass::~Aclass() {};
+
+  void Aclass::count() {
+    ++counter;
+  }
+
+  int Aclass::getcount() const {
+    return counter;
+  };
+
+  void Aclass::setcount(int const _counter) {
+    counter = _counter;
+  };
+
+
+  Bclass::Bclass() :
+    counter(0.)
+  {};
+
+  Bclass::~Bclass() {};
+
+  void Bclass::count() {
+    counter+=1.;
+  }
+
+  int Bclass::getcount() const {
+    return (int)counter;
+  };
+
+  void Bclass::setcount(int const _counter) {
+    counter = (double)_counter;
+  };
+};
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CommonStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,56 @@
+/*
+ * CommonStub.hpp
+ *
+ *  Created on: Jan 4, 2011
+ *      Author: heber
+ */
+
+#ifndef COMMONSTUB_HPP_
+#define COMMONSTUB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+namespace teststubs {
+  class Iclass
+  {
+  public:
+    virtual ~Iclass();
+
+    virtual void count() = 0;
+    virtual int getcount() const = 0;
+    virtual void setcount(int const _counter) = 0;
+  };
+
+  class Aclass :
+    public Iclass
+  {
+  public:
+    Aclass();
+    ~Aclass();
+
+    void count();
+    int getcount() const;
+    void setcount(int const _counter);
+
+    int counter;
+  };
+
+  class Bclass :
+    public Iclass
+  {
+  public:
+    Bclass();
+    ~Bclass();
+
+    void count();
+    int getcount() const;
+    void setcount(int const _counter);
+
+    double counter;
+  };
+};
+
+#endif /* COMMONSTUB_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CreatorStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CreatorStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/CreatorStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,50 @@
+/*
+ * CreatorStub.hpp
+ *
+ *  Created on: Jan 4, 2011
+ *      Author: heber
+ */
+
+#ifndef CREATORSTUB_HPP_
+#define CREATORSTUB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <typeinfo>
+
+#include "CodePatterns/Creator.hpp"
+
+class ICreatorStub {
+public:
+  virtual ~ICreatorStub() {};
+  virtual void count() = 0;
+  virtual int getcount() = 0;
+  virtual std::string name() = 0;
+};
+
+
+template <class T>
+class CreatorStub : public ICreatorStub, public Creator<ICreatorStub, CreatorStub<T> >
+{
+public:
+  CreatorStub() {};
+  virtual ~CreatorStub() {};
+
+  virtual void count() {
+    member.counter++;
+  }
+  virtual int getcount() {
+    return member.counter;
+  }
+  virtual std::string name() {
+    return std::string(typeid(T).name());
+  }
+private:
+  T member;
+};
+
+
+#endif /* CREATORSTUB_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,36 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * FactoryStub.cpp
+ *
+ *  Created on: Jan 4, 2011
+   Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/Singleton_impl.hpp"
+
+#include "CommonStub.hpp"
+#include "FactoryStub.hpp"
+
+// has to be included BEFORE Factory_impl.hpp!
+#include "FactoryStub.def"
+#include "CodePatterns/Factory_impl.hpp"
+
+
+FactoryStub::FactoryStub() {}
+FactoryStub::~FactoryStub() {}
+
+CONSTRUCT_SINGLETON(FactoryStub)
+CONSTRUCT_FACTORY(ICreatorStub)
+
+#include "FactoryStub.undef"
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.def
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.def	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.def	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,9 @@
+#ifndef FACTORYSTUB_DEF_
+#define FACTORYSTUB_DEF_
+
+#define type_seq (Aclass)(Bclass)
+#define Abstract_Interface_Class ICreatorStub
+#define Abstract_Encapsulation_Class CreatorStub
+#define type_name_space teststubs::
+
+#endif //FACTORYSTUB_DEF_
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,39 @@
+/*
+ * FactoryStub.hpp
+ *
+ *  Created on: Jan 4, 2011
+   Author: heber
+ */
+
+#ifndef FACTORYSTUB_HPP_
+#define FACTORYSTUB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CreatorStub.hpp"
+
+// triple has to be appear BEFORE Factory.hpp is included!
+#include "FactoryStub.def"
+#include "CodePatterns/FactoryTypeList.hpp"
+#include "FactoryStub.undef"
+
+#include "CodePatterns/Factory.hpp"
+
+#include "CodePatterns/Singleton.hpp"
+
+class FactoryStub :
+  public Singleton<FactoryStub>,
+  public Factory<ICreatorStub>
+{
+  friend class Singleton<FactoryStub>;
+  friend class FactoryTest;
+
+protected:
+  FactoryStub();
+  virtual ~FactoryStub();
+};
+
+#endif /* FACTORYSTUB_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.undef
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.undef	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/FactoryStub.undef	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,10 @@
+#ifdef FACTORYSTUB_DEF_
+
+#undef type_seq
+#undef type_seq_size
+#undef Abstract_Interface_Class
+#undef Abstract_Encapsulation_Class
+#undef type_name_space
+
+#undef FACTORYSTUB_DEF_
+#endif
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulableCloneStub.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulableCloneStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulableCloneStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,58 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ManipulableCloneStub.cpp
+ *
+ *  Created on: Jan 6, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CommonStub.hpp"
+#include "CommonParametersStub.hpp"
+#include "ManipulableCloneStub.hpp"
+
+/************ Prototype 1 *******************/
+
+template <>
+IManipulablePrototype* ManipulablePrototype<teststubs::Aclass>::clone() const
+{
+  IManipulablePrototype *MyManipulableClone = new ManipulablePrototype<teststubs::Aclass>();
+  MyManipulableClone->setcount(getcount());
+  return MyManipulableClone;
+}
+
+template <>
+ManipulablePrototype<teststubs::Aclass>* ManipulablePrototype<teststubs::Aclass>::manipulatedclone(const teststubs::classParameters &_params) const
+{
+  ManipulablePrototype<teststubs::Aclass> *MyManipulableClone = new ManipulablePrototype<teststubs::Aclass>();
+  MyManipulableClone->setcount(_params.counter);
+  return MyManipulableClone;
+}
+
+/************ Prototype 2 *******************/
+
+template <>
+IManipulablePrototype* ManipulablePrototype<teststubs::Bclass>::clone() const
+{
+  IManipulablePrototype *MyManipulableClone = new ManipulablePrototype<teststubs::Bclass>();
+  MyManipulableClone->setcount(getcount());
+  return MyManipulableClone;
+}
+
+template <>
+ManipulablePrototype<teststubs::Bclass>* ManipulablePrototype<teststubs::Bclass>::manipulatedclone(const teststubs::classParameters &_params) const
+{
+  ManipulablePrototype<teststubs::Bclass> *MyManipulableClone = new ManipulablePrototype<teststubs::Bclass>();
+  MyManipulableClone->setcount(_params.counter);
+  return MyManipulableClone;
+}
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulableCloneStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulableCloneStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulableCloneStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,74 @@
+/*
+ * ManipulableCloneStub.hpp
+ *
+ *  Created on: Jan 6, 2011
+ *      Author: heber
+ */
+
+#ifndef MANIPULABLECLONESTUB_HPP_
+#define MANIPULABLECLONESTUB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/ManipulableClone.hpp"
+
+struct IManipulablePrototype
+{
+  virtual ~IManipulablePrototype() {};
+  virtual void count()=0;
+  virtual int getcount() const =0;
+  virtual void setcount(int const _counter)=0;
+};
+
+class ManipulableCloneTest;
+class ManipulablePrototypeFactoryStub;
+namespace teststubs {
+class classParameters;
+}
+
+template <class T>
+class ManipulablePrototype :
+  public IManipulablePrototype,
+  public ManipulableClone<IManipulablePrototype,teststubs::classParameters>
+{
+    /**
+     * Prototype Factory is friend because it needs to access protected cstor
+     * to instantiate prototypes.
+     */
+    friend class ManipulablePrototypeFactoryStub;
+
+    /**
+     * Tests are friend such that it can access protected cstor.
+     */
+    friend class ManipulableCloneTest;
+    friend class ManipulablePrototypeFactoryTest;
+
+protected:
+    ManipulablePrototype() {
+      member.setcount(0);
+    }
+    ~ManipulablePrototype() {};
+
+public:
+    void count() {
+      member.count();
+    }
+    int getcount() const {
+      return member.getcount();
+    }
+    void setcount(int const _counter) {
+      member.setcount(_counter);
+    }
+
+    IManipulablePrototype* clone() const;
+
+    ManipulablePrototype<T> * manipulatedclone(const teststubs::classParameters& _params) const;
+private:
+    T member;
+};
+
+
+#endif /* MANIPULABLECLONESTUB_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,42 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ManipulablePrototypeFactoryStub.cpp
+ *
+ *  Created on: Jan 6, 2011
+   Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/Singleton_impl.hpp"
+
+#include "CommonStub.hpp"
+#include "CommonParametersStub.hpp"
+#include "ManipulablePrototypeFactoryStub.hpp"
+
+// has to be included BEFORE ManipulablePrototypeFactory_impl.hpp!
+#include "ManipulablePrototypeFactoryStub.def"
+#include "CodePatterns/ManipulablePrototypeFactory_impl.hpp"
+
+
+ManipulablePrototypeFactoryStub::ManipulablePrototypeFactoryStub() {
+  FillPrototypeTable();
+}
+
+ManipulablePrototypeFactoryStub::~ManipulablePrototypeFactoryStub() {
+  EmptyPrototypeTable();
+}
+
+CONSTRUCT_SINGLETON(ManipulablePrototypeFactoryStub)
+CONSTRUCT_MANIPULABLEPROTOTYPEFACTORY(IManipulablePrototype, teststubs::classParameters)
+
+#include "ManipulablePrototypeFactoryStub.undef"
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.def
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.def	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.def	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,12 @@
+#ifndef MANIPULABLEPROTOTYPEFACTORYSTUB_DEF_
+#define MANIPULABLEPROTOTYPEFACTORYSTUB_DEF_
+
+#define type_seq (Aclass)(Bclass)
+#define FactoryNAME ManipulablePrototypeFactoryStub
+#define Abstract_Interface_Class IManipulablePrototype
+#define Abstract_Parameter_Class teststubs::classParameters
+#define Abstract_Encapsulation_Class ManipulablePrototype
+#define type_name_space teststubs::
+#undef type_suffix
+
+#endif //MANIPULABLEPROTOTYPEFACTORYSTUB_DEF_
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,44 @@
+/*
+ * ManipulablePrototypeFactoryStub.hpp
+ *
+ *  Created on: Jan 4, 2011
+   Author: heber
+ */
+
+#ifndef MANIPULABLEPROTOTYPEFACTORYSTUB_HPP_
+#define MANIPULABLEPROTOTYPEFACTORYSTUB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CommonStub.hpp"
+#include "CommonParametersStub.hpp"
+#include "ManipulableCloneStub.hpp"
+
+// triple has to be appear BEFORE ManipulablePrototypeFactory.hpp is included!
+#include "ManipulablePrototypeFactoryStub.def"
+#include "CodePatterns/FactoryTypeList.hpp"
+#include "ManipulablePrototypeFactoryStub.undef"
+
+#include "CodePatterns/ManipulablePrototypeFactory.hpp"
+
+#include "CodePatterns/Singleton.hpp"
+
+class ManipulablePrototypeFactoryStub :
+  public Singleton<ManipulablePrototypeFactoryStub>,
+  public ManipulablePrototypeFactory<IManipulablePrototype, teststubs::classParameters>
+{
+  friend class Singleton<ManipulablePrototypeFactoryStub>;
+  friend class ManipulablePrototypeFactoryTest;
+
+protected:
+  void FillPrototypeTable();
+  void EmptyPrototypeTable();
+
+  ManipulablePrototypeFactoryStub();
+  virtual ~ManipulablePrototypeFactoryStub();
+};
+
+#endif /* MANIPULABLEPROTOTYPEFACTORYSTUB_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.undef
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.undef	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ManipulablePrototypeFactoryStub.undef	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,12 @@
+#ifdef MANIPULABLEPROTOTYPEFACTORYSTUB_DEF_
+
+#undef type_seq
+#undef type_seq_size
+#undef FactoryNAME
+#undef Abstract_Interface_Class
+#undef Abstract_Parameter_Class
+#undef Abstract_Encapsulation_Class
+#undef type_name_space
+
+#undef MANIPULABLEPROTOTYPEFACTORYSTUB_DEF_
+#endif
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ObservedValue_threeNumbers.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ObservedValue_threeNumbers.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ObservedValue_threeNumbers.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,79 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2015 Frederik Heber. All rights reserved.
+ *
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * ObservedValue_threeNumbers.cpp
+ *
+ *  Created on: Jun 19, 2015
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "ObservedValue_threeNumbers.hpp"
+
+#include "CodePatterns/Observer/Channels.hpp"
+
+void ObservedValue_threeNumbers::setX(int _x)
+{
+  OBSERVE;
+  NOTIFY(XChanged);
+  x = _x;
+}
+
+void ObservedValue_threeNumbers::setY(int _y)
+{
+  OBSERVE;
+  NOTIFY(YChanged);
+  y = _y;
+}
+
+void ObservedValue_threeNumbers::setZ(int _z)
+{
+  OBSERVE;
+  NOTIFY(ZChanged);
+  z = _z;
+}
+
+int ObservedValue_threeNumbers::calcSum() const
+{
+  hasRecalced = true;
+  return x+y+z;
+}
+
+ObservedValue_threeNumbers::ObservedValue_threeNumbers(
+    int _x,
+    int _y,
+    int _z,
+    Observable::channels_t channels) :
+  Observable(
+      "ObservedValue_threeNumbers",
+      Observable::getChannelList(ObservedValue_threeNumbers::NotificationType_MAX)),
+  x(_x),y(_y),z(_z),
+  sum(this,boost::bind(&ObservedValue_threeNumbers::calcSum,this),"sum", calcSum(), channels),
+  hasRecalced(false)
+{}
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ObservedValue_threeNumbers.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ObservedValue_threeNumbers.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/ObservedValue_threeNumbers.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,48 @@
+/*
+ * ObservedValue_threeNumbers.hpp
+ *
+ *  Created on: Jun 19, 2015
+ *      Author: heber
+ */
+
+#ifndef OBSERVEDVALUETHREENUMBERS_HPP_
+#define OBSERVEDVALUETHREENUMBERS_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/ObservedValue.hpp"
+#include "CodePatterns/Observer/Observable.hpp"
+#include "CodePatterns/Observer/Notification.hpp"
+
+class ObservedValue_threeNumbers : public Observable {
+public:
+  int x;
+  int y;
+  int z;
+  ObservedValue<int> sum;
+  mutable bool hasRecalced;
+
+  enum NotificationType {
+    XChanged,
+    YChanged,
+    ZChanged,
+    NotificationType_MAX
+  };
+
+  void setX(int _x);
+  void setY(int _y);
+  void setZ(int _z);
+
+  int calcSum() const;
+
+  ObservedValue_threeNumbers(
+      int _x,
+      int _y,
+      int _z,
+      Observable::channels_t channels = Observable::channels_t());
+};
+
+#endif /* OBSERVEDVALUETHREENUMBERS_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,41 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * PrototypeFactoryStub.cpp
+ *
+ *  Created on: Jan 4, 2011
+   Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/Singleton_impl.hpp"
+
+#include "CommonStub.hpp"
+#include "PrototypeFactoryStub.hpp"
+
+// has to be included BEFORE PrototypeFactory_impl.hpp!
+#include "PrototypeFactoryStub.def"
+#include "CodePatterns/PrototypeFactory_impl.hpp"
+
+
+PrototypeFactoryStub::PrototypeFactoryStub() {
+  FillPrototypeTable();
+}
+
+PrototypeFactoryStub::~PrototypeFactoryStub() {
+  EmptyPrototypeTable();
+}
+
+CONSTRUCT_SINGLETON(PrototypeFactoryStub)
+CONSTRUCT_PROTOTYPEFACTORY(IPrototype)
+
+#include "PrototypeFactoryStub.undef"
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.def
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.def	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.def	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,11 @@
+#ifndef PROTOTYPEFACTORYSTUB_DEF_
+#define PROTOTYPEFACTORYSTUB_DEF_
+
+#define type_seq (Aclass)(Bclass)
+#define FactoryNAME PrototypeFactoryStub
+#define Abstract_Interface_Class IPrototype
+#define Abstract_Encapsulation_Class Prototype
+#define type_name_space teststubs::
+#undef type_suffix
+
+#endif //PROTOTYPEFACTORYSTUB_DEF_
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,42 @@
+/*
+ * PrototypeFactoryStub.hpp
+ *
+ *  Created on: Jan 4, 2011
+   Author: heber
+ */
+
+#ifndef PROTOTYPEFACTORYSTUB_HPP_
+#define PROTOTYPEFACTORYSTUB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CloneStub.hpp"
+
+// triple has to be appear BEFORE PrototypeFactory.hpp is included!
+#include "PrototypeFactoryStub.def"
+#include "CodePatterns/FactoryTypeList.hpp"
+#include "PrototypeFactoryStub.undef"
+
+#include "CodePatterns/PrototypeFactory.hpp"
+
+#include "CodePatterns/Singleton.hpp"
+
+class PrototypeFactoryStub :
+  public Singleton<PrototypeFactoryStub>,
+  public PrototypeFactory<IPrototype>
+{
+  friend class Singleton<PrototypeFactoryStub>;
+  friend class PrototypeFactoryTest;
+
+protected:
+  void FillPrototypeTable();
+  void EmptyPrototypeTable();
+
+  PrototypeFactoryStub();
+  virtual ~PrototypeFactoryStub();
+};
+
+#endif /* PROTOTYPEFACTORYSTUB_HPP_ */
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.undef
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.undef	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/PrototypeFactoryStub.undef	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,11 @@
+#ifdef PROTOTYPEFACTORYSTUB_DEF_
+
+#undef type_seq
+#undef type_seq_size
+#undef FactoryNAME
+#undef Abstract_Interface_Class
+#undef Abstract_Encapsulation_Class
+#undef type_name_space
+
+#undef PROTOTYPEFACTORYSTUB_DEF_
+#endif
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/RegistryStub.cpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/RegistryStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/RegistryStub.cpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,31 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * RegistryStub.cpp
+ *
+ *  Created on: Jan 16, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CommonNamedStub.hpp"
+#include "RegistryStub.hpp"
+
+#include "CodePatterns/Registry_impl.hpp"
+
+RegistryStub::RegistryStub()
+{}
+
+RegistryStub::~RegistryStub()
+{}
+
+CONSTRUCT_REGISTRY(teststubs::INamedclass)
Index: ThirdParty/CodePatterns/src/Patterns/unittests/stubs/RegistryStub.hpp
===================================================================
--- ThirdParty/CodePatterns/src/Patterns/unittests/stubs/RegistryStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
+++ ThirdParty/CodePatterns/src/Patterns/unittests/stubs/RegistryStub.hpp	(revision 41e8e2a5c8c564e7fcb9688c8fe826715131b8f5)
@@ -0,0 +1,22 @@
+/*
+ * RegistryStub.hpp
+ *
+ *  Created on: Jan 16, 2011
+ *      Author: heber
+ */
+
+#ifndef REGISTRYSTUB_HPP_
+#define REGISTRYSTUB_HPP_
+
+#include "CommonNamedStub.hpp"
+#include "CodePatterns/Registry.hpp"
+
+class RegistryStub : public Registry<teststubs::INamedclass>
+{
+public:
+
+  RegistryStub();
+  ~RegistryStub();
+};
+
+#endif /* REGISTRYSTUB_HPP_ */
