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/XPlane.h

    r87 r107  
    9898     * yet.
    9999     */
    100     XPlane() throw();
     100    XPlane() noexcept;
    101101
    102102    /**
     
    105105     * become invalid.
    106106     */
    107     ~XPlane() throw();
     107    ~XPlane() noexcept;
    108108
    109109    /**
    110110     * Connect to the simulator.
    111111     */
    112     void connect() throw(IOException);
     112    void connect();
    113113
    114114    /**
    115115     * Check if we are connected to the simulator.
    116116     */
    117     bool isConnected() const throw();
     117    bool isConnected() const noexcept;
    118118
    119119    /**
    120120     * Disconnect from the simulator.
    121121     */
    122     void disconnect() throw();
     122    void disconnect() noexcept;
    123123
    124124    /**
     
    126126     * to it.
    127127     */
    128     MultiGetter& createMultiGetter() throw();
     128    MultiGetter& createMultiGetter() noexcept;
    129129
    130130    /**
     
    132132     * to it.
    133133     */
    134     MultiSetter& createMultiSetter() throw();
     134    MultiSetter& createMultiSetter() noexcept;
    135135
    136136    /**
     
    142142     * @return if the buffer was found and could be destroyed
    143143     */
    144     bool destroyMultiBuffer(MultiBuffer& buffer) throw(Exception);
     144    bool destroyMultiBuffer(MultiBuffer& buffer);
    145145
    146146    /**
    147147     * Get the versions of X-Plane, XPLM and the XPLRA plugin.
    148148     */
    149     void getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion) throw(Exception);
     149    void getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion);
    150150
    151151    /**
     
    153153     * fails.
    154154     */
    155     void reloadPlugins() throw(Exception);
     155    void reloadPlugins();
    156156
    157157    /**
     
    159159     * which is relative to the directory of X-Plane.
    160160     */
    161     void saveSituation(const char* path) throw(Exception);
     161    void saveSituation(const char* path);
    162162
    163163    /**
    164164     * Get the integer value of the dataref with the given name.
    165165     */
    166     int getInt(const char* name) throw(Exception);
     166    int getInt(const char* name);
    167167
    168168    /**
    169169     * Get a float value.
    170170     */
    171     float getFloat(const char* name) throw(Exception);
     171    float getFloat(const char* name);
    172172
    173173    /**
    174174     * Get a double value.
    175175     */
    176     double getDouble(const char* name) throw(Exception);
     176    double getDouble(const char* name);
    177177
    178178    /**
     
    187187     */
    188188    size_t getFloatArray(const char* name, float* dest,
    189                          size_t length, size_t offset = 0) throw(Exception);
     189                         size_t length, size_t offset = 0);
    190190
    191191    /**
     
    198198     */
    199199    float* getFloatArray(const char* name, size_t& length,
    200                          size_t offset = 0) throw(Exception);
     200                         size_t offset = 0);
    201201
    202202    /**
     
    211211     */
    212212    size_t getIntArray(const char* name, int32_t* dest,
    213                        size_t length, size_t offset = 0) throw(Exception);
     213                       size_t length, size_t offset = 0);
    214214
    215215    /**
     
    222222     */
    223223    int32_t* getIntArray(const char* name, size_t& length,
    224                          size_t offset = 0) throw(Exception);
     224                         size_t offset = 0);
    225225
    226226    /**
     
    235235     */
    236236    size_t getByteArray(const char* name, uint8_t* dest,
    237                         size_t length, size_t offset = 0) throw(Exception);
     237                        size_t length, size_t offset = 0);
    238238
    239239    /**
     
    246246     */
    247247    uint8_t* getByteArray(const char* name, size_t& length,
    248                           size_t offset = 0) throw(Exception);
     248                          size_t offset = 0);
    249249
    250250    /**
    251251     * Get a string. A string is a byte array.
    252252     */
    253     std::string getString(const char* name, size_t offset = 0) throw(Exception);
     253    std::string getString(const char* name, size_t offset = 0);
    254254
    255255    /**
    256256     * Set the given dataref to the given integer value.
    257257     */
    258     void setInt(const char* name, int value) throw(Exception);
     258    void setInt(const char* name, int value);
    259259
    260260    /**
    261261     * Set the given dataref to the given float value.
    262262     */
    263     void setFloat(const char* name, float value) throw(Exception);
     263    void setFloat(const char* name, float value);
    264264
    265265    /**
    266266     * Set the given dataref to the given double value.
    267267     */
    268     void setDouble(const char* name, double value) throw(Exception);
     268    void setDouble(const char* name, double value);
    269269
    270270    /**
     
    272272     */
    273273    void setFloatArray(const char* name, const float* values, size_t length,
    274                        size_t offset = 0) throw(Exception);
     274                       size_t offset = 0);
    275275
    276276    /**
     
    278278     */
    279279    void setIntArray(const char* name, const int32_t* values, size_t length,
    280                      size_t offset = 0) throw(Exception);
     280                     size_t offset = 0);
    281281
    282282    /**
     
    284284     */
    285285    void setByteArray(const char* name, const uint8_t* values, size_t length,
    286                       size_t offset = 0) throw(Exception);
     286                      size_t offset = 0);
    287287
    288288    /**
     
    293293     */
    294294    void setString(const char* name, const char* value, size_t length,
    295                    size_t offset = 0) throw(Exception);
     295                   size_t offset = 0);
    296296
    297297    /**
    298298     * Show a textual message for a certain duration.
    299299     */
    300     void showMessage(const char* message, float duration) throw(Exception);
     300    void showMessage(const char* message, float duration);
    301301
    302302    /**
     
    304304     * existing set of hotkeys registered, those will be overwritten.
    305305     */
    306     void registerHotkeys(const uint16_t* codes, size_t length) throw(Exception);
     306    void registerHotkeys(const uint16_t* codes, size_t length);
    307307
    308308    /**
    309309     * Query the registered hotkeys whether they were pressed.
    310310     */
    311     void queryHotkeys(uint8_t* states, size_t length) throw(Exception);
     311    void queryHotkeys(uint8_t* states, size_t length);
    312312
    313313    /**
     
    320320     * Check if we have a stream and if it has not failed.
    321321     */
    322     void checkStream() throw(NotConnectedException, IOException);
     322    void checkStream();
    323323
    324324    /**
     
    327327     */
    328328    void checkResult(uint8_t result, bool hasParameter = false,
    329                      long parameter = 0) throw(ProtocolException);
     329                     long parameter = 0);
    330330
    331331    /**
     
    334334     * is some problem with the stream, an IOException is thrown.
    335335     */
    336     void checkResult(bool multi = false) throw(ProtocolException, IOException);
     336    void checkResult(bool multi = false);
    337337
    338338    /**
     
    340340     * also checked, but the value should be read by the caller.
    341341     */
    342     void getScalar(const char* name, uint8_t type) throw(Exception);
     342    void getScalar(const char* name, uint8_t type);
    343343
    344344    /**
     
    350350     */
    351351    size_t getArray(const char* name, uint8_t type,
    352                     ssize_t length, size_t offset) throw(Exception);
     352                    ssize_t length, size_t offset);
    353353
    354354
     
    356356     * Issue the command to set a scalar value of the given type.
    357357     */
    358     void setScalar(const char* name, uint8_t type) throw(Exception);
     358    void setScalar(const char* name, uint8_t type);
    359359
    360360    /**
     
    362362     */
    363363    void setArray(const char* name, uint8_t type, size_t length,
    364                   size_t offset) throw(Exception);
     364                  size_t offset);
    365365
    366366    friend class MultiBuffer;
     
    373373//------------------------------------------------------------------------------
    374374
    375 inline XPlane::XPlane() throw() :
     375inline XPlane::XPlane() noexcept :
    376376    socket(0),
    377377    stream(0)
     
    381381//------------------------------------------------------------------------------
    382382
    383 inline bool XPlane::isConnected() const throw()
     383inline bool XPlane::isConnected() const noexcept
    384384{
    385385    return socket!=0;
Note: See TracChangeset for help on using the changeset viewer.