Ignore:
Timestamp:
12/15/22 19:26:40 (17 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Modernized the exception specifications in the C++ client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/client/c/hu/varadiistvan/xplra/MultiBuffer.h

    r66 r107  
    9292        DataRef(const std::string& name, uint8_t type,
    9393                const DataRef* previous = 0,
    94                 size_t length = 0, size_t offset = 0) throw();
     94                size_t length = 0, size_t offset = 0) noexcept;
    9595
    9696        /**
    9797         * Get the size of the data represented by this object.
    9898         */
    99         size_t getSize() const throw();
     99        size_t getSize() const noexcept;
    100100
    101101        /**
     
    103103         * this dataref.
    104104         */
    105         size_t getAlignment() const throw();
     105        size_t getAlignment() const noexcept;
    106106
    107107        /**
    108108         * Determine if the dataref is an array.
    109109         */
    110         bool isArray() const throw();
     110        bool isArray() const noexcept;
    111111
    112112        /**
     
    114114         * user parameters.
    115115         */
    116         size_t getCopyLength(size_t userLength, size_t userOffset) const throw();
     116        size_t getCopyLength(size_t userLength, size_t userOffset) const noexcept;
    117117    };
    118118
     
    153153     */
    154154    MultiBuffer(XPlane& xplane, uint8_t registerCommand,
    155                 uint8_t unregisterCommand) throw();
     155                uint8_t unregisterCommand) noexcept;
    156156
    157157    /**
     
    159159     * made to unregister it.
    160160     */
    161     virtual ~MultiBuffer() throw();
     161    virtual ~MultiBuffer() noexcept;
    162162
    163163public:
     
    165165     * Get the X-Plane object this buffer belongs to.
    166166     */
    167     XPlane& getXPlane() const throw();
     167    XPlane& getXPlane() const noexcept;
    168168
    169169    /**
     
    173173     * get the value.
    174174     */
    175     size_t addInt(const std::string& name) throw();
     175    size_t addInt(const std::string& name) noexcept;
    176176
    177177    /**
     
    181181     * get the value.
    182182     */
    183     size_t addFloat(const std::string& name) throw();
     183    size_t addFloat(const std::string& name) noexcept;
    184184
    185185    /**
     
    189189     * get the value.
    190190     */
    191     size_t addDouble(const std::string& name) throw();
     191    size_t addDouble(const std::string& name) noexcept;
    192192
    193193    /**
     
    198198     */
    199199    size_t addFloatArray(const std::string& name, size_t length,
    200                          size_t offset = 0) throw();
     200                         size_t offset = 0) noexcept;
    201201
    202202    /**
     
    207207     */
    208208    size_t addIntArray(const std::string& name, size_t length,
    209                        size_t offset = 0) throw();
     209                       size_t offset = 0) noexcept;
    210210
    211211    /**
     
    216216     */
    217217    size_t addByteArray(const std::string& name, size_t length,
    218                         size_t offset = 0) throw();
     218                        size_t offset = 0) noexcept;
    219219
    220220    /**
     
    230230     * too.
    231231     */
    232     void registerInXPlane() throw(Exception);
     232    void registerInXPlane();
    233233
    234234    /**
    235235     * Unregister this buffer from X-Plane.
    236236     */
    237     void unregisterFromXPlane() throw(Exception);
     237    void unregisterFromXPlane();
    238238
    239239    /**
     
    244244     * @return whether unregistration succeeded.
    245245     */
    246     bool unregisterSafelyFromXPlane() throw();
     246    bool unregisterSafelyFromXPlane() noexcept;
    247247
    248248    /**
     
    252252     * and it will be re-registered after finalizing.
    253253     */
    254     void execute() throw(Exception);
     254    void execute();
    255255
    256256    /**
    257257     * Set the value of an integer dataref with the given ID.
    258258     */
    259     void setInt(size_t id, int value)
    260         throw(InvalidIDException, TypeMismatchException);
     259    void setInt(size_t id, int value);
    261260
    262261    /**
    263262     * Get the value of an integer dataref with the given ID.
    264263     */
    265     int getInt(size_t id) const
    266         throw(InvalidIDException, TypeMismatchException);
     264    int getInt(size_t id) const;
    267265
    268266    /**
    269267     * Get a reference to the integer dataref with the given ID
    270268     */
    271     const int32_t& getIntRef(size_t id) const
    272         throw(InvalidIDException, TypeMismatchException);
     269    const int32_t& getIntRef(size_t id) const;
    273270
    274271    /**
    275272     * Get a reference to the integer dataref with the given ID
    276273     */
    277     int32_t& getIntRef(size_t id)
    278         throw(InvalidIDException, TypeMismatchException);
     274    int32_t& getIntRef(size_t id);
    279275
    280276    /**
    281277     * Set the value of a float dataref with the given ID.
    282278     */
    283     void setFloat(size_t id, float value)
    284         throw(InvalidIDException, TypeMismatchException);
     279    void setFloat(size_t id, float value);
    285280
    286281    /**
    287282     * Get the value of a float dataref with the given ID.
    288283     */
    289     float getFloat(size_t id) const
    290         throw(InvalidIDException, TypeMismatchException);
     284    float getFloat(size_t id) const;
    291285
    292286    /**
    293287     * Get a reference to the float dataref with the given ID
    294288     */
    295     const float& getFloatRef(size_t id) const
    296         throw(InvalidIDException, TypeMismatchException);
     289    const float& getFloatRef(size_t id) const;
    297290
    298291    /**
    299292     * Get a reference to the integer dataref with the given ID
    300293     */
    301     float& getFloatRef(size_t id)
    302         throw(InvalidIDException, TypeMismatchException);
     294    float& getFloatRef(size_t id);
    303295
    304296    /**
    305297     * Set the value of a double dataref with the given ID.
    306298     */
    307     void setDouble(size_t id, double value)
    308         throw(InvalidIDException, TypeMismatchException);
     299    void setDouble(size_t id, double value);
    309300
    310301    /**
    311302     * Get the value of a double dataref with the given ID.
    312303     */
    313     double getDouble(size_t id) const
    314         throw(InvalidIDException, TypeMismatchException);
     304    double getDouble(size_t id) const;
    315305
    316306    /**
    317307     * Get a reference to the double dataref with the given ID
    318308     */
    319     const double& getDoubleRef(size_t id) const
    320         throw(InvalidIDException, TypeMismatchException);
     309    const double& getDoubleRef(size_t id) const;
    321310
    322311    /**
    323312     * Get a reference to the double dataref with the given ID
    324313     */
    325     double& getDoubleRef(size_t id)
    326         throw(InvalidIDException, TypeMismatchException);
     314    double& getDoubleRef(size_t id);
    327315
    328316    /**
     
    340328     */
    341329    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);
    344331
    345332    /**
     
    357344     */
    358345    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;
    361347
    362348    /**
     
    368354     * than the length of the buffer, 0 is returned.
    369355     */
    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;
    372357
    373358    /**
     
    385370     */
    386371    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);
    389373
    390374    /**
     
    402386     */
    403387    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;
    406389
    407390    /**
     
    412395     * than the length of the buffer, 0 is returned.
    413396     */
    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;
    417398
    418399    /**
     
    430411     */
    431412    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);
    434414
    435415    /**
     
    447427     */
    448428    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;
    451430
    452431    /**
     
    457436     * than the length of the buffer, 0 is returned.
    458437     */
    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;
    461439
    462440
     
    469447     */
    470448    size_t setString(size_t id, const std::string& value,
    471                      size_t offset = 0)
    472         throw(InvalidIDException, TypeMismatchException);
     449                     size_t offset = 0);
    473450
    474451    /**
     
    476453     * a string.
    477454     */
    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   
    481457    /**
    482458     * Get a string pointer to the value of the byte array dataref
    483459     * with the given ID.
    484460     */
    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;
    487462
    488463protected:
     
    491466     * registered.
    492467     */
    493     virtual void doExecute() throw(Exception) = 0;
     468    virtual void doExecute() = 0;
    494469
    495470    /**
     
    497472     * not registered.
    498473     */
    499     virtual void doExecuteUnregistered() throw(Exception) = 0;
     474    virtual void doExecuteUnregistered() = 0;
    500475
    501476    /**
     
    503478     * checks the result
    504479     */
    505     void writeSpec(uint8_t command) const throw(Exception);
     480    void writeSpec(uint8_t command) const;
    506481
    507482    /**
     
    516491     * again
    517492     */
    518     void reregisterInXPlane() throw(Exception);
     493    void reregisterInXPlane();
    519494
    520495private:
     
    522497     * Unfinalize the buffer, if it is finalized.
    523498     */
    524     void unfinalize() throw();
     499    void unfinalize() noexcept;
    525500
    526501    /**
     
    530505     * multi-buffers.
    531506     */
    532     void forgetRegistration() throw();
     507    void forgetRegistration() noexcept;
    533508
    534509    /**
    535510     * Get the last dataref, or 0 if there are not datarefs yet.
    536511     */
    537     const DataRef* getLastDataRef() const throw();
     512    const DataRef* getLastDataRef() const noexcept;
    538513
    539514    /**
     
    541516     * type. Otherwise throw an exception.
    542517     */
    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;
    545519
    546520    /**
     
    548522     * given type. If the buffer is not finalized yet, it will be.
    549523     */
    550     void* getData(size_t id, uint8_t type)
    551         throw(InvalidIDException, TypeMismatchException);
     524    void* getData(size_t id, uint8_t type);
    552525
    553526    /**
     
    555528     * given type. If the buffer is not finalized yet, it will be.
    556529     */
    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;
    559531
    560532    /**
     
    562534     */
    563535    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);
    566537
    567538    /**
     
    570541     */
    571542    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;
    574544
    575545    /**
     
    578548     */
    579549    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;
    582551
    583552    friend class XPlane;
     
    588557//------------------------------------------------------------------------------
    589558
    590 inline XPlane& MultiBuffer::getXPlane() const throw()
     559inline XPlane& MultiBuffer::getXPlane() const noexcept
    591560{
    592561    return xplane;
Note: See TracChangeset for help on using the changeset viewer.