BAOS SDK v2
1.0.1
An SDK providing access to IP-BAOS devices through BAOS binary protocol version 2.x
|
Represents an IOEvent. More...
#include <baos/connection/IOEvent.h>
Public Types | |
enum class | Type { UNKNOWN , OPEN , CLOSE , SOCKETERROR , RESPONSETIMEOUT , HEARTBEAT , RX_PACKET , TX_PACKET } |
The different possible event types. More... | |
using | UPtr = std::unique_ptr< IOEvent > |
An alias for an unique pointer to an IOEvent. | |
using | EventDataType = std::variant< ip::Ip4SocketAddress, std::unique_ptr< Buffer > > |
Public Member Functions | |
IOEvent ()=default | |
Default constructor, generating an empty IOEvent. | |
IOEvent (Type eventT, EventDataType &&pkt, protocol::ResponsePromise &&prom, std::uint64_t mID=0) | |
Construct a new IOEvent object. More... | |
Public Attributes | |
Type | eventType {Type::UNKNOWN} |
Stors the event type. | |
std::uint64_t | msgID {0} |
Stores the msgID. | |
protocol::ResponsePromise | responsePromise |
Stores the response promise to resolve later. | |
bool | promiseMoved {false} |
Flag to indicate thate the response promise was moved and is therefore invalid. | |
EventDataType | data_ |
The payload/data for this event. | |
Represents an IOEvent.
using EventDataType = std::variant<ip::Ip4SocketAddress, std::unique_ptr<Buffer> > |
The different possible datatypes inside an IOEvent
|
strong |
The different possible event types.
|
inline |
Construct a new IOEvent object.
eventT | The event type |
pkt | The data of this event as a std::variant |
prom | The promise which will be resolved if the event is handled |
mID | An unique message id to help with correlate the event |