Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 10, 2006, 12:11:43 AM (18 years ago)
Author:
patrick
Message:

network: added some comments and found some small bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/synchronizeable_var/synchronizeable_var.h

    r7508 r7559  
    99#include <string>
    1010#include "netdefs.h"
     11#include <assert.h>
    1112
    1213class SynchronizeableVar {
     
    1516    SynchronizeableVar( void * ptrIn, void * ptrOut, std::string name, int length, int permission = 0, int priority = 0 );
    1617    virtual ~SynchronizeableVar();
    17    
     18
    1819    /**
    1920     * check if synchronizeable wants to be informed on changes
     
    2122     */
    2223    inline bool beWatched(){ return this->bWatched; }
    23    
     24
    2425    /**
    2526     * write var data to byte buffer
     
    2930     */
    3031    virtual int writeToBuf( byte * buf, int maxLength ) = 0;
    31    
     32
    3233    /**
    3334     * read var data from byte buffer
     
    3738     */
    3839    virtual int readFromBuf( byte * buf, int maxLength ) = 0;
    39    
     40
    4041    /**
    4142     * check if writeToBuf will return the same size every time
     
    4344     */
    4445    virtual bool hasStaticSize() = 0;
    45    
     46
    4647    /**
    4748     * get size writeToBuf needs
     
    4950     */
    5051    virtual int getSize(){ return length; }
    51    
     52
    5253    /**
    5354     * check for permission to write
     
    5556     */
    5657    inline bool checkPremission( int permission ){ return (permission & this->permission) != 0; }
    57    
     58
    5859    /**
    5960     * get variable name
     
    6162     */
    6263    inline std::string getName(){ return name; }
    63    
     64
    6465    /**
    6566     * set variable name
     
    6768     */
    6869    inline void setName( std::string name ) { this->name = name; }
    69    
     70
    7071    /**
    7172     * get priority
     
    7374     */
    7475    inline int getPriority() { return this->priority; }
    75    
     76
    7677    /**
    7778     * set priority
     
    7980     */
    8081    inline void setPriority( int p ) { this->priority = p; }
    81    
     82
    8283    /**
    8384     * reset priority to variable specific default value
    8485     */
    85     inline void resetPriority() { this->priority = this->real_priority; }
     86    inline void resetPriority() { this->priority = this->realPriority; }
    8687
    8788
     
    9596    int permission;     //!< who is allowed to change this var
    9697    int priority;       //!< priority assigned to var
    97     int real_priority;  //!< priority assigned to var, increased every time not sent
    98    
    99    
     98    int realPriority;  //!< priority assigned to var, increased every time not sent
     99
     100
    100101    std::string name;    //!< variable name (for debugging)
    101102
Note: See TracChangeset for help on using the changeset viewer.