Newer
Older
Martin Christoph Hierholzer
committed
/*
* ControlSystemModule.h
*
* Created on: Jun 28, 2016
* Author: Martin Hierholzer
*/
#ifndef CHIMERATK_CONTROL_SYSTEM_MODULE_H
#define CHIMERATK_CONTROL_SYSTEM_MODULE_H
Martin Christoph Hierholzer
committed
#include <list>
Martin Christoph Hierholzer
committed
#include <mtca4u/RegisterPath.h>
#include "VariableNetworkNode.h"
#include "Module.h"
namespace ChimeraTK {
class ControlSystemModule : public Module {
public:
/** Constructor: the optional variableNamePrefix will be prepended to all control system variable names
* (separated by a slash). */
ControlSystemModule(const std::string& variableNamePrefix="");
Martin Christoph Hierholzer
committed
/** The function call operator returns a VariableNetworkNode which can be used in the Application::initialise()
Martin Christoph Hierholzer
committed
* function to connect the control system variable with another variable. */
Martin Christoph Hierholzer
committed
VariableNetworkNode operator()(const std::string& variableName, const std::type_info &valueType,
Martin Christoph Hierholzer
committed
size_t nElements=0) const;
VariableNetworkNode operator()(const std::string& variableName) const override {
Martin Christoph Hierholzer
committed
return operator()(variableName, typeid(AnyType));
}
Martin Christoph Hierholzer
committed
Module& operator[](const std::string& moduleName) const override;
Martin Christoph Hierholzer
committed
protected:
mtca4u::RegisterPath variableNamePrefix;
Martin Christoph Hierholzer
committed
Martin Christoph Hierholzer
committed
// List of sub modules accessed through the operator[]. This is mutable since it is little more than a cache and
// thus does not change the logical state of this module
Martin Christoph Hierholzer
committed
mutable std::map<std::string, ControlSystemModule> subModules;
Martin Christoph Hierholzer
committed
// List of variables accessed through the operator(). This is mutable since it is little more than a cache and
// thus does not change the logical state of this module
mutable std::map<std::string, VariableNetworkNode> variables;
Martin Christoph Hierholzer
committed
};
} /* namespace ChimeraTK */
#endif /* CHIMERATK_CONTROL_SYSTEM_MODULE_H */