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/MultiGetter.cc

    r19 r22  
    5050//------------------------------------------------------------------------------
    5151
     52MultiGetter::MultiGetter(XPlane& xplane) throw() :
     53    MultiBuffer(xplane, Protocol::COMMAND_REGISTER_GET_MULTI,
     54                Protocol::COMMAND_UNREGISTER_GET_MULTI)
     55{
     56}
     57
     58//------------------------------------------------------------------------------
     59
    5260inline void MultiGetter::read(const DataRef& dataRef) throw(Exception)
    5361{
     
    7987      }
    8088    }
    81 }
    82 
    83 //------------------------------------------------------------------------------
    84 
    85 uint8_t MultiGetter::doRegister() throw(Exception)
    86 {
    87     xplane.stream->writeU8(Protocol::COMMAND_REGISTER_GET_MULTI);
    88     xplane.stream->writeU32(dataRefs.size());
    89 
    90     for(vector<DataRef>::const_iterator i = dataRefs.begin();
    91         i!=dataRefs.end(); ++i)
    92     {
    93         const DataRef& dataRef = *i;
    94         xplane.stream->writeString(dataRef.name);
    95         xplane.stream->writeU8(dataRef.type);
    96         if (dataRef.isArray()) {
    97             xplane.stream->writeS32(dataRef.length);
    98             xplane.stream->writeS32(dataRef.offset);
    99         }
    100     }
    101 
    102     return Protocol::COMMAND_UNREGISTER_GET_MULTI;
    10389}
    10490
Note: See TracChangeset for help on using the changeset viewer.