Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 9, 2013, 9:26:46 PM (11 years ago)
Author:
landauf
Message:

BaseObject now requires a Context instead of a creator (BaseObject*) in its constructor.
Namespace, Level, and Scene inherit from Context

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/src/libraries/network/synchronisable/Synchronisable.h

    r9587 r9629  
    107107   * @brief: stores information about a Synchronisable
    108108   *
    109    * This class stores the information about a Synchronisable (objectID_, classID_, creatorID_, dataSize)
     109   * This class stores the information about a Synchronisable (objectID_, classID_, contextID_, dataSize)
    110110   * in an emulated bitset.
    111111   * Bit 1 to 31 store the size of the Data the synchronisable consumes in the stream
     
    113113   * Byte 5 to 8: objectID_
    114114   * Byte 9 to 12: classID_
    115    * Byte 13 to 16: creatorID_
     115   * Byte 13 to 16: contextID_
    116116   */
    117117  class _NetworkExport SynchronisableHeader: public SynchronisableHeaderLight
     
    126126      inline void setClassID(uint32_t classID_)
    127127        { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()) = classID_; }
    128       inline uint32_t getCreatorID() const
     128      inline uint32_t getContextID() const
    129129        { return *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4); }
    130       inline void setCreatorID(uint32_t creatorID_)
    131         { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4) = creatorID_; }
     130      inline void setContextID(uint32_t contextID_)
     131        { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4) = contextID_; }
    132132      inline void operator=(SynchronisableHeader& h)
    133133        { memcpy(data_, h.data_, getSize()); }
     
    158158
    159159    inline uint32_t getObjectID() const {return this->objectID_;}
    160     inline unsigned int getCreatorID() const {return this->creatorID_;}
     160    inline unsigned int getContextID() const {return this->contextID_;}
    161161    inline uint32_t getClassID() const {return this->classID_;}
    162162    inline unsigned int getPriority() const { return this->objectFrequency_;}
     
    170170
    171171  protected:
    172     Synchronisable(BaseObject* creator);
     172    Synchronisable(Context* context);
    173173    template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
    174174    template <class T> void registerVariable(std::set<T>& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
     
    176176
    177177    void setPriority(unsigned int freq){ objectFrequency_ = freq; }
    178 
     178    uint32_t findContextID(Context* context);
    179179
    180180  private:
     
    189189
    190190    uint32_t objectID_;
    191     uint32_t creatorID_;
     191    uint32_t contextID_;
    192192    uint32_t classID_;
    193193
Note: See TracChangeset for help on using the changeset viewer.