Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 22, 2009, 9:46:53 AM (15 years ago)
Author:
scheusso
Message:

trying to make some performance improvements in TrafficControl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp3/src/network/TrafficControl.h

    r2710 r3015  
    2121 *
    2222 *   Author:
    23  *      Oliver Scheuss <scheusso [at] ee.ethz.ch>, (C) 2008
     23 *      Oliver Scheuss <scheusso [at] ee.ethz.ch>
    2424 *   Co-authors:
    2525 *      ...
     
    3232
    3333#include <string>
    34 #include <list>
     34#include <vector>
    3535#include <map>
    3636#include <utility>
     
    8383
    8484    /**
    85     *Lists that will be used:
    86     *listToProcess
    87     *clientListPerm
    88     *clientListTemp
    89     *referenceList
    90     *permObjPrio list
    91     *schedObjPrio
    92     */
    93     //start: lists to be used
    94     /**
    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 GS
    98     /**
    9985    *permanent client list: contains client ids, object ids and objectInfos (in this order)
    10086    */
     
    10591    *temporary client list: contains client ids, gamestate ids and object ids (in this order)
    10692    */
    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_;
    11794
    11895    /**updateReferenceList
     
    123100    unsigned int targetSize;
    124101    bool         bActive_;
    125     /**
    126     *copiedVector is a copy of the given Vector by the GSmanager, on this list all manipulations are performed
    127     */
    128 //     std::list<obj> copiedVector;
    129 
    130 //     void updateReferenceList(std::map<unsigned int, objInfo> *list);//done
    131     void insertinClientListPerm(unsigned int clientID, obj objinf);//done
    132     /**
    133     *creates listToProcess, which can be easialy compared with other lists
    134     */
    135 //     void copyList(std::list<obj> *list);//done
    136102   
    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
    139107    /**
    140108    *evaluates Data given (list) and produces result(->Data to be updated)
    141109    */
    142     void evaluateList(unsigned int clientID, std::list<obj> *list);//done   
     110    void evaluateList(unsigned int clientID, std::vector<obj>& list);//done   
    143111    void ack(unsigned int clientID, unsigned int gamestateID);  // this function gets called when the server receives an ack from the client
    144112   
     
    162130    void setConfigValues();
    163131    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
    166133    static void processAck(unsigned int clientID, unsigned int gamestateID)
    167134    { return instance_->ack(clientID, gamestateID); }
    168     //done
    169135    void deleteObject(unsigned int objectID);                           // this function gets called when an object has been deleted (in order to clean up lists and maps)
    170136   
    171137    bool prioritySort(uint32_t clientID, obj i, obj j);
    172138    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);
    175141};
    176142
Note: See TracChangeset for help on using the changeset viewer.