diff options
Diffstat (limited to 'src/components/transport_manager/include/transport_manager/transport_manager_default.h')
-rw-r--r-- | src/components/transport_manager/include/transport_manager/transport_manager_default.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_default.h b/src/components/transport_manager/include/transport_manager/transport_manager_default.h index 7fb0904fdf..63061b14b7 100644 --- a/src/components/transport_manager/include/transport_manager/transport_manager_default.h +++ b/src/components/transport_manager/include/transport_manager/transport_manager_default.h @@ -44,12 +44,36 @@ class LastState; namespace transport_manager { +struct TransportAdapterFactory { + TransportAdapterFactory(); + template <typename... Args> + using CreatorTA = + std::function<transport_adapter::TransportAdapter*(Args&&... args)>; +#ifdef BLUETOOTH_SUPPORT + CreatorTA<resumption::LastState&, const TransportManagerSettings&> + ta_bluetooth_creator_; +#endif + CreatorTA<const uint16_t, + resumption::LastState&, + const TransportManagerSettings&> + ta_tcp_creator_; +#if defined(USB_SUPPORT) + CreatorTA<resumption::LastState&, const TransportManagerSettings&> + ta_usb_creator_; +#endif +#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT) + CreatorTA<resumption::LastState&, const TransportManagerSettings&> + ta_cloud_creator_; +#endif +}; + /** * @brief Default realization of transport_manager_impl class. */ class TransportManagerDefault : public TransportManagerImpl { public: - explicit TransportManagerDefault(const TransportManagerSettings& settings); + explicit TransportManagerDefault(const TransportManagerSettings& settings, + const TransportAdapterFactory& ta_factory_); /** * @brief Initialize transport manager. @@ -63,6 +87,8 @@ class TransportManagerDefault : public TransportManagerImpl { */ virtual ~TransportManagerDefault(); + private: + TransportAdapterFactory ta_factory_; DISALLOW_COPY_AND_ASSIGN(TransportManagerDefault); }; } // namespace transport_manager |