Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2008, 9:10:00 PM (15 years ago)
Author:
scheusso
Message:

made some adjustments mostly to the networkid (classid) in order to have it platform independent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network64/src/network/synchronisable/Synchronisable.cc

    r2307 r2309  
    5555
    5656
    57   std::map<unsigned int, Synchronisable *> Synchronisable::objectMap_;
    58   std::queue<unsigned int> Synchronisable::deletedObjects_;
     57  std::map<uint32_t, Synchronisable *> Synchronisable::objectMap_;
     58  std::queue<uint32_t> Synchronisable::deletedObjects_;
    5959
    6060  uint8_t Synchronisable::state_=0x1; // detemines wheter we are server (default) or client
     
    7777    else
    7878      objectID=OBJECTID_UNKNOWN;
    79     classID = (unsigned int)-1;
     79    classID = static_cast<uint32_t>(-1);
    8080
    8181
     
    122122//       objectMap_.erase(objectID);
    123123    }
    124     std::map<unsigned int, Synchronisable*>::iterator it;
     124    std::map<uint32_t, Synchronisable*>::iterator it;
    125125    it = objectMap_.find(objectID);
    126126    if (it != objectMap_.end())
     
    199199   * @return true/false
    200200   */
    201   bool Synchronisable::deleteObject(unsigned int objectID){
     201  bool Synchronisable::deleteObject(uint32_t objectID){
    202202//     assert(getSynchronisable(objectID));
    203203    if(!getSynchronisable(objectID))
     
    218218   * @return pointer to the Synchronisable with the objectID
    219219   */
    220   Synchronisable* Synchronisable::getSynchronisable(unsigned int objectID){
    221     std::map<unsigned int, Synchronisable*>::iterator it1;
     220  Synchronisable* Synchronisable::getSynchronisable(uint32_t objectID){
     221    std::map<uint32_t, Synchronisable*>::iterator it1;
    222222    it1 = objectMap_.find(objectID);
    223223    if (it1 != objectMap_.end())
     
    295295   * @return true: if !doSync or if everything was successfully saved
    296296   */
    297   bool Synchronisable::getData(uint8_t*& mem, unsigned int id, uint8_t mode){
     297  bool Synchronisable::getData(uint8_t*& mem, int32_t id, uint8_t mode){
    298298    if(mode==0x0)
    299299      mode=state_;
     
    302302      return true;
    303303    //std::cout << "inside getData" << std::endl;
    304     unsigned int tempsize = 0;
     304    uint32_t tempsize = 0;
    305305    if(classID==0)
    306306      COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;
    307307
    308     if (this->classID == (unsigned int)-1)
     308    if (this->classID == static_cast<uint32_t>(-1))
    309309        this->classID = this->getIdentifier()->getNetworkID();
    310310
     
    312312//     this->classID=this->getIdentifier()->getNetworkID(); // TODO: correct this
    313313    std::list<SynchronisableVariableBase*>::iterator i;
    314     unsigned int size;
     314    uint32_t size;
    315315    size=getSize(id, mode);
    316316
     
    384384  * @return amount of bytes
    385385  */
    386   uint32_t Synchronisable::getSize(unsigned int id, uint8_t mode){
     386  uint32_t Synchronisable::getSize(int32_t id, uint8_t mode){
    387387    int tsize=sizeof(synchronisableHeader);
    388388    if(mode==0x0)
     
    402402   * @return true/false
    403403   */
    404   bool Synchronisable::doSync(unsigned int id, uint8_t mode){
     404  bool Synchronisable::doSync(int32_t id, uint8_t mode){
    405405    if(mode==0x0)
    406406      mode=state_;
     
    408408  }
    409409
    410   bool Synchronisable::doSelection(unsigned int id){
     410  bool Synchronisable::doSelection(int32_t id){
    411411    return true; //TODO: change this
    412412    //return ( id==0 || id%objectFrequency_==objectID%objectFrequency_ ) && ((objectMode_&state_)!=0);
Note: See TracChangeset for help on using the changeset viewer.