// // Created by Netti, Alessio on 07.01.19. // #ifndef PROJECT_UNITINTERFACE_H #define PROJECT_UNITINTERFACE_H #include #include "sensorbase.h" // Defines how inputs must be constructed for the specified unit typedef enum inputMode_t { SELECTIVE = 1, ALL = 2, ALL_RECURSIVE = 3 } inputMode_t; /** * Interface for Units used by Analyzers to perform data analytics. * * An Unit represents a logical entity on which an Analyzer operates, and is identified by its name, inputs and outputs. */ class UnitInterface { public: /** * @brief Class constructor */ UnitInterface() {} /** * @brief Class destructor */ virtual ~UnitInterface() {} /** * @brief Sets the name of this unit * * @param name The name of this unit */ virtual void setName(const std::string& name) = 0; /** * @brief Get the name of this unit * * A unit's name points to the logical entity that it represents; for example, it could be * "hpcsystem1.node44", or "node44.cpu10". All the outputs of the unit are then associated to its * entity, and all of the input are related to it as well. * * @return The unit's name */ virtual std::string& getName() = 0; /** * @brief Sets the input mode of this unit * * @param iMode The input mode that was used for this unit */ virtual void setInputMode(const inputMode_t iMode) = 0; /** * @brief Get the input mode of this unit * * @return The unit's input mode */ virtual inputMode_t getInputMode() = 0; /** * @brief Get the (base) input sensors of this unit * * @return A vector of pointers to SensorBase objects that constitute this unit's input */ virtual std::vector& getBaseInputs() = 0; /** * @brief Get the (base) output sensors of this unit * * @return A vector of pointers to SensorBase objects that constitute this unit's output */ virtual std::vector& getBaseOutputs() = 0; /** * @brief Prints the current unit configuration * * @param ll Logging level at which the configuration is printed * @param lg Logger object to be used */ virtual void printConfig(LOG_LEVEL ll, LOGGER& lg) = 0; }; //for better readability using UnitPtr = std::shared_ptr; #endif //PROJECT_UNITINTERFACE_H