Changeset 33:080fa73274f8 in xplra for src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc
- Timestamp:
- 02/09/13 11:19:09 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc
r26 r33 339 339 xplane.checkStream(); 340 340 341 xplane.stream->writeU8(registerCommand); 342 xplane.stream->writeU32(dataRefs.size()); 343 344 for(vector<DataRef>::const_iterator i = dataRefs.begin(); 345 i!=dataRefs.end(); ++i) 346 { 347 const DataRef& dataRef = *i; 348 xplane.stream->writeString(dataRef.name); 349 xplane.stream->writeU8(dataRef.type); 350 if (dataRef.isArray()) { 351 xplane.stream->writeS32(dataRef.length); 352 xplane.stream->writeS32(dataRef.offset); 353 } 354 } 355 356 xplane.stream->flush(); 357 358 uint8_t result = xplane.stream->readU8(); 341 writeSpec(registerCommand); 342 359 343 uint32_t id = xplane.stream->readU32(); 360 344 xplane.checkStream(); 361 xplane.checkResult(result);362 345 363 346 registeredID = static_cast<int>(id); … … 609 592 //------------------------------------------------------------------------------ 610 593 594 void MultiBuffer::writeSpec(uint8_t command) const throw(Exception) 595 { 596 xplane.stream->writeU8(command); 597 xplane.stream->writeU32(dataRefs.size()); 598 599 for(vector<DataRef>::const_iterator i = dataRefs.begin(); 600 i!=dataRefs.end(); ++i) 601 { 602 const DataRef& dataRef = *i; 603 xplane.stream->writeString(dataRef.name); 604 xplane.stream->writeU8(dataRef.type); 605 if (dataRef.isArray()) { 606 xplane.stream->writeS32(dataRef.length); 607 xplane.stream->writeS32(dataRef.offset); 608 } 609 } 610 611 xplane.stream->flush(); 612 xplane.checkResult(); 613 } 614 615 //------------------------------------------------------------------------------ 616 611 617 // Local Variables: 612 618 // mode: C++
Note:
See TracChangeset
for help on using the changeset viewer.