10#include <boost/thread.hpp>
39 const std::unordered_set<std::string>& tags = {});
129 auto name = boost::core::demangle(
typeid(*this).name());
130 return name.substr(name.find_last_of(
':') + 1);
boost::thread _moduleThread
The thread executing mainLoop()
DataValidity getDataValidity() const override
Return the data validity flag.
virtual void mainLoop()=0
To be implemented by the user: function called in a separate thread executing the main loop of the mo...
VersionNumber _currentVersionNumber
Version number of last push-type read operation - will be passed on to any write operations.
void unregisterModule(Module *module) override
Unregister another module as a sub-module.
ChimeraTK::Model::ApplicationModuleProxy _model
void run() override
Execute the module.
detail::CircularDependencyDetectionRecursionStopper _recursionStopper
Helper needed to stop the recursion when detecting circular dependency networks.
std::string className()
Name of the module class, used for logging and debugging purposes.
ApplicationModule()=default
Default constructor: Allows late initialisation of modules (e.g.
void terminate() override
Terminate the module.
ModuleType getModuleType() const override
Return the module type of this module, or in case of a VirtualModule the module type this VirtualModu...
Logger::StreamProxy logger(Logger::Severity severity)
Convenicene function to obtain a logger stream with the given Severity.
void decrementDataFaultCounter() override
Decrement the fault counter and set the data validity flag to ok if the counter has reached 0.
void setCircularNetworkHash(size_t circularNetworkHash)
Set the ID of the circular dependency network.
~ApplicationModule() override
Destructor.
void setCurrentVersionNumber(VersionNumber versionNumber) override
Set the current version number.
std::atomic< size_t > _dataFaultCounter
Number of inputs which report DataValidity::faulty.
std::list< EntityOwner * > getInputModulesRecursively(std::list< EntityOwner * > startList) override
Use pointer to the module as unique identifier.
size_t _circularNetworkHash
Unique ID for the circular dependency network.
void mainLoopWrapper()
Wrapper around mainLoop(), to execute additional tasks in the thread before entering the main loop.
VersionNumber getCurrentVersionNumber() const override
Return the current version number which has been received with the last push-type read operation.
size_t getCircularNetworkHash() const override
Get the ID of the circular dependency network (0 if none).
ChimeraTK::Model::ApplicationModuleProxy getModel()
Return the application model proxy representing this module.
void incrementDataFaultCounter() override
Set the data validity flag to fault and increment the fault counter.
ApplicationModule(ApplicationModule &&other) noexcept
Move operation with the move constructor.
ApplicationModule & operator=(ApplicationModule &&other) noexcept
Move assignment.
size_t getDataFaultCounter() const
Get the Number of inputs which report DataValidity::faulty.
Proxy for output stream, handed out to the log sources by the Logger::Module.
Severity
Severity levels used by the Logger.
Implementation class for the model.
Base class for ApplicationModule and DeviceModule, to have a common interface for these module types.
InvalidityTracer application module.
Logger::StreamProxy logger(Logger::Severity severity, std::string context)
Convenience function to obtain the logger stream.