Changeset 107:614b9ff033c1 in xplra for src/client/c/hu/varadiistvan/xplra/MultiBuffer.h
- 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/MultiBuffer.h
r66 r107 92 92 DataRef(const std::string& name, uint8_t type, 93 93 const DataRef* previous = 0, 94 size_t length = 0, size_t offset = 0) throw();94 size_t length = 0, size_t offset = 0) noexcept; 95 95 96 96 /** 97 97 * Get the size of the data represented by this object. 98 98 */ 99 size_t getSize() const throw();99 size_t getSize() const noexcept; 100 100 101 101 /** … … 103 103 * this dataref. 104 104 */ 105 size_t getAlignment() const throw();105 size_t getAlignment() const noexcept; 106 106 107 107 /** 108 108 * Determine if the dataref is an array. 109 109 */ 110 bool isArray() const throw();110 bool isArray() const noexcept; 111 111 112 112 /** … … 114 114 * user parameters. 115 115 */ 116 size_t getCopyLength(size_t userLength, size_t userOffset) const throw();116 size_t getCopyLength(size_t userLength, size_t userOffset) const noexcept; 117 117 }; 118 118 … … 153 153 */ 154 154 MultiBuffer(XPlane& xplane, uint8_t registerCommand, 155 uint8_t unregisterCommand) throw();155 uint8_t unregisterCommand) noexcept; 156 156 157 157 /** … … 159 159 * made to unregister it. 160 160 */ 161 virtual ~MultiBuffer() throw();161 virtual ~MultiBuffer() noexcept; 162 162 163 163 public: … … 165 165 * Get the X-Plane object this buffer belongs to. 166 166 */ 167 XPlane& getXPlane() const throw();167 XPlane& getXPlane() const noexcept; 168 168 169 169 /** … … 173 173 * get the value. 174 174 */ 175 size_t addInt(const std::string& name) throw();175 size_t addInt(const std::string& name) noexcept; 176 176 177 177 /** … … 181 181 * get the value. 182 182 */ 183 size_t addFloat(const std::string& name) throw();183 size_t addFloat(const std::string& name) noexcept; 184 184 185 185 /** … … 189 189 * get the value. 190 190 */ 191 size_t addDouble(const std::string& name) throw();191 size_t addDouble(const std::string& name) noexcept; 192 192 193 193 /** … … 198 198 */ 199 199 size_t addFloatArray(const std::string& name, size_t length, 200 size_t offset = 0) throw();200 size_t offset = 0) noexcept; 201 201 202 202 /** … … 207 207 */ 208 208 size_t addIntArray(const std::string& name, size_t length, 209 size_t offset = 0) throw();209 size_t offset = 0) noexcept; 210 210 211 211 /** … … 216 216 */ 217 217 size_t addByteArray(const std::string& name, size_t length, 218 size_t offset = 0) throw();218 size_t offset = 0) noexcept; 219 219 220 220 /** … … 230 230 * too. 231 231 */ 232 void registerInXPlane() throw(Exception);232 void registerInXPlane(); 233 233 234 234 /** 235 235 * Unregister this buffer from X-Plane. 236 236 */ 237 void unregisterFromXPlane() throw(Exception);237 void unregisterFromXPlane(); 238 238 239 239 /** … … 244 244 * @return whether unregistration succeeded. 245 245 */ 246 bool unregisterSafelyFromXPlane() throw();246 bool unregisterSafelyFromXPlane() noexcept; 247 247 248 248 /** … … 252 252 * and it will be re-registered after finalizing. 253 253 */ 254 void execute() throw(Exception);254 void execute(); 255 255 256 256 /** 257 257 * Set the value of an integer dataref with the given ID. 258 258 */ 259 void setInt(size_t id, int value) 260 throw(InvalidIDException, TypeMismatchException); 259 void setInt(size_t id, int value); 261 260 262 261 /** 263 262 * Get the value of an integer dataref with the given ID. 264 263 */ 265 int getInt(size_t id) const 266 throw(InvalidIDException, TypeMismatchException); 264 int getInt(size_t id) const; 267 265 268 266 /** 269 267 * Get a reference to the integer dataref with the given ID 270 268 */ 271 const int32_t& getIntRef(size_t id) const 272 throw(InvalidIDException, TypeMismatchException); 269 const int32_t& getIntRef(size_t id) const; 273 270 274 271 /** 275 272 * Get a reference to the integer dataref with the given ID 276 273 */ 277 int32_t& getIntRef(size_t id) 278 throw(InvalidIDException, TypeMismatchException); 274 int32_t& getIntRef(size_t id); 279 275 280 276 /** 281 277 * Set the value of a float dataref with the given ID. 282 278 */ 283 void setFloat(size_t id, float value) 284 throw(InvalidIDException, TypeMismatchException); 279 void setFloat(size_t id, float value); 285 280 286 281 /** 287 282 * Get the value of a float dataref with the given ID. 288 283 */ 289 float getFloat(size_t id) const 290 throw(InvalidIDException, TypeMismatchException); 284 float getFloat(size_t id) const; 291 285 292 286 /** 293 287 * Get a reference to the float dataref with the given ID 294 288 */ 295 const float& getFloatRef(size_t id) const 296 throw(InvalidIDException, TypeMismatchException); 289 const float& getFloatRef(size_t id) const; 297 290 298 291 /** 299 292 * Get a reference to the integer dataref with the given ID 300 293 */ 301 float& getFloatRef(size_t id) 302 throw(InvalidIDException, TypeMismatchException); 294 float& getFloatRef(size_t id); 303 295 304 296 /** 305 297 * Set the value of a double dataref with the given ID. 306 298 */ 307 void setDouble(size_t id, double value) 308 throw(InvalidIDException, TypeMismatchException); 299 void setDouble(size_t id, double value); 309 300 310 301 /** 311 302 * Get the value of a double dataref with the given ID. 312 303 */ 313 double getDouble(size_t id) const 314 throw(InvalidIDException, TypeMismatchException); 304 double getDouble(size_t id) const; 315 305 316 306 /** 317 307 * Get a reference to the double dataref with the given ID 318 308 */ 319 const double& getDoubleRef(size_t id) const 320 throw(InvalidIDException, TypeMismatchException); 309 const double& getDoubleRef(size_t id) const; 321 310 322 311 /** 323 312 * Get a reference to the double dataref with the given ID 324 313 */ 325 double& getDoubleRef(size_t id) 326 throw(InvalidIDException, TypeMismatchException); 314 double& getDoubleRef(size_t id); 327 315 328 316 /** … … 340 328 */ 341 329 size_t setFloatArray(size_t id, const float* value, 342 size_t length = 0, size_t offset = 0) 343 throw(InvalidIDException, TypeMismatchException); 330 size_t length = 0, size_t offset = 0); 344 331 345 332 /** … … 357 344 */ 358 345 size_t getFloatArray(size_t id, float* value, 359 size_t length = 0, size_t offset = 0) const 360 throw(InvalidIDException, TypeMismatchException); 346 size_t length = 0, size_t offset = 0) const; 361 347 362 348 /** … … 368 354 * than the length of the buffer, 0 is returned. 369 355 */ 370 const float* getFloatArray(size_t id, size_t offset = 0) const 371 throw(InvalidIDException, TypeMismatchException); 356 const float* getFloatArray(size_t id, size_t offset = 0) const; 372 357 373 358 /** … … 385 370 */ 386 371 size_t setIntArray(size_t id, const int32_t* value, 387 size_t length = 0, size_t offset = 0) 388 throw(InvalidIDException, TypeMismatchException); 372 size_t length = 0, size_t offset = 0); 389 373 390 374 /** … … 402 386 */ 403 387 size_t getIntArray(size_t id, int32_t* value, 404 size_t length = 0, size_t offset = 0) const 405 throw(InvalidIDException, TypeMismatchException); 388 size_t length = 0, size_t offset = 0) const; 406 389 407 390 /** … … 412 395 * than the length of the buffer, 0 is returned. 413 396 */ 414 const int32_t* getIntArray(size_t id, size_t offset = 0) const 415 throw(InvalidIDException, TypeMismatchException); 416 397 const int32_t* getIntArray(size_t id, size_t offset = 0) const; 417 398 418 399 /** … … 430 411 */ 431 412 size_t setByteArray(size_t id, const uint8_t* value, 432 size_t length = 0, size_t offset = 0) 433 throw(InvalidIDException, TypeMismatchException); 413 size_t length = 0, size_t offset = 0); 434 414 435 415 /** … … 447 427 */ 448 428 size_t getByteArray(size_t id, uint8_t* value, 449 size_t length = 0, size_t offset = 0) const 450 throw(InvalidIDException, TypeMismatchException); 429 size_t length = 0, size_t offset = 0) const; 451 430 452 431 /** … … 457 436 * than the length of the buffer, 0 is returned. 458 437 */ 459 const uint8_t* getByteArray(size_t id, size_t offset = 0) const 460 throw(InvalidIDException, TypeMismatchException); 438 const uint8_t* getByteArray(size_t id, size_t offset = 0) const; 461 439 462 440 … … 469 447 */ 470 448 size_t setString(size_t id, const std::string& value, 471 size_t offset = 0) 472 throw(InvalidIDException, TypeMismatchException); 449 size_t offset = 0); 473 450 474 451 /** … … 476 453 * a string. 477 454 */ 478 std::string getString(size_t id, size_t offset = 0) const 479 throw(InvalidIDException, TypeMismatchException); 480 455 std::string getString(size_t id, size_t offset = 0) const; 456 481 457 /** 482 458 * Get a string pointer to the value of the byte array dataref 483 459 * with the given ID. 484 460 */ 485 const char* getStringPtr(size_t id, size_t offset = 0) const 486 throw(InvalidIDException, TypeMismatchException); 461 const char* getStringPtr(size_t id, size_t offset = 0) const; 487 462 488 463 protected: … … 491 466 * registered. 492 467 */ 493 virtual void doExecute() throw(Exception)= 0;468 virtual void doExecute() = 0; 494 469 495 470 /** … … 497 472 * not registered. 498 473 */ 499 virtual void doExecuteUnregistered() throw(Exception)= 0;474 virtual void doExecuteUnregistered() = 0; 500 475 501 476 /** … … 503 478 * checks the result 504 479 */ 505 void writeSpec(uint8_t command) const throw(Exception);480 void writeSpec(uint8_t command) const; 506 481 507 482 /** … … 516 491 * again 517 492 */ 518 void reregisterInXPlane() throw(Exception);493 void reregisterInXPlane(); 519 494 520 495 private: … … 522 497 * Unfinalize the buffer, if it is finalized. 523 498 */ 524 void unfinalize() throw();499 void unfinalize() noexcept; 525 500 526 501 /** … … 530 505 * multi-buffers. 531 506 */ 532 void forgetRegistration() throw();507 void forgetRegistration() noexcept; 533 508 534 509 /** 535 510 * Get the last dataref, or 0 if there are not datarefs yet. 536 511 */ 537 const DataRef* getLastDataRef() const throw();512 const DataRef* getLastDataRef() const noexcept; 538 513 539 514 /** … … 541 516 * type. Otherwise throw an exception. 542 517 */ 543 const DataRef& getDataRef(size_t id, uint8_t type) const 544 throw(InvalidIDException, TypeMismatchException); 518 const DataRef& getDataRef(size_t id, uint8_t type) const; 545 519 546 520 /** … … 548 522 * given type. If the buffer is not finalized yet, it will be. 549 523 */ 550 void* getData(size_t id, uint8_t type) 551 throw(InvalidIDException, TypeMismatchException); 524 void* getData(size_t id, uint8_t type); 552 525 553 526 /** … … 555 528 * given type. If the buffer is not finalized yet, it will be. 556 529 */ 557 const void* getData(size_t id, uint8_t type) const 558 throw(InvalidIDException, TypeMismatchException); 530 const void* getData(size_t id, uint8_t type) const; 559 531 560 532 /** … … 562 534 */ 563 535 template <typename T, uint8_t type> size_t 564 setArray(size_t id, const T* value, size_t length, size_t offset) 565 throw(InvalidIDException, TypeMismatchException); 536 setArray(size_t id, const T* value, size_t length, size_t offset); 566 537 567 538 /** … … 570 541 */ 571 542 template <typename T, uint8_t type> size_t 572 getArray(size_t id, T* value, size_t length, size_t offset) const 573 throw(InvalidIDException, TypeMismatchException); 543 getArray(size_t id, T* value, size_t length, size_t offset) const; 574 544 575 545 /** … … 578 548 */ 579 549 template <typename T, uint8_t type> const T* 580 getArray(size_t id, size_t offset) const 581 throw(InvalidIDException, TypeMismatchException); 550 getArray(size_t id, size_t offset) const; 582 551 583 552 friend class XPlane; … … 588 557 //------------------------------------------------------------------------------ 589 558 590 inline XPlane& MultiBuffer::getXPlane() const throw()559 inline XPlane& MultiBuffer::getXPlane() const noexcept 591 560 { 592 561 return xplane;
Note:
See TracChangeset
for help on using the changeset viewer.