Ignore:
Timestamp:
02/04/13 18:47:38 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Moved the registration code into MultiBuffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/client/c/hu/varadiistvan/xplra/MultiSetter.cc

    r21 r22  
    4747
    4848//------------------------------------------------------------------------------
     49
     50MultiSetter::MultiSetter(XPlane& xplane) throw() :
     51    MultiBuffer(xplane, Protocol::COMMAND_REGISTER_SET_MULTI,
     52                Protocol::COMMAND_UNREGISTER_SET_MULTI)
     53{
     54}
     55
    4956//------------------------------------------------------------------------------
    5057
     
    7683      }
    7784    }
    78 }
    79 
    80 //------------------------------------------------------------------------------
    81 
    82 uint8_t MultiSetter::doRegister() throw(Exception)
    83 {
    84     // FIXME: only the commands differ from those of MultiGetter
    85     xplane.stream->writeU8(Protocol::COMMAND_REGISTER_SET_MULTI);
    86     xplane.stream->writeU32(dataRefs.size());
    87 
    88     for(vector<DataRef>::const_iterator i = dataRefs.begin();
    89         i!=dataRefs.end(); ++i)
    90     {
    91         const DataRef& dataRef = *i;
    92         xplane.stream->writeString(dataRef.name);
    93         xplane.stream->writeU8(dataRef.type);
    94         if (dataRef.isArray()) {
    95             xplane.stream->writeS32(dataRef.length);
    96             xplane.stream->writeS32(dataRef.offset);
    97         }
    98     }
    99 
    100     return Protocol::COMMAND_UNREGISTER_SET_MULTI;
    10185}
    10286
Note: See TracChangeset for help on using the changeset viewer.