2020-09-18 13:31:51 +02:00
|
|
|
#ifndef FSFW_OBJECTMANAGER_SYSTEMOBJECT_H_
|
|
|
|
#define FSFW_OBJECTMANAGER_SYSTEMOBJECT_H_
|
2016-06-15 23:48:41 +02:00
|
|
|
|
2020-09-18 13:31:51 +02:00
|
|
|
#include "SystemObjectIF.h"
|
2020-08-23 20:27:00 +02:00
|
|
|
#include "../events/Event.h"
|
|
|
|
#include "../events/EventReportingProxyIF.h"
|
|
|
|
#include "../timemanager/Clock.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class automates insertion into the ObjectManager and
|
|
|
|
* management of the object id.
|
|
|
|
* @details This class is more a base class, which shall be inherited by any
|
|
|
|
* class that is announced to ObjectManager. It automatically includes
|
|
|
|
* itself (and therefore the inheriting class) in the object manager's
|
|
|
|
* list.
|
2020-09-18 13:40:48 +02:00
|
|
|
* @author Ulrich Mohr
|
2020-09-18 13:31:51 +02:00
|
|
|
* @ingroup system_objects
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
class SystemObject: public SystemObjectIF {
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* @brief This is the id the class instant got assigned.
|
|
|
|
*/
|
|
|
|
const object_id_t objectId;
|
|
|
|
const bool registered;
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper function to send Event Messages to the Event Manager
|
|
|
|
* @param event
|
|
|
|
* @param parameter1
|
|
|
|
* @param parameter2
|
|
|
|
*/
|
2020-09-18 13:31:51 +02:00
|
|
|
virtual void triggerEvent(Event event, uint32_t parameter1 = 0,
|
|
|
|
uint32_t parameter2 = 0);
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The class's constructor.
|
|
|
|
* @details In the constructor, the object id is set and the class is
|
|
|
|
* inserted in the object manager.
|
|
|
|
* @param setObjectId The id the object shall have.
|
2020-09-18 13:31:51 +02:00
|
|
|
* @param doRegister Determines if the object is registered in
|
|
|
|
* the global object manager.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
SystemObject(object_id_t setObjectId, bool doRegister = true);
|
|
|
|
/**
|
|
|
|
* @brief On destruction, the object removes itself from the list.
|
|
|
|
*/
|
|
|
|
virtual ~SystemObject();
|
2020-08-08 19:43:28 +02:00
|
|
|
object_id_t getObjectId() const override;
|
|
|
|
virtual ReturnValue_t initialize() override;
|
2016-06-15 23:48:41 +02:00
|
|
|
virtual ReturnValue_t checkObjectConnections();
|
|
|
|
|
2020-09-18 13:31:51 +02:00
|
|
|
virtual void forwardEvent(Event event, uint32_t parameter1 = 0,
|
|
|
|
uint32_t parameter2 = 0) const;
|
2016-06-15 23:48:41 +02:00
|
|
|
};
|
|
|
|
|
2020-09-18 13:31:51 +02:00
|
|
|
#endif /* FSFW_OBJECTMANAGER_SYSTEMOBJECT_H_ */
|