Merge pull request 'setTaskIF in periodic task' (#154) from KSat/fsfw:mueller/Linux-SetTaskIF-Fix into master
This commit is contained in:
commit
fddf31121d
@ -81,7 +81,7 @@ void PeriodicTask::taskFunctionality() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PeriodicTask::addComponent(object_id_t object, bool setTaskIF) {
|
ReturnValue_t PeriodicTask::addComponent(object_id_t object) {
|
||||||
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
||||||
object);
|
object);
|
||||||
if (newObject == nullptr) {
|
if (newObject == nullptr) {
|
||||||
@ -91,9 +91,7 @@ ReturnValue_t PeriodicTask::addComponent(object_id_t object, bool setTaskIF) {
|
|||||||
}
|
}
|
||||||
objectList.push_back(newObject);
|
objectList.push_back(newObject);
|
||||||
|
|
||||||
if(setTaskIF) {
|
newObject->setTaskIF(this);
|
||||||
newObject->setTaskIF(this);
|
|
||||||
}
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,8 +63,7 @@ public:
|
|||||||
* -@c RETURN_OK on success
|
* -@c RETURN_OK on success
|
||||||
* -@c RETURN_FAILED if the object could not be added.
|
* -@c RETURN_FAILED if the object could not be added.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t addComponent(object_id_t object,
|
ReturnValue_t addComponent(object_id_t object) override;
|
||||||
bool setTaskIF = true) override;
|
|
||||||
|
|
||||||
uint32_t getPeriodMs() const override;
|
uint32_t getPeriodMs() const override;
|
||||||
|
|
||||||
|
@ -21,8 +21,7 @@ void* PeriodicPosixTask::taskEntryPoint(void* arg) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object,
|
ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object) {
|
||||||
bool addTaskIF) {
|
|
||||||
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
||||||
object);
|
object);
|
||||||
if (newObject == nullptr) {
|
if (newObject == nullptr) {
|
||||||
|
@ -39,8 +39,7 @@ public:
|
|||||||
* @param object Id of the object to add.
|
* @param object Id of the object to add.
|
||||||
* @return RETURN_OK on success, RETURN_FAILED if the object could not be added.
|
* @return RETURN_OK on success, RETURN_FAILED if the object could not be added.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t addComponent(object_id_t object,
|
ReturnValue_t addComponent(object_id_t object) override;
|
||||||
bool addTaskIF = true) override;
|
|
||||||
|
|
||||||
uint32_t getPeriodMs() const override;
|
uint32_t getPeriodMs() const override;
|
||||||
|
|
||||||
|
@ -78,6 +78,8 @@ ReturnValue_t MultiObjectTask::addComponent(object_id_t object) {
|
|||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
objectList.push_back(newObject);
|
objectList.push_back(newObject);
|
||||||
|
newObject->setTaskIF(this);
|
||||||
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
/**
|
#ifndef FSFW_OSAL_RTEMS_MULTIOBJECTTASK_H_
|
||||||
* @file MultiObjectTask.h
|
#define FSFW_OSAL_RTEMS_MULTIOBJECTTASK_H_
|
||||||
* @brief This file defines the MultiObjectTask class.
|
|
||||||
* @date 30.01.2014
|
|
||||||
* @author baetz
|
|
||||||
*/
|
|
||||||
#ifndef MULTIOBJECTTASK_H_
|
|
||||||
#define MULTIOBJECTTASK_H_
|
|
||||||
|
|
||||||
#include "../../objectmanager/ObjectManagerIF.h"
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
#include "../../tasks/PeriodicTaskIF.h"
|
#include "../../tasks/PeriodicTaskIF.h"
|
||||||
@ -21,7 +15,7 @@ class ExecutableObjectIF;
|
|||||||
* @details MultiObjectTask is an extension to ObjectTask in the way that it is able to execute
|
* @details MultiObjectTask is an extension to ObjectTask in the way that it is able to execute
|
||||||
* multiple objects that implement the ExecutableObjectIF interface. The objects must be
|
* multiple objects that implement the ExecutableObjectIF interface. The objects must be
|
||||||
* added prior to starting the task.
|
* added prior to starting the task.
|
||||||
*
|
* @author baetz
|
||||||
* @ingroup task_handling
|
* @ingroup task_handling
|
||||||
*/
|
*/
|
||||||
class MultiObjectTask: public TaskBase, public PeriodicTaskIF {
|
class MultiObjectTask: public TaskBase, public PeriodicTaskIF {
|
||||||
@ -63,11 +57,11 @@ public:
|
|||||||
* @param object Id of the object to add.
|
* @param object Id of the object to add.
|
||||||
* @return RETURN_OK on success, RETURN_FAILED if the object could not be added.
|
* @return RETURN_OK on success, RETURN_FAILED if the object could not be added.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t addComponent(object_id_t object);
|
ReturnValue_t addComponent(object_id_t object) override;
|
||||||
|
|
||||||
uint32_t getPeriodMs() const;
|
uint32_t getPeriodMs() const override;
|
||||||
|
|
||||||
ReturnValue_t sleepFor(uint32_t ms);
|
ReturnValue_t sleepFor(uint32_t ms) override;
|
||||||
protected:
|
protected:
|
||||||
typedef std::vector<ExecutableObjectIF*> ObjectList; //!< Typedef for the List of objects.
|
typedef std::vector<ExecutableObjectIF*> ObjectList; //!< Typedef for the List of objects.
|
||||||
/**
|
/**
|
||||||
@ -110,4 +104,4 @@ protected:
|
|||||||
void taskFunctionality(void);
|
void taskFunctionality(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MULTIOBJECTTASK_H_ */
|
#endif /* FSFW_OSAL_RTEMS_MULTIOBJECTTASK_H_ */
|
||||||
|
@ -36,8 +36,7 @@ public:
|
|||||||
* to the component.
|
* to the component.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t addComponent(object_id_t object,
|
virtual ReturnValue_t addComponent(object_id_t object) {
|
||||||
bool setTaskIF = true) {
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user