|
BAOS SDK v2
1.2.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 , STACK_CONNECT_RESULT , STACK_DISCONNECT_RESULT , TIMER_ELAPSED } |
| The different possible event types. More... | |
| using | TimerIdList = std::vector< std::uint64_t > |
| using | UPtr = std::unique_ptr< IOEvent > |
| An alias for an unique pointer to an IOEvent. | |
| using | EventDataType = std::variant< std::monostate, ip::Ip4SocketAddress, std::unique_ptr< Buffer >, TimerIdList > |
| datatypes inside an IOEvent | |
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.
|
strong |
The different possible event types.
| IOEvent | ( | Type | eventT, |
| EventDataType && | pkt, | ||
| protocol::ResponsePromise && | prom, | ||
| std::uint64_t | mID = 0 |
||
| ) |
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 |