Index: code/branches/network/src/network/TrafficControl.cc
===================================================================
--- code/branches/network/src/network/TrafficControl.cc	(revision 2333)
+++ code/branches/network/src/network/TrafficControl.cc	(revision 2334)
@@ -30,4 +30,5 @@
 
 #include <cassert>
+#include <boost/bind.hpp>
 
 namespace network {
@@ -36,5 +37,5 @@
 *Initializing protected members
 */
-	TrafficControl *TraffiControl::instance_=0;
+	TrafficControl *TrafficControl::instance_=0;
 	
 	/**
@@ -48,5 +49,4 @@
 	  clientListPerm_ = new std::map<unsigned int,std::map<unsigned int, objInfo>>;
 	  clientListTemp_ = new std::map std::map<unsigned int, std::map<unsigned int, std::vector<obj>>>;
-	  referenceList_ = new std::map<unsigned int, Synchronisable*>;
 	  permObjPrio_ = new std::map<unsigned int, unsigned int> ;
 	  schedObjPrio_ = new std::map<unsigned int, unsigned int> schedObjPrio_;
@@ -67,5 +67,19 @@
 */
 
-	TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::vector<obj> *list)
+        /**
+                *eigener sortieralgorithmus
+        */
+        bool TrafficControl::priodiffer(obj i, obj j)
+        {
+          map<unsigned int, objInfo>::iterator iti;
+          map<unsigned int, objInfo>::iterator itj;
+          iti=listToProcess_->find(i.objID);
+          itj=listToProcess_->find(j.objID);
+          return iti->second.objValuePerm < itj->second.objValuePerm;
+        }
+
+
+
+	std::vector<obj>* TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::vector<obj> *list)
 	{
 	  copiedVector = *list;
@@ -79,5 +93,5 @@
 	}
 	
-	TrafficControl::processAck(unsigned int clientID, unsigned int gamestateID)
+	void TrafficControl::processAck(unsigned int clientID, unsigned int gamestateID)
 	{
 	  map<unsigned int,std::map<unsigned int, objInfo>>::iterator itperm;//iterator clientListPerm
@@ -119,17 +133,9 @@
 */
 	
-	//brauch ich die noch??,
-	TrafficControl::createReferenceList(Synchronisable *list)
-	{
-	  map<unsigned int, Synchronisable*>::iterator itref;
-	  itref=referenceList_->begin();
-	  referenceList_->insert(itref,pair<unsigned int, Synchronisable*>((*itref).getObjectID,(*itref).getSynchronisable));
-	}
-	//end brauch ich die noch
 	
 	/**
 	*copyList gets vector of Gamestate Manager and turns it to *listToProcess
 	*/
-	TrafficControl::copyList(std::map<obj> *list)
+	void TrafficControl::copyList(std::map<obj> *list)
 	{
 	  vector<obj>::iterator itvec;
@@ -139,5 +145,5 @@
 	    (*objectA).objCreatorID=(*itvec).objCreatorID;
 	    (*objectA).objSize = (*itvec).objSize;
-	    (*listToProcess_).insert(pair<currentClientID, map<(*itvec).objID,objectA>>)//unsicher: ob map<...> so richtig ist
+	    (*listToProcess_).insert(pair<currentClientID, map<(*itvec).objID,objectA>>);//unsicher: ob map<...> so richtig ist
 	  }
 	}
@@ -146,8 +152,8 @@
 	*returns void
 	*/
-	TrafficControl::updateReferenceList(std::map<unsigned int, objInfo> *list)
-	{
-	  map<unsigned int, Synchronisable*>::iterator itref;
-	  map<unsigned int, objInfo>::iterator itproc;
+	void TrafficControl::updateReferenceList(std::map<unsigned int, objInfo> *list)
+	{
+	  std::map<unsigned int, Synchronisable*>::iterator itref;
+	  std::map<unsigned int, objInfo>::iterator itproc;
 	  for(itproc=(*listToProcess_).begin();itproc != (*listToProcess_).end(); itproc++)
 	  {
@@ -159,5 +165,5 @@
 	    else
 	    {
-	      (*referenceList_).insert(pair<unsigned int,          Synchronisable*>((*itproc).first,Synchronisable::getSynchronisable((*itproc).first));//important: how to get adress of an object!
+	      (*referenceList_).insert(pair<unsigned int,          Synchronisable*>((*itproc).first,Synchronisable::getSynchronisable((*itproc).first)));//important: how to get adress of an object!
 	      insertinClientListPerm(currentClientID,itproc->first,itproc->second);
 	    }
@@ -168,7 +174,7 @@
 	*returns void
 	*/
-	TrafficControl::insertinClientListPerm(unsigned int clientid, unsigned int objid, objInfo objinf)
+	void TrafficControl::insertinClientListPerm(unsigned int clientid, unsigned int objid, objInfo objinf)
 	{ 
-	  map<unsigned int,std::map<unsigned int, objInfo>>::iterator itperm;//iterator clientListPerm over clientIDs
+	  std::map<unsigned int,std::map<unsigned int, objInfo>>::iterator itperm;//iterator clientListPerm over clientIDs
 	  itperm = (clientListPerm_).find(clientiD);
 	  assert(itperm != clientListPerm_.end() );
@@ -180,5 +186,5 @@
 	*evaluateList evaluates whether new obj are there, whether there are things to be updatet and manipulates all this.
 	*/
-	TrafficControl::evaluateList(std::map<obj> *list)
+	void TrafficControl::evaluateList(std::map<obj> *list)
 	{
 	  copyList(list);
@@ -188,8 +194,8 @@
 	
 	  //compare listToProcess vs clientListPerm
-	  map<unsigned int, objInfo>::iterator itproc;
-	  map<unsigned int,std::map<unsigned int, objInfo>>::iterator itperm;
-	  map<unsigned int, objInfo>::iterator itpermobj;
-	  map<unsigned int, unsigned int>::iterator itpermprio;
+	  std::map<unsigned int, objInfo>::iterator itproc;
+	  std::map<unsigned int, std::map<unsigned int, objInfo>>::iterator itperm;
+	  std::map<unsigned int, objInfo>::iterator itpermobj;
+	  std::map<unsigned int, unsigned int>::iterator itpermprio;
 	  for((*itproc=listToProcess_).begin(); itproc != (*listToProcess_).end();it++)
 	  {
@@ -243,5 +249,6 @@
 	}
 	//sort copied vector aufgrund der objprioperm in clientlistperm
-	sort(copiedVector.begin(),copiedVector.end(),priodiffer);
+        // use boost bind here because we need to pass a memberfunction to stl sort
+        sort(copiedvector.begin(), copiedvector.end(), boost::bind(&TrafficControl::priodiffer,this,_1,_2) );
 	//swappen aufgrund von creator oder ganz rausnehmen!?
 	for(itvec = copiedVector.begin(); itvec < copiedVector.end(); itvec++)
Index: code/branches/network/src/network/TrafficControl.h
===================================================================
--- code/branches/network/src/network/TrafficControl.h	(revision 2333)
+++ code/branches/network/src/network/TrafficControl.h	(revision 2334)
@@ -63,15 +63,5 @@
 };
 
-/**
-*eigener sortieralgorithmus
-*/
-bool priodiffer(obj i, obj j)
-{ 
-  map<unsigned int, objInfo>::iterator iti;
-  map<unsigned int, objInfo>::iterator itj;
-  iti=listToProcess_->find(i.objID);
-  itj=listToProcess_->find(j.objID);
-  return iti->second.objValuePerm < itj->second.objValuePerm;
-}
+
 
 /**
@@ -95,8 +85,4 @@
     */
     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 vector given by GS
-    /**
-    *reference list: contains object ids and the reference belonging to this id.
-    */
-    //std::map<unsigned int, Synchronisable*> *referenceList_;//has to be created with constructor and then needs to be updated by evaluateList().
     /**
     *permanent client list: contains client ids, object ids and objectInfos (in this order)
@@ -131,5 +117,4 @@
     void updateReferenceList(std::map<unsigned int, objInfo> *list);//done
     void insertinClientListPerm(unsigned int objid, objInfo objinf);//done
-    void createReferenceList(Synchronisable *list);//done
     /**
     *creates listToProcess, which can be easialy compared with other lists
@@ -161,4 +146,6 @@
     //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 priodiffer(obj i, obj j);
 };
 
