Describes the source of an event.
In case of IO, that is defined as the source subsystem (analog, digital_out, etc) and in input used for reading a value.
#include <io_event_source.h>
|
| enum class | source {
analog = 0x2f5f3
, digital_out = 0x30f15
, digital_in = 0x4e2f1
, pwm_out = 0x50bff
,
pwm_in = 0x5f4f3
, i420 = 0x5f9ff
} |
| | The source enum contains unique constants to be used in the hash calculation.
|
|
| template<typename T> |
| | event_source (source src, T value, std::string label="") |
| | The class constructor.
|
| | event_source () |
| | The class default constructor.
|
| uint32_t | hash () const |
| | Return the cached hash value calculated at construction time.
|
| std::string | label () const |
| | Return the (optinal) label assigned to this event source at time of object construction.
|
|
| operator uint32_t () const |
| | Data conversion operator, allow converting event_source objects to uint32_t variables.
|
| bool | operator== (const event_source &other) const |
| | Equality operator, verifies if two event_source objects have the same value.
|
| bool | operator!= (const event_source &other) const |
| | Inequality operator, verifies if two event_source objects have different values.
|
| bool | operator< (const event_source &other) const |
| | operator < to be used when sorting event_source objects
|
Describes the source of an event.
In case of IO, that is defined as the source subsystem (analog, digital_out, etc) and in input used for reading a value.
◆ event_source() [1/2]
template<typename T>
| vsdk::io::event_source::event_source |
( |
source | src, |
|
|
T | value, |
|
|
std::string | label = "" ) |
|
inline |
The class constructor.
- Parameters
-
| src | The event source as defined in event_source::source. |
| value | A unique value to be combined with src. |
| label | An optional label to be given to the event source. |
- Note
- The value argument should be set as follows:
- for analog sources, it should be the handle of the sensor being monitored
- for digital in sources, it should be the channel being monitored (e.g. digin::channel::ch0)
- for pwm in sources, it should be the input being monitored (e.g. digin::pwm::pwm0)
◆ event_source() [2/2]
| vsdk::io::event_source::event_source |
( |
| ) |
|
|
inline |
The class default constructor.
In this case, hash will be zero.
◆ hash()
| uint32_t vsdk::io::event_source::hash |
( |
| ) |
const |
|
inline |
Return the cached hash value calculated at construction time.
- Returns
- The hash value.
◆ label()
| std::string vsdk::io::event_source::label |
( |
| ) |
const |
|
inline |
Return the (optinal) label assigned to this event source at time of object construction.
- Returns
- The event source label
◆ operator!=()
| bool vsdk::io::event_source::operator!= |
( |
const event_source & | other | ) |
const |
|
inline |
Inequality operator, verifies if two event_source objects have different values.
- Parameters
-
- Returns
- true if different, else false.
◆ operator<()
| bool vsdk::io::event_source::operator< |
( |
const event_source & | other | ) |
const |
|
inline |
operator < to be used when sorting event_source objects
- Parameters
-
- Returns
- true if this object has a hash value smaller than the other object.
◆ operator==()
| bool vsdk::io::event_source::operator== |
( |
const event_source & | other | ) |
const |
|
inline |
Equality operator, verifies if two event_source objects have the same value.
- Parameters
-
- Returns
- true if equal, else false.
The documentation for this class was generated from the following file: