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