Replaced Magic Numbers
This commit is contained in:
parent
6d0bc26624
commit
03ef63302b
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
SubsystemBase::SubsystemBase(object_id_t setObjectId, object_id_t parent,
|
SubsystemBase::SubsystemBase(object_id_t setObjectId, object_id_t parent,
|
||||||
Mode_t initialMode, uint16_t commandQueueDepth) :
|
Mode_t initialMode, uint16_t commandQueueDepth) :
|
||||||
SystemObject(setObjectId), mode(initialMode), submode(SUBMODE_NONE),
|
SystemObject(setObjectId), mode(initialMode),
|
||||||
childrenChangedMode(false),
|
|
||||||
commandQueue(QueueFactory::instance()->createMessageQueue(
|
commandQueue(QueueFactory::instance()->createMessageQueue(
|
||||||
commandQueueDepth, CommandMessage::MAX_MESSAGE_SIZE)),
|
commandQueueDepth, CommandMessage::MAX_MESSAGE_SIZE)),
|
||||||
healthHelper(this, setObjectId), modeHelper(this), parentId(parent) {
|
healthHelper(this, setObjectId), modeHelper(this), parentId(parent) {
|
||||||
@ -167,16 +166,16 @@ MessageQueueId_t SubsystemBase::getCommandQueue() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t SubsystemBase::initialize() {
|
ReturnValue_t SubsystemBase::initialize() {
|
||||||
MessageQueueId_t parentQueue = 0;
|
MessageQueueId_t parentQueue = MessageQueueIF::NO_QUEUE;
|
||||||
ReturnValue_t result = SystemObject::initialize();
|
ReturnValue_t result = SystemObject::initialize();
|
||||||
|
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parentId != 0) {
|
if (parentId != objects::NO_OBJECT) {
|
||||||
SubsystemBase *parent = objectManager->get<SubsystemBase>(parentId);
|
SubsystemBase *parent = objectManager->get<SubsystemBase>(parentId);
|
||||||
if (parent == NULL) {
|
if (parent == nullptr) {
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
parentQueue = parent->getCommandQueue();
|
parentQueue = parent->getCommandQueue();
|
||||||
|
@ -56,9 +56,9 @@ protected:
|
|||||||
|
|
||||||
Mode_t mode;
|
Mode_t mode;
|
||||||
|
|
||||||
Submode_t submode;
|
Submode_t submode = SUBMODE_NONE;
|
||||||
|
|
||||||
bool childrenChangedMode;
|
bool childrenChangedMode = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Always check this against <=0, so you are robust against too many replies
|
* Always check this against <=0, so you are robust against too many replies
|
||||||
|
Loading…
Reference in New Issue
Block a user