Changeset 9406 in orxonox.OLD for trunk/src/lib/network/synchronizeable_var/synchronizeable_var.h
- Timestamp:
- Jul 24, 2006, 11:09:47 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/network/synchronizeable_var/synchronizeable_var.h
r7954 r9406 7 7 #define _SYNCHRONIZEABLE_VAR_H 8 8 9 #include "nettypes.h" 9 10 #include <string> 10 #include "netdefs.h"11 #include <assert.h>12 11 13 12 enum { 14 PERMISSION_SERVER = 1, 15 PERMISSION_OWNER = 2, 16 PERMISSION_ALL = 4 13 PERMISSION_MASTER_SERVER = 1, 14 PERMISSION_PROXY_SERVER = 2, 15 PERMISSION_OWNER = 4, 16 PERMISSION_ALL = 8 17 17 }; 18 18 … … 20 20 21 21 public: 22 SynchronizeableVar( void * ptrIn, void * ptrOut, std::string name, int length, int permission = PERMISSION_ SERVER, int priority = 0 );22 SynchronizeableVar( void * ptrIn, void * ptrOut, std::string name, int length, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 23 23 virtual ~SynchronizeableVar(); 24 24 … … 28 28 */ 29 29 inline bool beWatched(){ return this->bWatched; } 30 31 /** 30 31 /** 32 32 * set flag if synchronizeable wants to be informed on changes 33 33 */ … … 96 96 */ 97 97 inline void resetPriority() { this->priority = this->realPriority; } 98 98 99 99 /** 100 100 * reads actual size from buffer. this is used when size is not constant … … 104 104 */ 105 105 virtual inline int getSizeFromBuf( byte * buf, int maxLength ){ return this->getSize(); } 106 106 107 107 /** 108 108 * set variable id … … 110 110 */ 111 111 inline void setVarId( int id ){ this->varId = id; } 112 113 /** 112 113 /** 114 114 * get variable id 115 115 * @return variable id 116 116 */ 117 117 inline int getVarId(){ return varId; } 118 118 119 119 /** 120 120 * set hasChanged … … 122 122 */ 123 123 inline void setHasChanged( bool changed ){ this->changed = changed; } 124 125 /** 124 125 /** 126 126 * get hasChanged 127 127 * @return variable id 128 128 */ 129 129 inline bool getHasChanged(){ return changed; } 130 130 131 131 /** 132 132 * print out variable value … … 137 137 private: 138 138 bool bWatched; //!< true if synchronizeable wants to be informed on changes 139 139 140 140 int permission; //!< who is allowed to change this var 141 141 int priority; //!< priority assigned to var 142 142 int realPriority; //!< priority assigned to var, increased every time not sent 143 143 int varId; //!< id to identify varables 144 144 145 145 bool changed; //!< true if last readFromBuf changed anything 146 146
Note: See TracChangeset
for help on using the changeset viewer.