mbed-os/features
Kevin Bracey 70a6701006 Improve nsapi_create_stack
Use tag dispatch to better handle both NetworkInterface and NetworkStack
pointers.

The previous design was intended to avoid ambiguities when presented
with a scenario like

    class MyDevice : public NetworkInterface, public NetworkStack {
    };

    TCPSocket(&MyDevice);
    // Need NetworkStack *: use NetworkInterface::get_stack or
    // cast to NetworkStack?

But the previous solution didn't actually work as intended. The overload
pair

    nsapi_create_stack(NetworkStack *);
    // versus
    template <class IF>
    nsapi_create_stack(IF *);

would only select the first form if passed an exact match -
`NetworkStack *`. If passed a derived class pointer, like `MyDevice *`,
it would select the template.

This meant that an ambiguity for MyDevice was at least avoided, but
in the wrong direction, potentially increasing code size.

But in other cases, the system just didn't work at all - you couldn't
pass a `MyStack *` pointer, unless you cast it to `NetworkStack *`.
Quite a few bits of test code do this.

Add a small bit of tag dispatch to prioritise the cast whenever the
supplied pointer is convertible to `NetworkStack *`.
2020-03-05 16:45:36 +02:00
..
FEATURE_BLE Merge pull request #12551 from rajkan01/mpm_remove_deprecated 2020-03-04 08:22:52 +00:00
FEATURE_BOOTLOADER Squashed 'features/nanostack/coap-service/' changes from 086e7ba..3c79829 2019-05-21 14:21:19 +03:00
cellular Merge pull request #12499 from u-blox/ubx_cellular 2020-03-04 07:58:51 +00:00
cryptocell/FEATURE_CRYPTOCELL310 NRF52840_DK: Fix baremetal linker error 2020-02-10 15:18:46 +00:00
deprecated_warnings Squashed 'features/nanostack/coap-service/' changes from 086e7ba..3c79829 2019-05-21 14:21:19 +03:00
device_key Remove explicit include of mbedtls/config.h 2020-02-27 09:45:22 +02:00
frameworks Merge pull request #12525 from rajkan01/ticker_remove_deprecated 2020-02-28 09:52:22 +00:00
lorawan Remove explicit include of mbedtls/config.h 2020-02-27 09:45:22 +02:00
lwipstack C++11-ify virtualisation in lwIP classes 2020-02-25 10:09:10 +02:00
mbedtls Merge pull request #12150 from Patater/update-tls-crypto-20191220 2020-02-10 13:04:12 +00:00
nanostack Merge pull request #12536 from DavidLin1577/patch-7 2020-03-04 13:23:26 +00:00
netsocket Improve nsapi_create_stack 2020-03-05 16:45:36 +02:00
nfc Remove float symbols from apps that use the NFCController class 2020-02-10 15:00:09 +00:00
storage Remove _variant_bd_erase_unit_size 2020-03-03 13:05:27 +02:00