Index: src/Filling/Predicates/FillPredicate.cpp
===================================================================
--- src/Filling/Predicates/FillPredicate.cpp	(revision 9c2cb38007f3f87ae0e49da9d30c337eac0660af)
+++ src/Filling/Predicates/FillPredicate.cpp	(revision 9c2cb38007f3f87ae0e49da9d30c337eac0660af)
@@ -0,0 +1,72 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * FillPredicate.cpp
+ *
+ *  Created on: Jan 19, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "FillPredicate.hpp"
+
+#include "FillPredicateBase.hpp"
+#include "FillPredicate_impl.hpp"
+
+/** Constructor for class FillPredicate.
+ *
+ * @param _impl implementation to wrap
+ */
+FillPredicate::FillPredicate(FillPredicate::impl_ptr _impl) :
+    impl(_impl)
+{}
+
+/** Copy Constructor for class FillPredicate.
+ *
+ */
+FillPredicate::FillPredicate(const FillPredicate &ptr) :
+    impl(ptr.getImpl())
+{}
+
+/** Destructor for class FillPredicate.
+ *
+ */
+FillPredicate::~FillPredicate()
+{}
+
+bool FillPredicate::operator()(const Node &n) const
+{
+  return impl->operator()(n);
+}
+
+FillPredicate::impl_ptr FillPredicate::getImpl() const {
+  return impl;
+}
+
+FillPredicate AlwaysFillPredicate()
+{
+  static FillPredicate::impl_ptr impl = FillPredicate::impl_ptr(new AlwaysFillPredicate_impl());
+  return FillPredicate(impl);
+}
+
+FillPredicate NeverFillPredicate()
+{
+  static FillPredicate::impl_ptr impl = FillPredicate::impl_ptr(new NeverFillPredicate_impl());
+  return FillPredicate(impl);
+}
+
+// allows arbitrary friendship, but only if implementation is known
+FillPredicate::impl_ptr getFillPredicateImpl(const FillPredicate &f){
+  return f.getImpl();
+}
Index: src/Filling/Predicates/FillPredicate.hpp
===================================================================
--- src/Filling/Predicates/FillPredicate.hpp	(revision 9c2cb38007f3f87ae0e49da9d30c337eac0660af)
+++ src/Filling/Predicates/FillPredicate.hpp	(revision 9c2cb38007f3f87ae0e49da9d30c337eac0660af)
@@ -0,0 +1,51 @@
+/*
+ * FillPredicate.hpp
+ *
+ *  Created on: Jan 16, 2012
+ *      Author: heber
+ */
+
+#ifndef FILLPREDICATE_HPP_
+#define FILLPREDICATE_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Filling/NodeTypes.hpp"
+
+#include <boost/shared_ptr.hpp>
+
+class FillPredicateBase;
+
+/** This class defines the interface for all derived classes.
+ *
+ * This is just a functor of a predicate function.
+ *
+ */
+class FillPredicate
+{
+public:
+  typedef boost::shared_ptr<FillPredicateBase> impl_ptr;
+  friend impl_ptr getFillPredicateImpl(const FillPredicate&);
+
+  FillPredicate(const FillPredicate &ptr);
+  FillPredicate(impl_ptr);
+  ~FillPredicate();
+  bool operator()(const Node &n) const;
+
+protected:
+  impl_ptr getImpl() const;
+
+private:
+  impl_ptr impl;
+};
+
+FillPredicate AlwaysFillPredicate();
+FillPredicate NeverFillPredicate();
+
+FillPredicate::impl_ptr getFillPredicateImpl(const FillPredicate &f);
+
+#endif /* FILLPREDICATE_HPP_ */
Index: src/Filling/Predicates/FillPredicateBase.hpp
===================================================================
--- src/Filling/Predicates/FillPredicateBase.hpp	(revision 9c2cb38007f3f87ae0e49da9d30c337eac0660af)
+++ src/Filling/Predicates/FillPredicateBase.hpp	(revision 9c2cb38007f3f87ae0e49da9d30c337eac0660af)
@@ -0,0 +1,31 @@
+/*
+ * FillPredicateBase.hpp
+ *
+ *  Created on: Jan 19, 2012
+ *      Author: heber
+ */
+
+#ifndef FILLPREDICATEBASE_HPP_
+#define FILLPREDICATEBASE_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Filling/NodeTypes.hpp"
+
+/** This class defines the interface for all derived classes.
+ *
+ * This is just a functor of a predicate function.
+ *
+ */
+struct FillPredicateBase
+{
+  FillPredicateBase(){};
+  virtual ~FillPredicateBase(){};
+  virtual bool operator()(const Node &n) const=0;
+};
+
+
+#endif /* FILLPREDICATEBASE_HPP_ */
Index: src/Filling/Predicates/FillPredicate_impl.hpp
===================================================================
--- src/Filling/Predicates/FillPredicate_impl.hpp	(revision 9c2cb38007f3f87ae0e49da9d30c337eac0660af)
+++ src/Filling/Predicates/FillPredicate_impl.hpp	(revision 9c2cb38007f3f87ae0e49da9d30c337eac0660af)
@@ -0,0 +1,33 @@
+/*
+ * FillPredicate_impl.hpp
+ *
+ *  Created on: Jan 19, 2012
+ *      Author: heber
+ */
+
+#ifndef FILLPREDICATE_IMPL_HPP_
+#define FILLPREDICATE_IMPL_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "FillPredicateBase.hpp"
+#include "types.hpp"
+
+class AlwaysFillPredicate_impl : public FillPredicateBase {
+public:
+  virtual bool operator()(const Node&n) const{
+    return true;
+  }
+};
+
+class NeverFillPredicate_impl : public FillPredicateBase {
+public:
+  virtual bool operator()(const Node&n) const{
+    return false;
+  }
+};
+
+#endif /* FILLPREDICATE_IMPL_HPP_ */
