2020-07-09 23:20:48 +02:00
|
|
|
#ifndef FRAMEWORK_OBJECTMANAGER_SYSTEMOBJECTIF_H_
|
|
|
|
#define FRAMEWORK_OBJECTMANAGER_SYSTEMOBJECTIF_H_
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
#include <framework/events/EventReportingProxyIF.h>
|
|
|
|
#include <framework/returnvalues/HasReturnvaluesIF.h>
|
2020-07-09 23:20:48 +02:00
|
|
|
#include <cstdint>
|
2016-06-15 23:48:41 +02:00
|
|
|
/**
|
2020-07-09 23:20:48 +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.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the typedef for object identifiers.
|
2020-07-09 23:20:48 +02:00
|
|
|
* @ingroup system_objects
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
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-07-09 23:20:48 +02:00
|
|
|
* @author Bastian Baetz
|
|
|
|
* @ingroup system_objects
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
class SystemObjectIF : public EventReportingProxyIF {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* This is a simple getter to return the object identifier.
|
|
|
|
* @return Returns the object id of this object.
|
|
|
|
*/
|
2018-07-12 16:29:32 +02:00
|
|
|
virtual object_id_t getObjectId() const = 0;
|
2016-06-15 23:48:41 +02:00
|
|
|
/**
|
|
|
|
* The empty virtual destructor as required for C++ interfaces.
|
|
|
|
*/
|
2020-07-09 23:20:48 +02:00
|
|
|
virtual ~SystemObjectIF() {}
|
2016-06-15 23:48:41 +02:00
|
|
|
/**
|
2020-07-09 23:20:48 +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
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual ReturnValue_t initialize() = 0;
|
|
|
|
/**
|
2020-07-09 23:20:48 +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
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual ReturnValue_t checkObjectConnections() = 0;
|
|
|
|
};
|
|
|
|
|
2020-07-09 23:20:48 +02:00
|
|
|
#endif /* FRAMEWORK_OBJECTMANAGER_SYSTEMOBJECTIF_H_ */
|