fsfw/objectmanager/SystemObject.cpp

42 lines
1.0 KiB
C++
Raw Permalink Normal View History

2020-08-13 20:53:35 +02:00
#include "ObjectManager.h"
#include "SystemObject.h"
2020-09-18 13:32:53 +02:00
#include "../events/EventManagerIF.h"
SystemObject::SystemObject(object_id_t setObjectId, bool doRegister) :
objectId(setObjectId), registered(doRegister) {
if (registered) {
2021-01-27 20:04:16 +01:00
if(objectManager != nullptr) {
objectManager->insert(objectId, this);
}
}
}
SystemObject::~SystemObject() {
if (registered) {
2021-01-27 20:04:16 +01:00
if(objectManager != nullptr) {
objectManager->remove(objectId);
}
}
}
object_id_t SystemObject::getObjectId() const {
return objectId;
}
void SystemObject::triggerEvent(Event event, uint32_t parameter1,
uint32_t parameter2) {
EventManagerIF::triggerEvent(objectId, event, parameter1, parameter2);
}
ReturnValue_t SystemObject::initialize() {
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t SystemObject::checkObjectConnections() {
return HasReturnvaluesIF::RETURN_OK;
}
void SystemObject::forwardEvent(Event event, uint32_t parameter1, uint32_t parameter2) const {
EventManagerIF::triggerEvent(objectId, event, parameter1, parameter2);
}