fsfw/src/fsfw/objectmanager/SystemObject.cpp

32 lines
1001 B
C++
Raw Permalink Normal View History

2021-07-13 20:22:54 +02:00
#include "fsfw/objectmanager/SystemObject.h"
2022-02-02 10:29:30 +01:00
2021-07-13 20:22:54 +02:00
#include "fsfw/events/EventManagerIF.h"
2022-02-02 10:29:30 +01:00
#include "fsfw/objectmanager/ObjectManager.h"
2022-02-02 10:29:30 +01:00
SystemObject::SystemObject(object_id_t setObjectId, bool doRegister)
: objectId(setObjectId), registered(doRegister) {
if (registered) {
ObjectManager::instance()->insert(objectId, this);
}
}
SystemObject::~SystemObject() {
2022-02-02 10:29:30 +01:00
if (registered) {
ObjectManager::instance()->remove(objectId);
}
}
2022-02-02 10:29:30 +01:00
object_id_t SystemObject::getObjectId() const { return objectId; }
2022-02-02 10:29:30 +01:00
void SystemObject::triggerEvent(Event event, uint32_t parameter1, uint32_t parameter2) {
EventManagerIF::triggerEvent(objectId, event, parameter1, parameter2);
}
2022-08-16 01:08:26 +02:00
ReturnValue_t SystemObject::initialize() { return returnvalue::OK; }
2022-08-16 01:08:26 +02:00
ReturnValue_t SystemObject::checkObjectConnections() { return returnvalue::OK; }
void SystemObject::forwardEvent(Event event, uint32_t parameter1, uint32_t parameter2) const {
2022-02-02 10:29:30 +01:00
EventManagerIF::triggerEvent(objectId, event, parameter1, parameter2);
}