Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 13, 2009, 5:05:17 PM (15 years ago)
Author:
dafrick
Message:

Hopefully merged trunk successfully into pickup branch.

Location:
code/branches/pickup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup

  • code/branches/pickup/src/libraries/network/synchronisable/Synchronisable.h

    r5781 r5935  
    6868   * @brief: stores information about a Synchronisable
    6969   *
    70    * This class stores the information about a Synchronisable (objectID, classID, creatorID, dataSize)
     70   * This class stores the information about a Synchronisable (objectID_, classID_, creatorID_, dataSize)
    7171   * in an emulated bitset.
    7272   * Bit 1 to 31 store the size of the Data the synchronisable consumes in the stream
    7373   * Bit 32 is a bool and defines whether the data is actually stored or is just filled up with 0
    74    * Byte 5 to 8: objectID
    75    * Byte 9 to 12: classID
    76    * Byte 13 to 16: creatorID
     74   * Byte 5 to 8: objectID_
     75   * Byte 9 to 12: classID_
     76   * Byte 13 to 16: creatorID_
    7777   */
    7878  class _NetworkExport SynchronisableHeader{
     
    9494      inline uint32_t getObjectID() const
    9595        { return *(uint32_t*)(data_+4); }
    96       inline void setObjectID(uint32_t objectID)
    97         { *(uint32_t*)(data_+4) = objectID; }
     96      inline void setObjectID(uint32_t objectID_)
     97        { *(uint32_t*)(data_+4) = objectID_; }
    9898      inline uint32_t getClassID() const
    9999        { return *(uint32_t*)(data_+8); }
    100       inline void setClassID(uint32_t classID)
    101         { *(uint32_t*)(data_+8) = classID; }
     100      inline void setClassID(uint32_t classID_)
     101        { *(uint32_t*)(data_+8) = classID_; }
    102102      inline uint32_t getCreatorID() const
    103103        { return *(uint32_t*)(data_+12); }
    104       inline void setCreatorID(uint32_t creatorID)
    105         { *(uint32_t*)(data_+12) = creatorID; }
     104      inline void setCreatorID(uint32_t creatorID_)
     105        { *(uint32_t*)(data_+12) = creatorID_; }
    106106      inline void operator=(SynchronisableHeader& h)
    107107        { memcpy(data_, h.data_, getSize()); }
     
    122122
    123123    static Synchronisable *fabricate(uint8_t*& mem, uint8_t mode=0x0);
    124     static bool deleteObject(uint32_t objectID);
    125     static Synchronisable *getSynchronisable(uint32_t objectID);
     124    static bool deleteObject(uint32_t objectID_);
     125    static Synchronisable *getSynchronisable(uint32_t objectID_);
    126126    static unsigned int getNumberOfDeletedObject(){ return deletedObjects_.size(); }
    127127    static uint32_t popDeletedObject(){ uint32_t i = deletedObjects_.front(); deletedObjects_.pop(); return i; }
    128128
    129     inline uint32_t getObjectID() const {return objectID;}
    130     inline unsigned int getCreatorID() const {return creatorID;}
    131     inline uint32_t getClassID() const {return classID;}
    132     inline unsigned int getPriority() const { return objectFrequency_;}
     129    inline uint32_t getObjectID() const {return this->objectID_;}
     130    inline unsigned int getCreatorID() const {return this->creatorID_;}
     131    inline uint32_t getClassID() const {return this->classID_;}
     132    inline unsigned int getPriority() const { return this->objectFrequency_;}
     133    inline uint8_t getSyncMode() const { return this->objectMode_; }
     134   
     135    void setSyncMode(uint8_t mode);
    133136
    134137  protected:
     
    136139    template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
    137140    //template <class T> void unregisterVariable(T& var);
    138     void setObjectMode(uint8_t mode);
    139141    void setPriority(unsigned int freq){ objectFrequency_ = freq; }
    140142
     
    146148    bool isMyData(uint8_t* mem);
    147149    bool doSync(int32_t id, uint8_t mode=0x0);
    148 
    149     uint32_t objectID;
    150     uint32_t creatorID;
    151     uint32_t classID;
     150   
     151    inline void setObjectID(uint32_t id){ this->objectID_ = id; objectMap_[this->objectID_] = this; }
     152    inline void setClassID(uint32_t id){ this->classID_ = id; }
     153
     154    uint32_t objectID_;
     155    uint32_t creatorID_;
     156    uint32_t classID_;
    152157
    153158    std::vector<SynchronisableVariableBase*> syncList;
Note: See TracChangeset for help on using the changeset viewer.