Changeset 9334 in orxonox.OLD for branches/proxy/src/lib/network/synchronizeable_var
- Timestamp:
- Jul 19, 2006, 10:29:14 PM (19 years ago)
- Location:
- branches/proxy/src/lib/network/synchronizeable_var
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_ip.cc
r9308 r9334 16 16 #include "synchronizeable_ip.h" 17 17 #include "converter.h" 18 18 // #include "ip.h" 19 19 20 20 /** … … 22 22 * @todo this constructor is not jet implemented - do it 23 23 */ 24 SynchronizeableIP::SynchronizeableIP( IP address * ptrIn, IPaddress* ptrOut, std::string name, int permission, int priority) : SynchronizeableVar( ptrIn, ptrOut, name, 2*INTSIZE, permission, priority )24 SynchronizeableIP::SynchronizeableIP( IP * ptrIn, IP * ptrOut, std::string name, int permission, int priority) : SynchronizeableVar( ptrIn, ptrOut, name, 2*INTSIZE, permission, priority ) 25 25 { 26 26 this->vPtrIn = ptrIn; … … 47 47 int res; 48 48 49 res = Converter::intToByteArray( (int)vPtrIn-> host, buf, maxLength );49 res = Converter::intToByteArray( (int)vPtrIn->ip(), buf, maxLength ); 50 50 assert(res > 0); 51 51 n += res; 52 52 53 res = Converter::intToByteArray( (int)vPtrIn->port , buf, maxLength);53 res = Converter::intToByteArray( (int)vPtrIn->port(), buf, maxLength); 54 54 assert(res > 0); 55 55 n += res; … … 75 75 int n = 0; 76 76 77 IPaddress oldIP = *vPtrOut; 78 IPaddress newIP; 77 IP oldIP = *vPtrOut; 79 78 80 79 res = Converter::byteArrayToInt( buf + n, &host); … … 87 86 n += res; 88 87 89 newIP.host = host; 90 newIP.port = port; 88 *this->vPtrOut = IP(host, port); 91 89 92 setHasChanged( (newIP.host != oldIP.host || newIP.port != oldIP.port));90 setHasChanged( *this->vPtrOut != oldIP); 93 91 94 92 assert( n == 2 * INTSIZE); … … 103 101 void SynchronizeableIP::SynchronizeableIP::debug( ) 104 102 { 105 printf("SYNCHRONIZEABLE_VAR: %s IN: %i, %i OUT: %i, %i\n", name.c_str(), vPtrIn-> host, vPtrIn->port, vPtrOut->host, vPtrOut->port);103 printf("SYNCHRONIZEABLE_VAR: %s IN: %i, %i OUT: %i, %i\n", name.c_str(), vPtrIn->ip(), vPtrIn->port(), vPtrOut->ip(), vPtrOut->port()); 106 104 } 107 105 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_ip.h
r9293 r9334 12 12 13 13 #include "netdefs.h" 14 #include "ip.h" 14 15 15 16 class SynchronizeableIP : public SynchronizeableVar { 16 17 17 18 public: 18 SynchronizeableIP( IP address *ptrIn, IPaddress* ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 );19 SynchronizeableIP( IP *ptrIn, IP * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 19 20 virtual ~SynchronizeableIP(); 20 21 … … 32 33 33 34 private: 34 IP address* vPtrIn; //!< pointer to data (read)35 IP address* vPtrOut; //!< pointer to data (write)35 IP * vPtrIn; //!< pointer to data (read) 36 IP * vPtrOut; //!< pointer to data (write) 36 37 37 38 };
Note: See TracChangeset
for help on using the changeset viewer.