BaseTransport.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * BaseTransport.h
8  *
9  * @author 2021 Slavey Karadzhov <slav@attachix.com>
10  *
11  *
12  ****/
13 
14 #pragma once
15 
16 #include <Stream.h>
17 #include <Delegate.h>
18 
19 namespace Hosted
20 {
21 namespace Transport
22 {
23 class BaseTransport
24 {
25 public:
26  using DataHandler = Delegate<bool(Stream&)>;
27 
28  virtual ~BaseTransport()
29  {
30  }
31 
33  {
34  this->handler = handler;
35  }
36 
37 protected:
39 };
40 
41 } // namespace Transport
42 
43 } // namespace Hosted
Base Stream class.
Definition: Wiring/Stream.h:32
Delegate< bool(Stream &)> DataHandler
Definition: BaseTransport.h:59
Definition: Components/Hosted/include/Hosted/Client.h:31
void onData(DataHandler handler)
Definition: BaseTransport.h:65
DataHandler handler
Definition: BaseTransport.h:71
virtual ~BaseTransport()
Definition: BaseTransport.h:61
Definition: Delegate.h:20