Changeset 107:614b9ff033c1 in xplra for src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc
Legend:
- Unmodified
- Added
- Removed
-
src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc
r66 r107 54 54 inline MultiBuffer::DataRef::DataRef(const string& name, uint8_t type, 55 55 const DataRef* previous, 56 size_t length, size_t offset) throw():56 size_t length, size_t offset) noexcept : 57 57 name(name), 58 58 type(type), … … 71 71 //------------------------------------------------------------------------------ 72 72 73 inline size_t MultiBuffer::DataRef::getSize() const throw()73 inline size_t MultiBuffer::DataRef::getSize() const noexcept 74 74 { 75 75 switch (type) { … … 93 93 //------------------------------------------------------------------------------ 94 94 95 inline size_t MultiBuffer::DataRef::getAlignment() const throw()95 inline size_t MultiBuffer::DataRef::getAlignment() const noexcept 96 96 { 97 97 switch (type) { … … 112 112 //------------------------------------------------------------------------------ 113 113 114 bool MultiBuffer::DataRef::isArray() const throw()114 bool MultiBuffer::DataRef::isArray() const noexcept 115 115 { 116 116 return … … 124 124 inline size_t 125 125 MultiBuffer::DataRef::getCopyLength(size_t userLength, size_t userOffset) 126 const throw()126 const noexcept 127 127 { 128 128 size_t maxLength = … … 134 134 //------------------------------------------------------------------------------ 135 135 136 inline void MultiBuffer::unfinalize() throw()136 inline void MultiBuffer::unfinalize() noexcept 137 137 { 138 138 delete data; data = 0; … … 141 141 //------------------------------------------------------------------------------ 142 142 143 void MultiBuffer::forgetRegistration() throw()143 void MultiBuffer::forgetRegistration() noexcept 144 144 { 145 145 registeredID = -1; … … 148 148 //------------------------------------------------------------------------------ 149 149 150 inline const MultiBuffer::DataRef* MultiBuffer::getLastDataRef() const throw()150 inline const MultiBuffer::DataRef* MultiBuffer::getLastDataRef() const noexcept 151 151 { 152 152 return dataRefs.empty() ? 0 : &(dataRefs.back()); … … 156 156 157 157 inline const MultiBuffer::DataRef& MultiBuffer::getDataRef(size_t id, uint8_t type) const 158 throw(InvalidIDException, TypeMismatchException)159 158 { 160 159 if (id>=dataRefs.size()) throw InvalidIDException(); … … 167 166 168 167 inline void* MultiBuffer::getData(size_t id, uint8_t type) 169 throw(InvalidIDException, TypeMismatchException)170 168 { 171 169 const DataRef& dataRef = getDataRef(id, type); … … 177 175 178 176 inline const void* MultiBuffer::getData(size_t id, uint8_t type) const 179 throw(InvalidIDException, TypeMismatchException)180 177 { 181 178 const DataRef& dataRef = getDataRef(id, type); … … 189 186 inline MultiBuffer::setArray(size_t id, const T* value, 190 187 size_t length, size_t offset) 191 throw(InvalidIDException, TypeMismatchException)192 188 { 193 189 const DataRef& dataRef = getDataRef(id, type); … … 209 205 inline size_t MultiBuffer::getArray(size_t id, T* value, 210 206 size_t length, size_t offset) const 211 throw(InvalidIDException, TypeMismatchException)212 207 { 213 208 const DataRef& dataRef = getDataRef(id, type); … … 228 223 template <typename T, uint8_t type> 229 224 inline const T* MultiBuffer::getArray(size_t id, size_t offset) const 230 throw(InvalidIDException, TypeMismatchException)231 225 { 232 226 const DataRef& dataRef = getDataRef(id, type); … … 240 234 241 235 MultiBuffer::MultiBuffer(XPlane& xplane, uint8_t registerCommand, 242 uint8_t unregisterCommand) throw():236 uint8_t unregisterCommand) noexcept : 243 237 data(0), 244 238 xplane(xplane), … … 251 245 //------------------------------------------------------------------------------ 252 246 253 MultiBuffer::~MultiBuffer() throw()247 MultiBuffer::~MultiBuffer() noexcept 254 248 { 255 249 unregisterSafelyFromXPlane(); … … 259 253 //------------------------------------------------------------------------------ 260 254 261 size_t MultiBuffer::addInt(const std::string& name) throw()255 size_t MultiBuffer::addInt(const std::string& name) noexcept 262 256 { 263 257 unfinalize(); … … 268 262 //------------------------------------------------------------------------------ 269 263 270 size_t MultiBuffer::addFloat(const std::string& name) throw()264 size_t MultiBuffer::addFloat(const std::string& name) noexcept 271 265 { 272 266 unfinalize(); … … 277 271 //------------------------------------------------------------------------------ 278 272 279 size_t MultiBuffer::addDouble(const std::string& name) throw()273 size_t MultiBuffer::addDouble(const std::string& name) noexcept 280 274 { 281 275 unfinalize(); … … 287 281 288 282 size_t MultiBuffer::addFloatArray(const std::string& name, size_t length, 289 size_t offset) throw()283 size_t offset) noexcept 290 284 { 291 285 unfinalize(); … … 298 292 299 293 size_t MultiBuffer::addIntArray(const std::string& name, size_t length, 300 size_t offset) throw()294 size_t offset) noexcept 301 295 { 302 296 unfinalize(); … … 309 303 310 304 size_t MultiBuffer::addByteArray(const std::string& name, size_t length, 311 size_t offset) throw()305 size_t offset) noexcept 312 306 { 313 307 unfinalize(); … … 334 328 //------------------------------------------------------------------------------ 335 329 336 void MultiBuffer::registerInXPlane() throw(Exception)330 void MultiBuffer::registerInXPlane() 337 331 { 338 332 if (finalize() && registeredID<0) { … … 350 344 //------------------------------------------------------------------------------ 351 345 352 void MultiBuffer::unregisterFromXPlane() throw(Exception)346 void MultiBuffer::unregisterFromXPlane() 353 347 { 354 348 if (registeredID>=0) { … … 363 357 //------------------------------------------------------------------------------ 364 358 365 bool MultiBuffer::unregisterSafelyFromXPlane() throw()359 bool MultiBuffer::unregisterSafelyFromXPlane() noexcept 366 360 { 367 361 try { … … 376 370 //------------------------------------------------------------------------------ 377 371 378 void MultiBuffer::execute() throw(Exception)372 void MultiBuffer::execute() 379 373 { 380 374 if (data==0 && registeredID>=0) { … … 395 389 396 390 void MultiBuffer::setInt(size_t id, int value) 397 throw(InvalidIDException, TypeMismatchException)398 391 { 399 392 *reinterpret_cast<int32_t*>(getData(id, Protocol::TYPE_INT)) = value; … … 403 396 404 397 int MultiBuffer::getInt(size_t id) const 405 throw(InvalidIDException, TypeMismatchException)406 398 { 407 399 return *reinterpret_cast<const int32_t*>(getData(id, Protocol::TYPE_INT)); … … 411 403 412 404 const int32_t& MultiBuffer::getIntRef(size_t id) const 413 throw(InvalidIDException, TypeMismatchException)414 405 { 415 406 return *reinterpret_cast<const int32_t*>(getData(id, Protocol::TYPE_INT)); … … 419 410 420 411 int32_t& MultiBuffer::getIntRef(size_t id) 421 throw(InvalidIDException, TypeMismatchException)422 412 { 423 413 return *reinterpret_cast<int32_t*>(getData(id, Protocol::TYPE_INT)); … … 427 417 428 418 void MultiBuffer::setFloat(size_t id, float value) 429 throw(InvalidIDException, TypeMismatchException)430 419 { 431 420 *reinterpret_cast<float*>(getData(id, Protocol::TYPE_FLOAT)) = value; … … 435 424 436 425 float MultiBuffer::getFloat(size_t id) const 437 throw(InvalidIDException, TypeMismatchException)438 426 { 439 427 return *reinterpret_cast<const float*>(getData(id, Protocol::TYPE_FLOAT)); … … 443 431 444 432 const float& MultiBuffer::getFloatRef(size_t id) const 445 throw(InvalidIDException, TypeMismatchException)446 433 { 447 434 return *reinterpret_cast<const float*>(getData(id, Protocol::TYPE_FLOAT)); … … 451 438 452 439 float& MultiBuffer::getFloatRef(size_t id) 453 throw(InvalidIDException, TypeMismatchException)454 440 { 455 441 return *reinterpret_cast<float*>(getData(id, Protocol::TYPE_FLOAT)); … … 459 445 460 446 void MultiBuffer::setDouble(size_t id, double value) 461 throw(InvalidIDException, TypeMismatchException)462 447 { 463 448 *reinterpret_cast<double*>(getData(id, Protocol::TYPE_DOUBLE)) = value; … … 467 452 468 453 double MultiBuffer::getDouble(size_t id) const 469 throw(InvalidIDException, TypeMismatchException)470 454 { 471 455 return *reinterpret_cast<const double*>(getData(id, Protocol::TYPE_DOUBLE)); … … 475 459 476 460 const double& MultiBuffer::getDoubleRef(size_t id) const 477 throw(InvalidIDException, TypeMismatchException)478 461 { 479 462 return *reinterpret_cast<const double*>(getData(id, Protocol::TYPE_DOUBLE)); … … 483 466 484 467 double& MultiBuffer::getDoubleRef(size_t id) 485 throw(InvalidIDException, TypeMismatchException)486 468 { 487 469 return *reinterpret_cast<double*>(getData(id, Protocol::TYPE_DOUBLE)); … … 492 474 size_t MultiBuffer::setFloatArray(size_t id, const float* value, 493 475 size_t length, size_t offset) 494 throw(InvalidIDException, TypeMismatchException)495 476 { 496 477 return setArray<float, Protocol::TYPE_FLOAT_ARRAY>(id, value, length, offset); … … 501 482 size_t MultiBuffer::getFloatArray(size_t id, float* value, 502 483 size_t length, size_t offset) const 503 throw(InvalidIDException, TypeMismatchException)504 484 { 505 485 return getArray<float, Protocol::TYPE_FLOAT_ARRAY>(id, value, length, offset); … … 509 489 510 490 const float* MultiBuffer::getFloatArray(size_t id, size_t offset) const 511 throw(InvalidIDException, TypeMismatchException)512 491 { 513 492 return getArray<float, Protocol::TYPE_FLOAT_ARRAY>(id, offset); … … 518 497 size_t MultiBuffer::setIntArray(size_t id, const int32_t* value, 519 498 size_t length, size_t offset) 520 throw(InvalidIDException, TypeMismatchException) 499 521 500 { 522 501 return setArray<int32_t, Protocol::TYPE_INT_ARRAY>(id, value, length, offset); … … 527 506 size_t MultiBuffer::getIntArray(size_t id, int32_t* value, 528 507 size_t length, size_t offset) const 529 throw(InvalidIDException, TypeMismatchException)530 508 { 531 509 return getArray<int32_t, Protocol::TYPE_INT_ARRAY>(id, value, length, offset); … … 535 513 536 514 const int32_t* MultiBuffer::getIntArray(size_t id, size_t offset) const 537 throw(InvalidIDException, TypeMismatchException)538 515 { 539 516 return getArray<int32_t, Protocol::TYPE_INT_ARRAY>(id, offset); … … 544 521 size_t MultiBuffer::setByteArray(size_t id, const uint8_t* value, 545 522 size_t length, size_t offset) 546 throw(InvalidIDException, TypeMismatchException)547 523 { 548 524 return setArray<uint8_t, Protocol::TYPE_BYTE_ARRAY>(id, value, length, offset); … … 553 529 size_t MultiBuffer::getByteArray(size_t id, uint8_t* value, 554 530 size_t length, size_t offset) const 555 throw(InvalidIDException, TypeMismatchException)556 531 { 557 532 return getArray<uint8_t, Protocol::TYPE_BYTE_ARRAY>(id, value, length, offset); … … 561 536 562 537 const uint8_t* MultiBuffer::getByteArray(size_t id, size_t offset) const 563 throw(InvalidIDException, TypeMismatchException)564 538 { 565 539 return getArray<uint8_t, Protocol::TYPE_BYTE_ARRAY>(id, offset); … … 570 544 size_t MultiBuffer::setString(size_t id, const string& value, 571 545 size_t offset) 572 throw(InvalidIDException, TypeMismatchException)573 546 { 574 547 return setByteArray(id, reinterpret_cast<const uint8_t*>(value.c_str()), … … 579 552 580 553 string MultiBuffer::getString(size_t id, size_t offset) const 581 throw(InvalidIDException, TypeMismatchException)582 554 { 583 555 const DataRef& dataRef = getDataRef(id, Protocol::TYPE_BYTE_ARRAY); … … 598 570 599 571 const char* MultiBuffer::getStringPtr(size_t id, size_t offset) const 600 throw(InvalidIDException, TypeMismatchException)601 572 { 602 573 return reinterpret_cast<const char*>(getByteArray(id, offset)); … … 605 576 //------------------------------------------------------------------------------ 606 577 607 void MultiBuffer::writeSpec(uint8_t command) const throw(Exception)578 void MultiBuffer::writeSpec(uint8_t command) const 608 579 { 609 580 xplane.stream->writeU8(command); … … 628 599 //------------------------------------------------------------------------------ 629 600 630 void MultiBuffer::reregisterInXPlane() throw(Exception)601 void MultiBuffer::reregisterInXPlane() 631 602 { 632 603 if (registeredID>=0) {
Note:
See TracChangeset
for help on using the changeset viewer.