Index: molecuilder/src/Descriptors/AtomDescriptor.cpp
===================================================================
--- molecuilder/src/Descriptors/AtomDescriptor.cpp	(revision 86b9172421385fb0be15c2d52e42bca451d0ba6e)
+++ molecuilder/src/Descriptors/AtomDescriptor.cpp	(revision 86b9172421385fb0be15c2d52e42bca451d0ba6e)
@@ -0,0 +1,54 @@
+/*
+ * AtomDescriptor.cpp
+ *
+ *  Created on: Feb 5, 2010
+ *      Author: crueger
+ */
+
+#include "AtomDescriptor.hpp"
+
+#include "World.hpp"
+
+#include <boost/bind.hpp>
+
+using namespace std;
+
+typedef map<int,atom*> atoms_t;
+typedef atoms_t::iterator atoms_iter_t;
+
+AtomDescriptor::AtomDescriptor()
+{
+}
+
+AtomDescriptor::~AtomDescriptor()
+{
+}
+
+
+atoms_t& AtomDescriptor::getAtoms(){
+  return World::get()->atoms;
+}
+
+AtomPredicateDescriptor::AtomPredicateDescriptor()
+{
+}
+
+AtomPredicateDescriptor::~AtomPredicateDescriptor()
+{
+}
+
+atom* AtomPredicateDescriptor::find() {
+  atoms_t atoms = getAtoms();
+  atoms_iter_t res = find_if(atoms.begin(),atoms.end(),boost::bind(&AtomPredicateDescriptor::predicate,this,_1));
+  return (res!=atoms.end())?((*res).second):0;
+}
+
+vector<atom*> AtomPredicateDescriptor::findAll() {
+  vector<atom*> res;
+  atoms_t atoms = getAtoms();
+  atoms_iter_t iter;
+  for(iter=atoms.begin();iter!=atoms.end();++iter) {
+    if(predicate(*iter))
+      res.push_back((*iter).second);
+  }
+}
Index: molecuilder/src/Descriptors/AtomDescriptor.hpp
===================================================================
--- molecuilder/src/Descriptors/AtomDescriptor.hpp	(revision 86b9172421385fb0be15c2d52e42bca451d0ba6e)
+++ molecuilder/src/Descriptors/AtomDescriptor.hpp	(revision 86b9172421385fb0be15c2d52e42bca451d0ba6e)
@@ -0,0 +1,43 @@
+/*
+ * AtomDescriptor.hpp
+ *
+ *  Created on: Feb 5, 2010
+ *      Author: crueger
+ */
+
+#ifndef ATOMDESCRIPTOR_HPP_
+#define ATOMDESCRIPTOR_HPP_
+
+#include<vector>
+#include<map>
+#include "World.hpp"
+
+class atom;
+
+class AtomDescriptor
+{
+public:
+  friend atom* World::getAtom(AtomDescriptor& descriptor);
+  friend std::vector<atom*> World::getAllAtoms(AtomDescriptor& descriptor);
+
+  AtomDescriptor();
+  virtual ~AtomDescriptor();
+
+protected:
+  virtual atom* find()=0;
+  virtual std::vector<atom*> findAll()=0;
+  std::map<int,atom*>& getAtoms();
+};
+
+class AtomPredicateDescriptor : public AtomDescriptor{
+public:
+  AtomPredicateDescriptor();
+  virtual ~AtomPredicateDescriptor();
+
+protected:
+  virtual atom *find();
+  virtual std::vector<atom*> findAll();
+  virtual bool predicate(std::pair<int,atom*>)=0;
+};
+
+#endif /* ATOMDESCRIPTOR_HPP_ */
Index: molecuilder/src/Descriptors/AtomIdDescriptor.cpp
===================================================================
--- molecuilder/src/Descriptors/AtomIdDescriptor.cpp	(revision 86b9172421385fb0be15c2d52e42bca451d0ba6e)
+++ molecuilder/src/Descriptors/AtomIdDescriptor.cpp	(revision 86b9172421385fb0be15c2d52e42bca451d0ba6e)
@@ -0,0 +1,31 @@
+/*
+ * AtomIdDescriptor.cpp
+ *
+ *  Created on: Feb 5, 2010
+ *      Author: crueger
+ */
+
+#include "AtomIdDescriptor.hpp"
+
+#include "atom.hpp"
+
+using namespace std;
+
+AtomIdDescriptor::AtomIdDescriptor(int _id) :
+  id(_id)
+{}
+
+AtomIdDescriptor::~AtomIdDescriptor()
+{}
+
+
+atom *AtomIdDescriptor::find(){
+  map<int,atom*> atoms = getAtoms();
+  map<int,atom*>::iterator res = atoms.find(id);
+  return (res!=atoms.end())?((*res).second):0;
+}
+
+vector<atom*> AtomIdDescriptor::findAll(){
+  atom *res = find();
+  return (res)?(vector<atom*>(1,res)):(vector<atom*>());
+}
Index: molecuilder/src/Descriptors/AtomIdDescriptor.hpp
===================================================================
--- molecuilder/src/Descriptors/AtomIdDescriptor.hpp	(revision 86b9172421385fb0be15c2d52e42bca451d0ba6e)
+++ molecuilder/src/Descriptors/AtomIdDescriptor.hpp	(revision 86b9172421385fb0be15c2d52e42bca451d0ba6e)
@@ -0,0 +1,27 @@
+/*
+ * AtomIdDescriptor.hpp
+ *
+ *  Created on: Feb 5, 2010
+ *      Author: crueger
+ */
+
+#ifndef ATOMIDDESCRIPTOR_HPP_
+#define ATOMIDDESCRIPTOR_HPP_
+
+#include "Descriptors/AtomDescriptor.hpp"
+
+class AtomIdDescriptor : public AtomDescriptor
+{
+public:
+  AtomIdDescriptor(int _id);
+  virtual ~AtomIdDescriptor();
+
+protected:
+  atom *find();
+  std::vector<atom*> findAll();
+
+private:
+  int id;
+};
+
+#endif /* ATOMIDDESCRIPTOR_HPP_ */
