Index: /code/branches/netp3/src/network/TrafficControl.cc
===================================================================
--- /code/branches/netp3/src/network/TrafficControl.cc	(revision 3014)
+++ /code/branches/netp3/src/network/TrafficControl.cc	(revision 3015)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *      Oliver Scheuss <scheusso [at] ee.ethz.ch>, (C) 2008
+ *      Oliver Scheuss <scheusso [at] ee.ethz.ch>
  *   Co-authors:
  *      ...
@@ -121,7 +121,6 @@
 
 
-	void TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj> *list)
-	{
-// 	  copiedVector = *list;
+	void TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::vector<obj>& list)
+	{
 	  currentClientID=clientID;
 	  currentGamestateID=gamestateID;
@@ -138,5 +137,5 @@
 	void TrafficControl::ack(unsigned int clientID, unsigned int gamestateID)
 	{
-	  std::list<obj>::iterator itvec;  // iterator to iterate through the acked objects
+	  std::vector<obj>::iterator itvec;  // iterator to iterate through the acked objects
 
     //assertions to make sure the maps already exist
@@ -176,10 +175,6 @@
 	{
 	  std::map<unsigned int,std::map<unsigned int, objInfo> >::iterator itperm;//iterator clientListPerm over clientIDs
-// 	  itperm = (clientListPerm_).find(clientID);
-// 	  assert(itperm != clientListPerm_.end() );
     unsigned int gsid=GAMESTATEID_INITIAL, gsdiff=currentGamestateID, prioperm=Synchronisable::getSynchronisable(objinf.objID)->getPriority(), priomom=0;
     clientListPerm_[clientID][objinf.objID] = objInfo(objinf.objID, objinf.objCreatorID,gsid,gsdiff, objinf.objSize,prioperm,priomom);
-// 	  itperm->second.insert(std::pair<unsigned int, objInfo>(objid,objinf));
-//     permObjPrio_.insert(objid, objinf.objValuePerm);
 	}
 
@@ -188,7 +183,7 @@
   * takes the shortened list which will be sent to the gsmanager and puts the *info into clientListTemp
   */
-  void TrafficControl::updateClientListTemp(std::list<obj> *list)
-  {
-    clientListTemp_[currentClientID][currentGamestateID] = std::list<obj>(*list);
+  void TrafficControl::updateClientListTemp(std::vector<obj>& list)
+  {
+    clientListTemp_[currentClientID][currentGamestateID] = std::vector<obj>(list);
   }
 
@@ -197,10 +192,10 @@
   *takes the current list that has to be returned to the gsmanager and shortens it in criteria of bandwidth of clientID(XY)
   */
-  void TrafficControl::cut(std::list<obj> *list, unsigned int targetsize)
+  void TrafficControl::cut(std::vector<obj>& list, unsigned int targetsize)
   {
     unsigned int size=0;
-    std::list<obj>::iterator itvec, ittemp;
-    assert(!list->empty());
-    for(itvec = list->begin(); itvec != list->end();)
+    std::vector<obj>::iterator itvec, ittemp;
+    assert(!list.empty());
+    for(itvec = list.begin(); itvec != list.end();)
     {
       assert( (*itvec).objSize < 1000);
@@ -213,9 +208,9 @@
       {
         clientListPerm_[currentClientID][(*itvec).objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative
-        list->erase(itvec++);
+        list.erase(itvec++);
       }
 //       printList(list, currentClientID);
     }
-    assert(!list->empty());
+    assert(!list.empty());
   }
 
@@ -224,5 +219,5 @@
 	*evaluateList evaluates whether new obj are there, whether there are things to be updatet and manipulates all this.
 	*/
-	void TrafficControl::evaluateList(unsigned int clientID, std::list<obj> *list)
+	void TrafficControl::evaluateList(unsigned int clientID, std::vector<obj>& list)
 	{
 
@@ -231,6 +226,6 @@
 	  //compare listToProcess vs clientListPerm
     //if listToProcess contains new Objects, add them to clientListPerm
-    std::list<obj>::iterator itvec;
-	  for( itvec=list->begin(); itvec != list->end(); itvec++)
+    std::vector<obj>::iterator itvec;
+	  for( itvec=list.begin(); itvec != list.end(); itvec++)
 	  {
 	    if ( clientListPerm_[clientID].find( (*itvec).objID) != clientListPerm_[clientID].end() )
@@ -254,9 +249,10 @@
       //sort copied list according to priorities
       // use boost bind here because we need to pass a memberfunction to stl sort
-      list->sort(boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
+      sort( list.begin(), list.end(), boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
+//       list.sort(boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
 
       //now we check, that the creator of an object always exists on a client
-      std::list<obj>::iterator itcreator;
-      for(itvec = list->begin(); itvec != list->end(); itvec++)
+      std::vector<obj>::iterator itcreator;
+      for(itvec = list.begin(); itvec != list.end(); itvec++)
       {
         fixCreatorDependencies(itvec, list, clientID);
@@ -268,5 +264,5 @@
 
       //now sort again after objDataOffset
-      list->sort(boost::bind(&TrafficControl::dataSort, this, _1, _2) );
+      sort(list.begin(), list.end(), boost::bind(&TrafficControl::dataSort, this, _1, _2) );
     }
     //diese Funktion updateClientList muss noch gemacht werden
@@ -275,13 +271,13 @@
   }
 
-  void TrafficControl::printList(std::list<obj> *list, unsigned int clientID)
-  {
-    std::list<obj>::iterator it;
+  void TrafficControl::printList(std::vector<obj>& list, unsigned int clientID)
+  {
+    std::vector<obj>::iterator it;
     COUT(0) << "=========== Objectlist ===========" << endl;
-    for( it=list->begin(); it!=list->end(); it++)
+    for( it=list.begin(); it!=list.end(); it++)
       COUT(0) << "ObjectID: " << (*it).objID << " creatorID: " << (*it).objCreatorID << " Priority: " << clientListPerm_[clientID][(*it).objID].objValuePerm + clientListPerm_[clientID][(*it).objID].objValueSched << " size: " << (*it).objSize << endl;
   }
 
-  void TrafficControl::fixCreatorDependencies(std::list<obj>::iterator it1, std::list<obj> *list, unsigned int clientID)
+  void TrafficControl::fixCreatorDependencies(std::vector<obj>::iterator it1, std::vector<obj>& list, unsigned int clientID)
   {
     if ( (*it1).objCreatorID == OBJECTID_UNKNOWN )
@@ -289,11 +285,11 @@
     if( clientListPerm_[clientID][(*it1).objCreatorID].objCurGS != GAMESTATEID_INITIAL )
       return;
-    std::list<obj>::iterator it2, it3=it1;
-    for( it2 = ++it3; it2 != list->end(); it2++ )
+    std::vector<obj>::iterator it2, it3=it1;
+    for( it2 = ++it3; it2 != list.end(); it2++ )
     {
       if( (*it2).objID == (*it1).objCreatorID )
       {
-        it3 = list->insert(it1, *it2); //insert creator before it1
-        list->erase(it2);
+        it3 = list.insert(it1, *it2); //insert creator before it1
+        list.erase(it2);
 //         printList(list, clientID);
         fixCreatorDependencies( it3, list, clientID );
Index: /code/branches/netp3/src/network/TrafficControl.h
===================================================================
--- /code/branches/netp3/src/network/TrafficControl.h	(revision 3014)
+++ /code/branches/netp3/src/network/TrafficControl.h	(revision 3015)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *      Oliver Scheuss <scheusso [at] ee.ethz.ch>, (C) 2008
+ *      Oliver Scheuss <scheusso [at] ee.ethz.ch>
  *   Co-authors:
  *      ...
@@ -32,5 +32,5 @@
 
 #include <string>
-#include <list>
+#include <vector>
 #include <map>
 #include <utility>
@@ -83,18 +83,4 @@
 
     /**
-    *Lists that will be used:
-    *listToProcess
-    *clientListPerm
-    *clientListTemp
-    *referenceList
-    *permObjPrio list
-    *schedObjPrio
-    */
-    //start: lists to be used
-    /**
-    *creates list (typ map) that contains objids, struct with info concerning object(objid)
-    */
-//     std::map<unsigned int, objInfo> listToProcess_;//copy of argument, when traffic control tool is being called, the original of this must be returned later on, eg the list given by GS
-    /**
     *permanent client list: contains client ids, object ids and objectInfos (in this order)
     */
@@ -105,14 +91,5 @@
     *temporary client list: contains client ids, gamestate ids and object ids (in this order)
     */
-    std::map<unsigned int, std::map<unsigned int, std::list<obj> > > clientListTemp_;
-    /**
-    *static priority list: contains obj id, basic priority (in this order)
-    */
-//     std::map<unsigned int, unsigned int> permObjPrio_;
-    /**
-    *dynamic priority list: contains obj id, dynamic priority (eg scheduled) (in this order)
-    */
-//     std::map<unsigned int, unsigned int> schedObjPrio_;
-    //end: lists to be used
+    std::map<unsigned int, std::map<unsigned int, std::vector<obj> > > clientListTemp_;
 
     /**updateReferenceList
@@ -123,22 +100,13 @@
     unsigned int targetSize;
     bool         bActive_;
-    /**
-    *copiedVector is a copy of the given Vector by the GSmanager, on this list all manipulations are performed
-    */
-//     std::list<obj> copiedVector;
-
-//     void updateReferenceList(std::map<unsigned int, objInfo> *list);//done
-    void insertinClientListPerm(unsigned int clientID, obj objinf);//done
-    /**
-    *creates listToProcess, which can be easialy compared with other lists
-    */
-//     void copyList(std::list<obj> *list);//done
     
-    void cut(std::list<obj> *list, unsigned int targetsize);
-    void updateClientListTemp(std::list<obj> *list);//done
+    void insertinClientListPerm(unsigned int clientID, obj objinf);
+    
+    void cut(std::vector<obj>& list, unsigned int targetsize);
+    void updateClientListTemp(std::vector<obj>& list);//done
     /**
     *evaluates Data given (list) and produces result(->Data to be updated)
     */
-    void evaluateList(unsigned int clientID, std::list<obj> *list);//done    
+    void evaluateList(unsigned int clientID, std::vector<obj>& list);//done    
     void ack(unsigned int clientID, unsigned int gamestateID);  // this function gets called when the server receives an ack from the client
     
@@ -162,15 +130,13 @@
     void setConfigValues();
     static TrafficControl *getInstance();
-    void processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>* list); //gets a pointer to the list (containing objectIDs) and sorts it
-    //done
+    void processObjectList(unsigned int clientID, unsigned int gamestateID, std::vector<obj>& list); //gets a pointer to the list (containing objectIDs) and sorts it
     static void processAck(unsigned int clientID, unsigned int gamestateID)
     { return instance_->ack(clientID, gamestateID); }
-    //done
     void deleteObject(unsigned int objectID);				// this function gets called when an object has been deleted (in order to clean up lists and maps)
     
     bool prioritySort(uint32_t clientID, obj i, obj j);
     bool dataSort(obj i, obj j);
-    void printList(std::list<obj> *list, unsigned int clientID);
-    void fixCreatorDependencies(std::list<obj>::iterator it, std::list<obj> *list, unsigned int clientID);
+    void printList(std::vector<obj>& list, unsigned int clientID);
+    void fixCreatorDependencies(std::vector<obj>::iterator it, std::vector<obj>& list, unsigned int clientID);
 };
 
Index: /code/branches/netp3/src/network/packet/Gamestate.cc
===================================================================
--- /code/branches/netp3/src/network/packet/Gamestate.cc	(revision 3014)
+++ /code/branches/netp3/src/network/packet/Gamestate.cc	(revision 3015)
@@ -111,5 +111,5 @@
     tempsize = it->getData(mem, id, mode);
     if ( it->doSync( id, mode ) )
-      dataMap_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) );
+      dataVector_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) );
     
 #ifndef NDEBUG
@@ -364,5 +364,5 @@
 Gamestate* Gamestate::doSelection(unsigned int clientID, unsigned int targetSize){
   assert(data_);
-  std::list<obj>::iterator it;
+  std::vector<obj>::iterator it;
 
   // allocate memory for new data
@@ -383,8 +383,8 @@
 
   //call TrafficControl
-  TrafficControl::getInstance()->processObjectList( clientID, header_->getID(), &dataMap_ );
+  TrafficControl::getInstance()->processObjectList( clientID, header_->getID(), dataVector_ );
 
   //copy in the zeros
-  for(it=dataMap_.begin(); it!=dataMap_.end();){
+  for(it=dataVector_.begin(); it!=dataVector_.end();){
     SynchronisableHeader oldobjectheader(origdata);
     SynchronisableHeader newobjectheader(newdata);
Index: /code/branches/netp3/src/network/packet/Gamestate.h
===================================================================
--- /code/branches/netp3/src/network/packet/Gamestate.h	(revision 3014)
+++ /code/branches/netp3/src/network/packet/Gamestate.h	(revision 3015)
@@ -37,5 +37,5 @@
 #include <string.h>
 #include <map>
-#include <list>
+#include <vector>
 #include <cassert>
 #ifndef NDEBUG
@@ -129,5 +129,5 @@
   private:
     uint32_t calcGamestateSize(int32_t id, uint8_t mode=0x0);
-    std::list<obj> dataMap_;
+    std::vector<obj> dataVector_;
     GamestateHeader* header_;
 };
