Changeset 7559 in orxonox.OLD for branches/network/src/lib/network/synchronizeable_var/synchronizeable_var.h
- Timestamp:
- May 10, 2006, 12:11:43 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/synchronizeable_var/synchronizeable_var.h
r7508 r7559 9 9 #include <string> 10 10 #include "netdefs.h" 11 #include <assert.h> 11 12 12 13 class SynchronizeableVar { … … 15 16 SynchronizeableVar( void * ptrIn, void * ptrOut, std::string name, int length, int permission = 0, int priority = 0 ); 16 17 virtual ~SynchronizeableVar(); 17 18 18 19 /** 19 20 * check if synchronizeable wants to be informed on changes … … 21 22 */ 22 23 inline bool beWatched(){ return this->bWatched; } 23 24 24 25 /** 25 26 * write var data to byte buffer … … 29 30 */ 30 31 virtual int writeToBuf( byte * buf, int maxLength ) = 0; 31 32 32 33 /** 33 34 * read var data from byte buffer … … 37 38 */ 38 39 virtual int readFromBuf( byte * buf, int maxLength ) = 0; 39 40 40 41 /** 41 42 * check if writeToBuf will return the same size every time … … 43 44 */ 44 45 virtual bool hasStaticSize() = 0; 45 46 46 47 /** 47 48 * get size writeToBuf needs … … 49 50 */ 50 51 virtual int getSize(){ return length; } 51 52 52 53 /** 53 54 * check for permission to write … … 55 56 */ 56 57 inline bool checkPremission( int permission ){ return (permission & this->permission) != 0; } 57 58 58 59 /** 59 60 * get variable name … … 61 62 */ 62 63 inline std::string getName(){ return name; } 63 64 64 65 /** 65 66 * set variable name … … 67 68 */ 68 69 inline void setName( std::string name ) { this->name = name; } 69 70 70 71 /** 71 72 * get priority … … 73 74 */ 74 75 inline int getPriority() { return this->priority; } 75 76 76 77 /** 77 78 * set priority … … 79 80 */ 80 81 inline void setPriority( int p ) { this->priority = p; } 81 82 82 83 /** 83 84 * reset priority to variable specific default value 84 85 */ 85 inline void resetPriority() { this->priority = this->real _priority; }86 inline void resetPriority() { this->priority = this->realPriority; } 86 87 87 88 … … 95 96 int permission; //!< who is allowed to change this var 96 97 int priority; //!< priority assigned to var 97 int real _priority; //!< priority assigned to var, increased every time not sent98 99 98 int realPriority; //!< priority assigned to var, increased every time not sent 99 100 100 101 std::string name; //!< variable name (for debugging) 101 102
Note: See TracChangeset
for help on using the changeset viewer.