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

Using the multi-get and multi-set commands in unregistered multi-dataref getters and setters, respectively

File:
1 edited

Legend:

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

    r22 r33  
    9999    xplane.checkResult();
    100100
    101     for(vector<DataRef>::const_iterator i = dataRefs.begin();
    102         i!=dataRefs.end(); ++i)
    103     {
    104         xplane.checkStream();
    105         const DataRef& dataRef = *i;
    106         read(dataRef);
    107     }
     101    readValues();
    108102}
    109103
     
    113107void MultiGetter::doExecuteUnregistered() throw(Exception)
    114108{
     109    writeSpec(Protocol::COMMAND_GET_MULTI);
     110
     111    readValues();
     112}
     113
     114//------------------------------------------------------------------------------
     115
     116void MultiGetter::readValues() throw(Exception)
     117{
    115118    for(vector<DataRef>::const_iterator i = dataRefs.begin();
    116119        i!=dataRefs.end(); ++i)
    117120    {
     121        xplane.checkStream();
    118122        const DataRef& dataRef = *i;
    119         xplane.stream->writeU8(Protocol::COMMAND_GET_SINGLE);
    120         xplane.stream->writeString(dataRef.name);
    121         xplane.stream->writeU8(dataRef.type);
    122         if (dataRef.isArray()) {
    123             xplane.stream->writeS32(dataRef.length);
    124             xplane.stream->writeS32(dataRef.offset);
    125         }
    126         xplane.stream->flush();
    127         xplane.checkResult();
    128123        read(dataRef);
    129124    }
Note: See TracChangeset for help on using the changeset viewer.