Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 30, 2006, 1:50:25 PM (18 years ago)
Author:
rennerc
Message:

finished some SynchronizeableVars classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/synchronizeable_var/synchronizeable_float.cc

    r7444 r7459  
    1616
    1717#include "synchronizeable_float.h"
     18#include "converter.h"
    1819
    1920
     
    2223 * @todo this constructor is not jet implemented - do it
    2324*/
    24 SynchronizeableFloat::SynchronizeableFloat( float * ptrIn, float * ptrOut, std::string name, int permission, int priority) : SynchronizeableVar( ptrIn, ptrOut, name, 0, permission, priority )
     25SynchronizeableFloat::SynchronizeableFloat( float * ptrIn, float * ptrOut, std::string name, int permission, int priority) : SynchronizeableVar( ptrIn, ptrOut, name, FLOATSIZE, permission, priority )
    2526{
    2627  this->vPtrIn = ptrIn;
     
    4445int SynchronizeableFloat::writeToBuf( byte * buf, int maxLength )
    4546{
    46 #warning implement this
     47  int res = Converter::floatToByteArray( *vPtrIn, buf, maxLength );
     48 
     49  assert( res == FLOATSIZE );
     50 
     51  return res;
    4752}
    4853
     
    5560int SynchronizeableFloat::readFromBuf( byte * buf, int maxLength )
    5661{
    57 #warning implement this
     62  assert( maxLength >= FLOATSIZE );
     63 
     64  int res = Converter::byteArrayToFloat( buf, vPtrOut );
     65 
     66  assert( res == FLOATSIZE );
     67 
     68  return res;
    5869}
Note: See TracChangeset for help on using the changeset viewer.