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/xplra.cc

    r92 r107  
    9090     * @return the ID of the new value
    9191     */
    92     static int addValue(Value value) throw();
     92    static int addValue(Value value) noexcept;
    9393
    9494    /**
    9595     * Get the value with the given ID.
    9696     */
    97     static Value getValue(int valueID) throw();
     97    static Value getValue(int valueID) noexcept;
    9898
    9999    /**
    100100     * Clear the value with the given ID.
    101101     */
    102     static void clearValue(int valueID) throw();
     102    static void clearValue(int valueID) noexcept;
    103103
    104104private:
     
    119119     * Construct a slot with the given value
    120120     */
    121     Slot(Value value) throw();
     121    Slot(Value value) noexcept;
    122122
    123123    /**
     
    125125     * should be called for a slot with no value.
    126126     */
    127     int setValue(Value value) throw();
     127    int setValue(Value value) noexcept;
    128128
    129129    /**
     
    131131     * returned (converted to value).
    132132     */
    133     Value getValue() const throw();
     133    Value getValue() const noexcept;
    134134
    135135    /**
    136136     * Clear the value and set the given next free index.
    137137     */
    138     void clear(int nextFreeIndex) throw();
     138    void clear(int nextFreeIndex) noexcept;
    139139};
    140140
     
    150150
    151151template <class Value>
    152 inline Slot<Value>::Slot(Value value) throw() :
     152inline Slot<Value>::Slot(Value value) noexcept :
    153153    valid(true)
    154154{
     
    159159
    160160template <class Value>
    161 inline int Slot<Value>::setValue(Value value) throw()
     161inline int Slot<Value>::setValue(Value value) noexcept
    162162{
    163163    assert(!valid);
     
    171171
    172172template <class Value>
    173 inline Value Slot<Value>::getValue() const throw()
     173inline Value Slot<Value>::getValue() const noexcept
    174174{
    175175    return valid ? value : static_cast<Value>(0);
     
    179179
    180180template <class Value>
    181 inline void Slot<Value>::clear(int nextFreeIndex) throw()
     181inline void Slot<Value>::clear(int nextFreeIndex) noexcept
    182182{
    183183    assert(valid);
     
    189189
    190190template <class Value>
    191 int Slot<Value>::addValue(Value value) throw()
     191int Slot<Value>::addValue(Value value) noexcept
    192192{
    193193    int id = firstFree;
     
    206206
    207207template <class Value>
    208 Value Slot<Value>::getValue(int valueID) throw()
     208Value Slot<Value>::getValue(int valueID) noexcept
    209209{
    210210    size_t index = static_cast<size_t>(valueID);
     
    216216
    217217template <class Value>
    218 void Slot<Value>::clearValue(int valueID) throw()
     218void Slot<Value>::clearValue(int valueID) noexcept
    219219{
    220220    size_t index = static_cast<size_t>(valueID);
     
    248248     * Get the connection for the given multi-dataref buffer.
    249249     */
    250     static Connection& get(const MultiBuffer& buffer) throw();
     250    static Connection& get(const MultiBuffer& buffer) noexcept;
    251251
    252252private:
     
    275275     * Construct the connection
    276276     */
    277     Connection() throw();
     277    Connection() noexcept;
    278278
    279279    /**
    280280     * Destroy the connection.
    281281     */
    282     ~Connection() throw();
     282    ~Connection() noexcept;
    283283
    284284    /**
    285285     * Handle the currently pending exception.
    286286     */
    287     void handleException() throw();
     287    void handleException() noexcept;
    288288
    289289    /**
    290290     * Get the last error code.
    291291     */
    292     int getLastError(unsigned long* lastErrorSubCode) const throw();
     292    int getLastError(unsigned long* lastErrorSubCode) const noexcept;
    293293
    294294    /**
    295295     * Get the string representation of the last error code.
    296296     */
    297     const char* getLastErrorString() const throw();
     297    const char* getLastErrorString() const noexcept;
    298298
    299299    /**
    300300     * Clear the last error code.
    301301     */
    302     void clearLastError() throw();
     302    void clearLastError() noexcept;
    303303
    304304    /**
     
    307307     * @return the ID of the new getter.
    308308     */
    309     int createMultiGetter() throw();
     309    int createMultiGetter() noexcept;
    310310
    311311    /**
     
    314314     * @return the ID of the new setter.
    315315     */
    316     int createMultiSetter() throw();
     316    int createMultiSetter() noexcept;
    317317
    318318    /**
     
    324324     * @return whether the buffer was found and could be destroyed.
    325325     */
    326     bool destroyMultiBuffer(int bufferID) throw(Exception);
     326    bool destroyMultiBuffer(int bufferID);
    327327};
    328328
    329329//------------------------------------------------------------------------------
    330330
    331 inline Connection& Connection::get(const MultiBuffer& buffer) throw()
     331inline Connection& Connection::get(const MultiBuffer& buffer) noexcept
    332332{
    333333    return static_cast<Connection&>(buffer.getXPlane());
     
    336336//------------------------------------------------------------------------------
    337337
    338 inline Connection::Connection() throw() :
     338inline Connection::Connection() noexcept :
    339339    lastErrorCode(0),
    340340    lastErrorSubCode(0)
     
    344344//------------------------------------------------------------------------------
    345345
    346 Connection::~Connection() throw()
     346Connection::~Connection() noexcept
    347347{
    348348    for(multiBufferIDs_t::iterator i = multiBufferIDs.begin();
     
    355355//------------------------------------------------------------------------------
    356356
    357 void Connection::handleException() throw()
     357void Connection::handleException() noexcept
    358358{
    359359    try {
     
    393393
    394394inline int Connection::getLastError(unsigned long* lastErrorSubCode)
    395     const throw()
     395    const noexcept
    396396{
    397397    if (lastErrorSubCode!=0) *lastErrorSubCode = this->lastErrorSubCode;
     
    401401//------------------------------------------------------------------------------
    402402
    403 inline const char* Connection::getLastErrorString() const throw()
     403inline const char* Connection::getLastErrorString() const noexcept
    404404{
    405405    return (lastErrorCode==ERROR_NONE) ? 0 : lastErrorString.c_str();
     
    408408//------------------------------------------------------------------------------
    409409
    410 inline void Connection::clearLastError() throw()
     410inline void Connection::clearLastError() noexcept
    411411{
    412412    lastErrorCode = ERROR_NONE;
     
    417417//------------------------------------------------------------------------------
    418418
    419 inline int Connection::createMultiGetter() throw()
     419inline int Connection::createMultiGetter() noexcept
    420420{
    421421    MultiGetter& getter = XPlane::createMultiGetter();
     
    425425//------------------------------------------------------------------------------
    426426
    427 inline int Connection::createMultiSetter() throw()
     427inline int Connection::createMultiSetter() noexcept
    428428{
    429429    MultiSetter& setter = XPlane::createMultiSetter();
     
    433433//------------------------------------------------------------------------------
    434434
    435 bool Connection::destroyMultiBuffer(int bufferID) throw(Exception)
     435bool Connection::destroyMultiBuffer(int bufferID)
    436436{
    437437    MultiBuffer* buffer = MultiBufferSlot::getValue(bufferID);
Note: See TracChangeset for help on using the changeset viewer.