Structure to enable supporting EventData that has various different types Byte - caters for 8 bit unsigned integer data (uint8_t x) Integer - caters for signed integer data (int y) Loco - caters for a pointer to a DCCEXProtocol Loco object (Loco *loco) None - caters for events that contain no data and are notification only When adding new data types:
More...
#include <EventStructure.h>
|
| | EventData (uint8_t value) |
| | Constructor for events with a uint8_t parameter.
|
| |
| | EventData (int value) |
| | Constructor for events with an int parameter.
|
| |
| | EventData (Loco *value) |
| | Constructor for events with a Loco pointer.
|
| |
| | EventData () |
| | Constructor for events with no data or parameters.
|
| |
| | EventData (TrackPower value) |
| | Constructor for events containing track power.
|
| |
| | EventData (LocoBroadcast value) |
| | Constructor for events containing loco broadcasts.
|
| |
Structure to enable supporting EventData that has various different types Byte - caters for 8 bit unsigned integer data (uint8_t x) Integer - caters for signed integer data (int y) Loco - caters for a pointer to a DCCEXProtocol Loco object (Loco *loco) None - caters for events that contain no data and are notification only When adding new data types:
- Add type to the DataType enum
- Add the type to the union
- Add a new constructor for EventData
◆ DataType
| Enumerator |
|---|
| ByteData | |
| IntegerData | |
| LocoData | |
| NoneData | |
| TrackPowerData | |
| LocoBroadcastData | |
◆ EventData() [1/6]
| EventData::EventData |
( |
uint8_t |
value | ) |
|
|
inline |
Constructor for events with a uint8_t parameter.
- Parameters
-
◆ EventData() [2/6]
| EventData::EventData |
( |
int |
value | ) |
|
|
inline |
Constructor for events with an int parameter.
- Parameters
-
◆ EventData() [3/6]
| EventData::EventData |
( |
Loco * |
value | ) |
|
|
inline |
Constructor for events with a Loco pointer.
- Parameters
-
| value | Pointer to a loco object |
◆ EventData() [4/6]
Constructor for events with no data or parameters.
◆ EventData() [5/6]
| EventData::EventData |
( |
TrackPower |
value | ) |
|
|
inline |
Constructor for events containing track power.
◆ EventData() [6/6]
Constructor for events containing loco broadcasts.
- Parameters
-
◆ [union]
◆ byteValue
| uint8_t EventData::byteValue |
◆ dataType
◆ intValue
◆ locoBroadcastValue
◆ locoValue
| Loco* EventData::locoValue |
◆ trackPowerValue
| TrackPower EventData::trackPowerValue |
The documentation for this struct was generated from the following file: