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

    r92 r107  
    6363//------------------------------------------------------------------------------
    6464
    65 void XPlane::checkStream() throw(NotConnectedException, IOException)
     65void XPlane::checkStream()
    6666{
    6767    if (stream==0) {
     
    7474//------------------------------------------------------------------------------
    7575
    76 void XPlane::checkResult(uint8_t result, bool hasParameter, long parameter)
    77     throw(ProtocolException)
     76void XPlane::checkResult(uint8_t result, bool hasParameter, long parameter)   
    7877{
    7978    switch(result) {
     
    113112//------------------------------------------------------------------------------
    114113
    115 void XPlane::checkResult(bool multi) throw(ProtocolException, IOException)
     114void XPlane::checkResult(bool multi)
    116115{
    117116    uint8_t result = stream->readU8();
     
    131130//------------------------------------------------------------------------------
    132131
    133 XPlane::~XPlane() throw()
     132XPlane::~XPlane() noexcept
    134133{
    135134    disconnect();
     
    145144//------------------------------------------------------------------------------
    146145
    147 void XPlane::connect() throw(IOException)
     146void XPlane::connect()
    148147{
    149148    if (socket!=0) return;
     
    180179//------------------------------------------------------------------------------
    181180
    182 void XPlane::disconnect() throw()
     181void XPlane::disconnect() noexcept
    183182{
    184183    if (socket==0) return;
     
    190189//------------------------------------------------------------------------------
    191190
    192 MultiGetter& XPlane::createMultiGetter() throw()
     191MultiGetter& XPlane::createMultiGetter() noexcept
    193192{
    194193    MultiGetter* getter = new MultiGetter(*this);
     
    199198//------------------------------------------------------------------------------
    200199
    201 MultiSetter& XPlane::createMultiSetter() throw()
     200MultiSetter& XPlane::createMultiSetter() noexcept
    202201{
    203202    MultiSetter* setter = new MultiSetter(*this);
     
    208207//------------------------------------------------------------------------------
    209208
    210 bool XPlane::destroyMultiBuffer(MultiBuffer& buffer) throw(Exception)
     209bool XPlane::destroyMultiBuffer(MultiBuffer& buffer)
    211210{
    212211    multiBuffers_t::iterator i = multiBuffers.find(&buffer);
     
    221220//------------------------------------------------------------------------------
    222221
    223 void XPlane::getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion)
    224     throw(Exception)
     222void XPlane::getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion)   
    225223{
    226224    stream->writeU8(Protocol::COMMAND_GET_VERSIONS);
     
    237235//------------------------------------------------------------------------------
    238236
    239 void XPlane::reloadPlugins() throw(Exception)
     237void XPlane::reloadPlugins()
    240238{
    241239    stream->writeU8(Protocol::COMMAND_RELOAD_PLUGINS);
     
    246244//------------------------------------------------------------------------------
    247245
    248 void XPlane::saveSituation(const char* path) throw(Exception)
     246void XPlane::saveSituation(const char* path)
    249247{
    250248    stream->writeU8(Protocol::COMMAND_SAVE_SITUATION);
     
    256254//------------------------------------------------------------------------------
    257255
    258 void XPlane::getScalar(const char* name, uint8_t type) throw(Exception)
     256void XPlane::getScalar(const char* name, uint8_t type)
    259257{
    260258    checkStream();
     
    270268//------------------------------------------------------------------------------
    271269
    272 int XPlane::getInt(const char* name) throw(Exception)
     270int XPlane::getInt(const char* name)
    273271{
    274272    getScalar(name, Protocol::TYPE_INT);
     
    281279//------------------------------------------------------------------------------
    282280
    283 float XPlane::getFloat(const char* name) throw(Exception)
     281float XPlane::getFloat(const char* name)
    284282{
    285283    getScalar(name, Protocol::TYPE_FLOAT);
     
    292290//------------------------------------------------------------------------------
    293291
    294 double XPlane::getDouble(const char* name) throw(Exception)
     292double XPlane::getDouble(const char* name)
    295293{
    296294    getScalar(name, Protocol::TYPE_DOUBLE);
     
    304302
    305303size_t XPlane::getArray(const char* name, uint8_t type,
    306                         ssize_t length, size_t offset) throw(Exception)
     304                        ssize_t length, size_t offset)
    307305{
    308306    checkStream();
     
    326324
    327325size_t XPlane::getFloatArray(const char* name, float* dest,
    328                              size_t length, size_t offset) throw(Exception)
     326                             size_t length, size_t offset)
    329327{
    330328    length = getArray(name, Protocol::TYPE_FLOAT_ARRAY, length, offset);
     
    338336
    339337float* XPlane::getFloatArray(const char* name, size_t& length,
    340                              size_t offset) throw(Exception)
     338                             size_t offset)
    341339{
    342340    length = getArray(name, Protocol::TYPE_FLOAT_ARRAY, -1, offset);
     
    350348
    351349size_t XPlane::getIntArray(const char* name, int32_t* dest,
    352                            size_t length, size_t offset) throw(Exception)
     350                           size_t length, size_t offset)
    353351{
    354352    length = getArray(name, Protocol::TYPE_INT_ARRAY, length, offset);
     
    362360
    363361int32_t* XPlane::getIntArray(const char* name, size_t& length,
    364                              size_t offset) throw(Exception)
     362                             size_t offset)
    365363{
    366364    length = getArray(name, Protocol::TYPE_INT_ARRAY, -1, offset);
     
    374372
    375373size_t XPlane::getByteArray(const char* name, uint8_t* dest,
    376                             size_t length, size_t offset) throw(Exception)
     374                            size_t length, size_t offset)
    377375{
    378376    length = getArray(name, Protocol::TYPE_BYTE_ARRAY, length, offset);
     
    386384
    387385uint8_t* XPlane::getByteArray(const char* name, size_t& length,
    388                               size_t offset) throw(Exception)
     386                              size_t offset)
    389387{
    390388    length = getArray(name, Protocol::TYPE_BYTE_ARRAY, -1, offset);
     
    397395//------------------------------------------------------------------------------
    398396
    399 string XPlane::getString(const char* name, size_t offset) throw(Exception)
     397string XPlane::getString(const char* name, size_t offset)
    400398{
    401399    size_t length = 0;
     
    406404//------------------------------------------------------------------------------
    407405
    408 void XPlane::setScalar(const char* name, uint8_t type) throw(Exception)
     406void XPlane::setScalar(const char* name, uint8_t type)
    409407{
    410408    stream->writeU8(Protocol::COMMAND_SET_SINGLE);
     
    415413//------------------------------------------------------------------------------
    416414
    417 void XPlane::setInt(const char* name, int value) throw(Exception)
     415void XPlane::setInt(const char* name, int value)
    418416{
    419417    setScalar(name, Protocol::TYPE_INT);
     
    425423//------------------------------------------------------------------------------
    426424
    427 void XPlane::setFloat(const char* name, float value) throw(Exception)
     425void XPlane::setFloat(const char* name, float value)
    428426{
    429427    setScalar(name, Protocol::TYPE_FLOAT);
     
    435433//------------------------------------------------------------------------------
    436434
    437 void XPlane::setDouble(const char* name, double value) throw(Exception)
     435void XPlane::setDouble(const char* name, double value)
    438436{
    439437    setScalar(name, Protocol::TYPE_DOUBLE);
     
    446444
    447445void XPlane::setArray(const char* name, uint8_t type, size_t length,
    448                       size_t offset) throw(Exception)
     446                      size_t offset)
    449447{
    450448    stream->writeU8(Protocol::COMMAND_SET_SINGLE);
     
    458456
    459457void XPlane::setFloatArray(const char* name, const float* values, size_t length,
    460                            size_t offset) throw(Exception)
     458                           size_t offset)
    461459{
    462460    setArray(name, Protocol::TYPE_FLOAT_ARRAY, length, offset);
     
    469467
    470468void XPlane::setIntArray(const char* name, const int32_t* values, size_t length,
    471                          size_t offset) throw(Exception)
     469                         size_t offset)
    472470{
    473471    setArray(name, Protocol::TYPE_INT_ARRAY, length, offset);
     
    480478
    481479void XPlane::setByteArray(const char* name, const uint8_t* values, size_t length,
    482                           size_t offset) throw(Exception)
     480                          size_t offset)
    483481{
    484482    setArray(name, Protocol::TYPE_BYTE_ARRAY, length, offset);
     
    491489
    492490void XPlane::setString(const char* name, const char* value, size_t length,
    493                        size_t offset) throw(Exception)
     491                       size_t offset)
    494492{
    495493    size_t valueLength = strlen(value);
     
    507505//------------------------------------------------------------------------------
    508506
    509 void XPlane::showMessage(const char* message, float duration) throw(Exception)
     507void XPlane::showMessage(const char* message, float duration)
    510508{
    511509    stream->writeU8(Protocol::COMMAND_SHOW_MESSAGE);
     
    519517
    520518void XPlane::registerHotkeys(const uint16_t* codes, size_t length)
    521     throw(Exception)
     519   
    522520{
    523521    stream->writeU8(Protocol::COMMAND_REGISTER_HOTKEYS);
     
    530528//------------------------------------------------------------------------------
    531529
    532 void XPlane::queryHotkeys(uint8_t* states, size_t length) throw(Exception)
     530void XPlane::queryHotkeys(uint8_t* states, size_t length)
    533531{
    534532    stream->writeU8(Protocol::COMMAND_QUERY_HOTKEYS);
Note: See TracChangeset for help on using the changeset viewer.