fsfw/tasks/FixedSequenceSlot.h

58 lines
1.6 KiB
C
Raw Normal View History

2020-08-18 13:09:15 +02:00
#ifndef FRAMEWORK_TASKS_FIXEDSEQUENCESLOT_H_
#define FRAMEWORK_TASKS_FIXEDSEQUENCESLOT_H_
#include "../objectmanager/ObjectManagerIF.h"
#include "../tasks/ExecutableObjectIF.h"
class PeriodicTaskIF;
/**
* @brief This class is the representation of a single polling sequence
* table entry.
* @details
* The PollingSlot class is the representation of a single polling
* sequence table entry.
* @author baetz
*/
class FixedSequenceSlot {
public:
FixedSequenceSlot( object_id_t handlerId, uint32_t setTimeMs,
2020-08-24 22:08:27 +02:00
int8_t setSequenceId, ExecutableObjectIF* executableObject,
PeriodicTaskIF* executingTask);
2020-08-18 13:09:15 +02:00
virtual ~FixedSequenceSlot();
/**
2020-08-24 22:08:27 +02:00
* @brief Handler identifies which object is executed in this slot.
2020-08-18 13:09:15 +02:00
*/
2020-08-24 22:08:27 +02:00
ExecutableObjectIF* executableObject = nullptr;
2020-08-18 13:09:15 +02:00
/**
* @brief This attribute defines when a device handler object is executed.
2020-08-24 22:08:27 +02:00
* @details
* The pollingTime attribute identifies the time the handler is
* executed in ms. It must be smaller than the period length of the
* polling sequence.
2020-08-18 13:09:15 +02:00
*/
2020-08-24 22:08:27 +02:00
uint32_t pollingTimeMs;
2020-08-18 13:09:15 +02:00
/**
* @brief This value defines the type of device communication.
*
* @details The state of this value decides what communication routine is
* called in the PST executable or the device handler object.
*/
uint8_t opcode;
/**
* @brief Operator overload for the comparison operator to
* allow sorting by polling time.
* @param fixedSequenceSlot
* @return
*/
bool operator <(const FixedSequenceSlot & fixedSequenceSlot) const {
return pollingTimeMs < fixedSequenceSlot.pollingTimeMs;
}
};
#endif /* FIXEDSEQUENCESLOT_H_ */