Index: src/Fragmentation/Automation/Operations/OperationQueue.cpp
===================================================================
--- src/Fragmentation/Automation/Operations/OperationQueue.cpp	(revision f45c08b2b3e2af3a790d950101ca23b93baa49cc)
+++ src/Fragmentation/Automation/Operations/OperationQueue.cpp	(revision f45c08b2b3e2af3a790d950101ca23b93baa49cc)
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+
+/*
+ * OperationQueue.cpp
+ *
+ *  Created on: Apr 24, 2012
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// boost asio needs specific operator new
+#include <boost/asio.hpp>
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include <boost/bind.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <string>
+
+#include "CodePatterns/Log.hpp"
+#include "CodePatterns/Observer/Observer.hpp"
+
+#include "Operations/AsyncOperation.hpp"
+#include "Operations/OperationQueue.hpp"
+#include "WorkerAddress.hpp"
+
+OperationQueue::OperationQueue_t::iterator OperationQueue::findOperation(AsyncOperation *op)
+{
+  OperationQueue_t::iterator iter =
+      std::find_if(queue.begin(), queue.end(),
+          boost::bind(&AsyncOp_ptr::get, boost::lambda::_1) == op);
+  return iter;
+}
+
+void OperationQueue::push_back(AsyncOperation *&op, const WorkerAddress &address)
+{
+  if (op != NULL) {
+    AsyncOp_ptr ptr(op); // this always prevents memory loss
+    queue.push_back( ptr );
+    op = NULL;
+    // only start operation when address is valid
+    if ((!address.host.empty()) && (!address.service.empty()))
+      (*ptr)(address.host, address.service);
+  } else {
+    ELOG(1, "Given operation pointer is NULL.");
+  }
+}
+
+void OperationQueue::remove(AsyncOperation *op, Observer *observer)
+{
+  if (op != NULL) {
+    OperationQueue_t::iterator iter = findOperation(op);
+    if (iter != queue.end()) {
+      // sign off and remove op
+      if (observer != NULL)
+        op->signOff(observer);
+      queue.erase(iter);
+    } else {
+      ELOG(1, "Could not find Operation " << op->getName() << " in operation's queue.");
+    }
+  } else {
+    ELOG(1, "Given operation pointer is NULL.");
+  }
+}
Index: src/Fragmentation/Automation/Operations/OperationQueue.hpp
===================================================================
--- src/Fragmentation/Automation/Operations/OperationQueue.hpp	(revision f45c08b2b3e2af3a790d950101ca23b93baa49cc)
+++ src/Fragmentation/Automation/Operations/OperationQueue.hpp	(revision f45c08b2b3e2af3a790d950101ca23b93baa49cc)
@@ -0,0 +1,65 @@
+/*
+ * OperationQueue.hpp
+ *
+ *  Created on: Apr 24, 2012
+ *      Author: heber
+ */
+
+#ifndef OPERATIONQUEUE_HPP_
+#define OPERATIONQUEUE_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/shared_ptr.hpp>
+#include <deque>
+
+class AsyncOperation;
+class Observer;
+class OperationQueueTest;
+class WorkerAddress;
+
+/** This class is a container for \ref AsyncOperation's that are kept as shared_ptr
+ * and removed when the operation is done.
+ */
+class OperationQueue
+{
+  //!> grant unit test access to private part
+  friend class OperationQueueTest;
+public:
+  typedef boost::shared_ptr<AsyncOperation> AsyncOp_ptr;
+
+  /** Add an operation to the internal queue and hand over memory responsibility to it,
+   * also the operation is run.
+   *
+   * @param op operation to add, is NULL on return.
+   */
+  void push_back(AsyncOperation *&op, const WorkerAddress &address);
+
+  /** Removes an operation from the queue.
+   *
+   * @param op operation to remove from queue
+   * @param observer observer to sign off from operation, NULL if none to sign off
+   */
+  void remove(AsyncOperation *op, Observer *observer);
+
+private:
+  //!> internal operation to send jobs to workers
+  typedef std::deque<AsyncOp_ptr> OperationQueue_t;
+
+  /** Tiny Helper function to find an operation inside FragmentScheduler::OperationQueue.
+   *
+   * @param op operation to remove from queue
+   * @return iterator to element or to OperationQueue.end()
+   */
+  OperationQueue_t::iterator findOperation(AsyncOperation *op);
+
+private:
+  //!> internal queue with operations
+  OperationQueue_t queue;
+};
+
+#endif /* OPERATIONQUEUE_HPP_ */
