Index: trunk/src/lib/lang/base_object.cc
===================================================================
--- trunk/src/lib/lang/base_object.cc	(revision 9869)
+++ trunk/src/lib/lang/base_object.cc	(revision 10114)
@@ -35,4 +35,17 @@
 }
 
+/** 
+ * copyconstructor
+ * @param bo instance to copy
+ */
+BaseObject::BaseObject( const BaseObject& bo )
+{
+  this->className = "BaseObject";
+  this->objectName = bo.objectName;
+  this->xmlElem = (bo.xmlElem)? bo.xmlElem->Clone() : NULL;
+  this->registerObject( this, BaseObject::_objectList);
+}
+
+
 /**
  * @brief standard deconstructor
@@ -45,5 +58,5 @@
   for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
   {
-    if (ORX_DEBUG >= 5)
+    //if (ORX_DEBUG >= 5)
       assert((*it)._objectList->checkIteratorInList((*it)._iterator) || (*it)._objectList->checkObjectInList(this));
     (*it)._objectList->unregisterObject((*it)._iterator);
Index: trunk/src/lib/lang/base_object.h
===================================================================
--- trunk/src/lib/lang/base_object.h	(revision 9869)
+++ trunk/src/lib/lang/base_object.h	(revision 10114)
@@ -30,4 +30,5 @@
 public:
   BaseObject (const std::string& objectName = "");
+  BaseObject( const BaseObject& bo );
 
   virtual ~BaseObject ();
@@ -51,6 +52,4 @@
   /** @returns the ClassID of this Object */
   inline const ClassID& getClassID() const { return _classes.front()._objectList->identity(); }
-  /** @returns the ID of the Topmost object of the ClassStack */
-  inline const int& getLeafClassID() const { return _classes.front()._objectList->identity().id(); }
 
   bool isA(const ObjectListBase& objectList) const;
Index: trunk/src/lib/lang/object_list.cc
===================================================================
--- trunk/src/lib/lang/object_list.cc	(revision 9869)
+++ trunk/src/lib/lang/object_list.cc	(revision 10114)
@@ -25,5 +25,5 @@
  * @return a new NewObejctList
  */
-ObjectListBase::ObjectListBase(const std::string& className, int id)
+ObjectListBase::ObjectListBase(const std::string& className)
     : _name(className)
 {
@@ -36,10 +36,8 @@
   assert(!ObjectListBase::classNameExists(className) && "Classes should only be included once, and no two classes should have the same name (key value)");
 
-  if (id == -1)
-  {
-    id = ObjectListBase::_classesByID->size();
-    // searching for a free ID
-    while (ObjectListBase::classIDExists(id)) ++id;
-  }
+  int id = ObjectListBase::_classesByID->size();
+  // searching for a free ID
+  while (ObjectListBase::classIDExists(id)) ++id;
+
   assert(!ObjectListBase::classIDExists(id) && "Classes should only be included once, and no two classes should have the same ID (key value)");
 
@@ -330,2 +328,57 @@
     return -1;
 }
+
+
+/**
+ * replace all ids. list must contain all (and no more) ids
+ * @param str2id list: string -> newId
+ */
+void ObjectListBase::replaceIDMap( const std::map< std::string, int >& str2id )
+{
+  if ( str2id.size() != _classesByID->size() )
+  {
+    assert( false && "size of str2id does not match" );
+  }
+
+  IDMap * map = new IDMap();
+
+  std::map< std::string, int >::const_iterator it;
+  for ( it = str2id.begin(); it != str2id.end(); it++ )
+  {
+    assert( _classesByName->find( it->first ) != _classesByName->end() );
+    (*map)[ it->second ] =  (*_classesByName)[it->first];
+    (*map)[ it->second ]->_id = it->second;
+  }
+
+  delete _classesByID;
+  _classesByID = map;
+}
+
+/**
+ *
+ * @return
+ */
+std::map< std::string, int > * ObjectListBase::createStrToId( )
+{
+  std::map< std::string, int > * res = new std::map< std::string, int >();
+
+  NameMap::const_iterator it;
+  for ( it = _classesByName->begin(); it != _classesByName->end(); it++ )
+  {
+    IDMap::const_iterator it2;
+    int id = -1;
+    for ( it2 = _classesByID->begin(); it2 != _classesByID->end(); it2++ )
+    {
+      if ( it->second == it2->second )
+      {
+        id = it2->first;
+        break;
+      }
+    }
+
+    assert( id != -1 );
+    (*res)[ it->first ] = id;
+  }
+
+  return res;
+}
Index: trunk/src/lib/lang/object_list.h
===================================================================
--- trunk/src/lib/lang/object_list.h	(revision 9869)
+++ trunk/src/lib/lang/object_list.h	(revision 10114)
@@ -32,15 +32,7 @@
  * @brief Use this macro to easily define a Class to store its own ObjectListDefinition
  * @param ClassName: the Name of the Class.
- * @param ID: optional set a Fixed ID.
- */
-#define ObjectListDefinitionID(ClassName, ID) \
-   ObjectList<ClassName> ClassName::_objectList(#ClassName, ID)
-
-/**
- * @brief Use this macro to easily define a Class to store its own ObjectListDefinition
- * @param ClassName: the Name of the Class.
  */
 #define ObjectListDefinition(ClassName) \
-    ObjectListDefinitionID(ClassName, -1)
+    ObjectList<ClassName> ClassName::_objectList(#ClassName)
 
 class BaseObject;
@@ -109,5 +101,5 @@
 
 protected:
-  ObjectListBase(const std::string& className, int id = -1);
+  ObjectListBase(const std::string& className);
   virtual ~ObjectListBase();
 
@@ -133,4 +125,8 @@
   static NameMap*               _classesByName;     //!< A Map of all the classes in existance.
   static std::list<std::string> _classNames;        //!< A list of all the registered ClassNames.
+
+public:
+  static void replaceIDMap( const std::map<std::string, int>& str2id );
+  static std::map<std::string, int>* createStrToId();
 };
 
@@ -199,5 +195,5 @@
 
 public:
-  ObjectList(const std::string& name, int id = -1);
+  ObjectList(const std::string& name);
   ~ObjectList();
 
@@ -256,6 +252,6 @@
  */
 template <class T>
-ObjectList<T>::ObjectList(const std::string& name, int id)
-    : ObjectListBase(name, id)
+ObjectList<T>::ObjectList(const std::string& name)
+    : ObjectListBase(name)
 {}
 
