Changeset 3015 for code/branches/netp3/src/network/TrafficControl.h
- Timestamp:
- May 22, 2009, 9:46:53 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp3/src/network/TrafficControl.h
r2710 r3015 21 21 * 22 22 * Author: 23 * Oliver Scheuss <scheusso [at] ee.ethz.ch> , (C) 200823 * Oliver Scheuss <scheusso [at] ee.ethz.ch> 24 24 * Co-authors: 25 25 * ... … … 32 32 33 33 #include <string> 34 #include < list>34 #include <vector> 35 35 #include <map> 36 36 #include <utility> … … 83 83 84 84 /** 85 *Lists that will be used:86 *listToProcess87 *clientListPerm88 *clientListTemp89 *referenceList90 *permObjPrio list91 *schedObjPrio92 */93 //start: lists to be used94 /**95 *creates list (typ map) that contains objids, struct with info concerning object(objid)96 */97 // 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 GS98 /**99 85 *permanent client list: contains client ids, object ids and objectInfos (in this order) 100 86 */ … … 105 91 *temporary client list: contains client ids, gamestate ids and object ids (in this order) 106 92 */ 107 std::map<unsigned int, std::map<unsigned int, std::list<obj> > > clientListTemp_; 108 /** 109 *static priority list: contains obj id, basic priority (in this order) 110 */ 111 // std::map<unsigned int, unsigned int> permObjPrio_; 112 /** 113 *dynamic priority list: contains obj id, dynamic priority (eg scheduled) (in this order) 114 */ 115 // std::map<unsigned int, unsigned int> schedObjPrio_; 116 //end: lists to be used 93 std::map<unsigned int, std::map<unsigned int, std::vector<obj> > > clientListTemp_; 117 94 118 95 /**updateReferenceList … … 123 100 unsigned int targetSize; 124 101 bool bActive_; 125 /**126 *copiedVector is a copy of the given Vector by the GSmanager, on this list all manipulations are performed127 */128 // std::list<obj> copiedVector;129 130 // void updateReferenceList(std::map<unsigned int, objInfo> *list);//done131 void insertinClientListPerm(unsigned int clientID, obj objinf);//done132 /**133 *creates listToProcess, which can be easialy compared with other lists134 */135 // void copyList(std::list<obj> *list);//done136 102 137 void cut(std::list<obj> *list, unsigned int targetsize); 138 void updateClientListTemp(std::list<obj> *list);//done 103 void insertinClientListPerm(unsigned int clientID, obj objinf); 104 105 void cut(std::vector<obj>& list, unsigned int targetsize); 106 void updateClientListTemp(std::vector<obj>& list);//done 139 107 /** 140 108 *evaluates Data given (list) and produces result(->Data to be updated) 141 109 */ 142 void evaluateList(unsigned int clientID, std:: list<obj> *list);//done110 void evaluateList(unsigned int clientID, std::vector<obj>& list);//done 143 111 void ack(unsigned int clientID, unsigned int gamestateID); // this function gets called when the server receives an ack from the client 144 112 … … 162 130 void setConfigValues(); 163 131 static TrafficControl *getInstance(); 164 void processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>* list); //gets a pointer to the list (containing objectIDs) and sorts it 165 //done 132 void processObjectList(unsigned int clientID, unsigned int gamestateID, std::vector<obj>& list); //gets a pointer to the list (containing objectIDs) and sorts it 166 133 static void processAck(unsigned int clientID, unsigned int gamestateID) 167 134 { return instance_->ack(clientID, gamestateID); } 168 //done169 135 void deleteObject(unsigned int objectID); // this function gets called when an object has been deleted (in order to clean up lists and maps) 170 136 171 137 bool prioritySort(uint32_t clientID, obj i, obj j); 172 138 bool dataSort(obj i, obj j); 173 void printList(std:: list<obj> *list, unsigned int clientID);174 void fixCreatorDependencies(std:: list<obj>::iterator it, std::list<obj> *list, unsigned int clientID);139 void printList(std::vector<obj>& list, unsigned int clientID); 140 void fixCreatorDependencies(std::vector<obj>::iterator it, std::vector<obj>& list, unsigned int clientID); 175 141 }; 176 142
Note: See TracChangeset
for help on using the changeset viewer.