22 #ifndef INCLUDE_OLAD_DMXSOURCE_H_
23 #define INCLUDE_OLAD_DMXSOURCE_H_
26 #include <ola/Clock.h>
40 m_priority(PRIORITY_MIN) {
47 m_timestamp(timestamp),
48 m_priority(priority) {
52 m_buffer = other.m_buffer;
53 m_timestamp = other.m_timestamp;
54 m_priority = other.m_priority;
63 m_buffer = other.m_buffer;
64 m_timestamp = other.m_timestamp;
65 m_priority = other.m_priority;
74 bool operator==(
const DmxSource &other)
const {
75 return (m_buffer == other.m_buffer &&
76 m_timestamp == other.m_timestamp &&
77 m_priority == other.m_priority);
87 m_timestamp = timestamp;
88 m_priority = priority;
95 const DmxBuffer &Data()
const {
return m_buffer; }
101 const TimeStamp &Timestamp()
const {
return m_timestamp; }
107 bool IsActive(
const TimeStamp &now)
const {
108 TimeStamp timeout = m_timestamp + TIMEOUT_INTERVAL;
109 return now < timeout;
117 return m_timestamp.IsSet();
124 uint8_t Priority()
const {
return m_priority; }
126 static const uint8_t PRIORITY_MIN;
127 static const uint8_t PRIORITY_MAX;
128 static const uint8_t PRIORITY_DEFAULT;
138 #endif // INCLUDE_OLAD_DMXSOURCE_H_