fsfw/objectmanager/SystemObjectIF.h

63 lines
2.2 KiB
C
Raw Permalink Normal View History

2020-09-18 13:32:53 +02:00
#ifndef FSFW_OBJECTMANAGER_SYSTEMOBJECTIF_H_
#define FSFW_OBJECTMANAGER_SYSTEMOBJECTIF_H_
2020-08-13 20:53:35 +02:00
#include "../events/EventReportingProxyIF.h"
#include "../returnvalues/HasReturnvaluesIF.h"
2020-09-18 13:32:53 +02:00
#include <cstdint>
/**
2020-09-18 13:32:53 +02:00
* @defgroup system_objects Software System Object Management
* The classes to create System Objects and classes to manage these are
* contained in this group. System Objects are software elements that can be
* controlled externally. They all have a unique object identifier.
*/
/**
* This is the typedef for object identifiers.
2020-09-18 13:32:53 +02:00
* @ingroup system_objects
*/
typedef uint32_t object_id_t;
/**
* This interface allows a class to be included in the object manager
* list.
* It does not provide any method definitions, still it is required to
* perform a type check with dynamic_cast.
2020-09-18 13:32:53 +02:00
* @author Bastian Baetz
* @ingroup system_objects
*/
class SystemObjectIF : public EventReportingProxyIF {
public:
/**
* This is a simple getter to return the object identifier.
* @return Returns the object id of this object.
*/
virtual object_id_t getObjectId() const = 0;
/**
* The empty virtual destructor as required for C++ interfaces.
*/
2020-09-18 13:32:53 +02:00
virtual ~SystemObjectIF() {}
/**
2020-09-18 13:32:53 +02:00
* @brief Initializes the object.
* There are initialization steps which can also be done in the constructor.
* However, there is no clean way to get a returnvalue from a constructor.
* Furthermore some components require other system object to be created
* which might not have been built yet.
* Therefore, a two-step initialization resolves this problem and prevents
* circular dependencies of not-fully initialized objects on start up.
* @return - @c RETURN_OK in case the initialization was successful
* - @c RETURN_FAILED otherwise
*/
virtual ReturnValue_t initialize() = 0;
/**
2020-09-18 13:32:53 +02:00
* @brief Checks if all object-object interconnections are satisfying
* for operation.
* Some objects need certain other objects (or a certain number), to be
* registered as children. These checks can be done in this method.
* @return - @c RETURN_OK in case the check was successful
* - @c any other code otherwise
*/
virtual ReturnValue_t checkObjectConnections() = 0;
};
2020-09-18 13:32:53 +02:00
#endif /* #ifndef FSFW_OBJECTMANAGER_SYSTEMOBJECTIF_H_ */