Changeset 107:614b9ff033c1 in xplra for src/client/c/hu/varadiistvan/xplra/XPlane.cc
- Timestamp:
- 12/15/22 19:26:40 (17 months ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/client/c/hu/varadiistvan/xplra/XPlane.cc
r92 r107 63 63 //------------------------------------------------------------------------------ 64 64 65 void XPlane::checkStream() throw(NotConnectedException, IOException)65 void XPlane::checkStream() 66 66 { 67 67 if (stream==0) { … … 74 74 //------------------------------------------------------------------------------ 75 75 76 void XPlane::checkResult(uint8_t result, bool hasParameter, long parameter) 77 throw(ProtocolException) 76 void XPlane::checkResult(uint8_t result, bool hasParameter, long parameter) 78 77 { 79 78 switch(result) { … … 113 112 //------------------------------------------------------------------------------ 114 113 115 void XPlane::checkResult(bool multi) throw(ProtocolException, IOException)114 void XPlane::checkResult(bool multi) 116 115 { 117 116 uint8_t result = stream->readU8(); … … 131 130 //------------------------------------------------------------------------------ 132 131 133 XPlane::~XPlane() throw()132 XPlane::~XPlane() noexcept 134 133 { 135 134 disconnect(); … … 145 144 //------------------------------------------------------------------------------ 146 145 147 void XPlane::connect() throw(IOException)146 void XPlane::connect() 148 147 { 149 148 if (socket!=0) return; … … 180 179 //------------------------------------------------------------------------------ 181 180 182 void XPlane::disconnect() throw()181 void XPlane::disconnect() noexcept 183 182 { 184 183 if (socket==0) return; … … 190 189 //------------------------------------------------------------------------------ 191 190 192 MultiGetter& XPlane::createMultiGetter() throw()191 MultiGetter& XPlane::createMultiGetter() noexcept 193 192 { 194 193 MultiGetter* getter = new MultiGetter(*this); … … 199 198 //------------------------------------------------------------------------------ 200 199 201 MultiSetter& XPlane::createMultiSetter() throw()200 MultiSetter& XPlane::createMultiSetter() noexcept 202 201 { 203 202 MultiSetter* setter = new MultiSetter(*this); … … 208 207 //------------------------------------------------------------------------------ 209 208 210 bool XPlane::destroyMultiBuffer(MultiBuffer& buffer) throw(Exception)209 bool XPlane::destroyMultiBuffer(MultiBuffer& buffer) 211 210 { 212 211 multiBuffers_t::iterator i = multiBuffers.find(&buffer); … … 221 220 //------------------------------------------------------------------------------ 222 221 223 void XPlane::getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion) 224 throw(Exception) 222 void XPlane::getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion) 225 223 { 226 224 stream->writeU8(Protocol::COMMAND_GET_VERSIONS); … … 237 235 //------------------------------------------------------------------------------ 238 236 239 void XPlane::reloadPlugins() throw(Exception)237 void XPlane::reloadPlugins() 240 238 { 241 239 stream->writeU8(Protocol::COMMAND_RELOAD_PLUGINS); … … 246 244 //------------------------------------------------------------------------------ 247 245 248 void XPlane::saveSituation(const char* path) throw(Exception)246 void XPlane::saveSituation(const char* path) 249 247 { 250 248 stream->writeU8(Protocol::COMMAND_SAVE_SITUATION); … … 256 254 //------------------------------------------------------------------------------ 257 255 258 void XPlane::getScalar(const char* name, uint8_t type) throw(Exception)256 void XPlane::getScalar(const char* name, uint8_t type) 259 257 { 260 258 checkStream(); … … 270 268 //------------------------------------------------------------------------------ 271 269 272 int XPlane::getInt(const char* name) throw(Exception)270 int XPlane::getInt(const char* name) 273 271 { 274 272 getScalar(name, Protocol::TYPE_INT); … … 281 279 //------------------------------------------------------------------------------ 282 280 283 float XPlane::getFloat(const char* name) throw(Exception)281 float XPlane::getFloat(const char* name) 284 282 { 285 283 getScalar(name, Protocol::TYPE_FLOAT); … … 292 290 //------------------------------------------------------------------------------ 293 291 294 double XPlane::getDouble(const char* name) throw(Exception)292 double XPlane::getDouble(const char* name) 295 293 { 296 294 getScalar(name, Protocol::TYPE_DOUBLE); … … 304 302 305 303 size_t XPlane::getArray(const char* name, uint8_t type, 306 ssize_t length, size_t offset) throw(Exception)304 ssize_t length, size_t offset) 307 305 { 308 306 checkStream(); … … 326 324 327 325 size_t XPlane::getFloatArray(const char* name, float* dest, 328 size_t length, size_t offset) throw(Exception)326 size_t length, size_t offset) 329 327 { 330 328 length = getArray(name, Protocol::TYPE_FLOAT_ARRAY, length, offset); … … 338 336 339 337 float* XPlane::getFloatArray(const char* name, size_t& length, 340 size_t offset) throw(Exception)338 size_t offset) 341 339 { 342 340 length = getArray(name, Protocol::TYPE_FLOAT_ARRAY, -1, offset); … … 350 348 351 349 size_t XPlane::getIntArray(const char* name, int32_t* dest, 352 size_t length, size_t offset) throw(Exception)350 size_t length, size_t offset) 353 351 { 354 352 length = getArray(name, Protocol::TYPE_INT_ARRAY, length, offset); … … 362 360 363 361 int32_t* XPlane::getIntArray(const char* name, size_t& length, 364 size_t offset) throw(Exception)362 size_t offset) 365 363 { 366 364 length = getArray(name, Protocol::TYPE_INT_ARRAY, -1, offset); … … 374 372 375 373 size_t XPlane::getByteArray(const char* name, uint8_t* dest, 376 size_t length, size_t offset) throw(Exception)374 size_t length, size_t offset) 377 375 { 378 376 length = getArray(name, Protocol::TYPE_BYTE_ARRAY, length, offset); … … 386 384 387 385 uint8_t* XPlane::getByteArray(const char* name, size_t& length, 388 size_t offset) throw(Exception)386 size_t offset) 389 387 { 390 388 length = getArray(name, Protocol::TYPE_BYTE_ARRAY, -1, offset); … … 397 395 //------------------------------------------------------------------------------ 398 396 399 string XPlane::getString(const char* name, size_t offset) throw(Exception)397 string XPlane::getString(const char* name, size_t offset) 400 398 { 401 399 size_t length = 0; … … 406 404 //------------------------------------------------------------------------------ 407 405 408 void XPlane::setScalar(const char* name, uint8_t type) throw(Exception)406 void XPlane::setScalar(const char* name, uint8_t type) 409 407 { 410 408 stream->writeU8(Protocol::COMMAND_SET_SINGLE); … … 415 413 //------------------------------------------------------------------------------ 416 414 417 void XPlane::setInt(const char* name, int value) throw(Exception)415 void XPlane::setInt(const char* name, int value) 418 416 { 419 417 setScalar(name, Protocol::TYPE_INT); … … 425 423 //------------------------------------------------------------------------------ 426 424 427 void XPlane::setFloat(const char* name, float value) throw(Exception)425 void XPlane::setFloat(const char* name, float value) 428 426 { 429 427 setScalar(name, Protocol::TYPE_FLOAT); … … 435 433 //------------------------------------------------------------------------------ 436 434 437 void XPlane::setDouble(const char* name, double value) throw(Exception)435 void XPlane::setDouble(const char* name, double value) 438 436 { 439 437 setScalar(name, Protocol::TYPE_DOUBLE); … … 446 444 447 445 void XPlane::setArray(const char* name, uint8_t type, size_t length, 448 size_t offset) throw(Exception)446 size_t offset) 449 447 { 450 448 stream->writeU8(Protocol::COMMAND_SET_SINGLE); … … 458 456 459 457 void XPlane::setFloatArray(const char* name, const float* values, size_t length, 460 size_t offset) throw(Exception)458 size_t offset) 461 459 { 462 460 setArray(name, Protocol::TYPE_FLOAT_ARRAY, length, offset); … … 469 467 470 468 void XPlane::setIntArray(const char* name, const int32_t* values, size_t length, 471 size_t offset) throw(Exception)469 size_t offset) 472 470 { 473 471 setArray(name, Protocol::TYPE_INT_ARRAY, length, offset); … … 480 478 481 479 void XPlane::setByteArray(const char* name, const uint8_t* values, size_t length, 482 size_t offset) throw(Exception)480 size_t offset) 483 481 { 484 482 setArray(name, Protocol::TYPE_BYTE_ARRAY, length, offset); … … 491 489 492 490 void XPlane::setString(const char* name, const char* value, size_t length, 493 size_t offset) throw(Exception)491 size_t offset) 494 492 { 495 493 size_t valueLength = strlen(value); … … 507 505 //------------------------------------------------------------------------------ 508 506 509 void XPlane::showMessage(const char* message, float duration) throw(Exception)507 void XPlane::showMessage(const char* message, float duration) 510 508 { 511 509 stream->writeU8(Protocol::COMMAND_SHOW_MESSAGE); … … 519 517 520 518 void XPlane::registerHotkeys(const uint16_t* codes, size_t length) 521 throw(Exception)519 522 520 { 523 521 stream->writeU8(Protocol::COMMAND_REGISTER_HOTKEYS); … … 530 528 //------------------------------------------------------------------------------ 531 529 532 void XPlane::queryHotkeys(uint8_t* states, size_t length) throw(Exception)530 void XPlane::queryHotkeys(uint8_t* states, size_t length) 533 531 { 534 532 stream->writeU8(Protocol::COMMAND_QUERY_HOTKEYS);
Note:
See TracChangeset
for help on using the changeset viewer.