7#include <ChimeraTK/ReadAnyGroup.h>
8#include <ChimeraTK/TransferElement.h>
14 class ApplicationModule;
25 Module(
EntityOwner* owner,
const std::string& name,
const std::string& description,
26 const std::unordered_set<std::string>& tags = {});
72 void readAll(
bool includeReturnChannels =
false);
84 void writeAll(
bool includeReturnChannels =
false);
Generic module to read an XML config file and provide the defined values as constant variables.
Base class for owners of other EntityOwners (e.g.
virtual size_t getCircularNetworkHash() const =0
Get the ID of the circular dependency network (0 if none).
virtual void decrementDataFaultCounter()=0
Decrement the fault counter and set the data validity flag to ok if the counter has reached 0.
virtual void incrementDataFaultCounter()=0
Set the data validity flag to fault and increment the fault counter.
virtual void setCurrentVersionNumber(VersionNumber versionNumber)=0
Set the current version number.
virtual VersionNumber getCurrentVersionNumber() const =0
Return the current version number which has been received with the last push-type read operation.
virtual DataValidity getDataValidity() const =0
Return the data validity flag.
Base class for ApplicationModule and DeviceModule, to have a common interface for these module types.
void readAllLatest(bool includeReturnChannels=false)
Just call readLatest() on all readable variables in the group.
std::string getQualifiedName() const override
Get the fully qualified name of the module instance, i.e.
virtual void postConstruct()
Hook function called on all Modules of an Application after the Application constructor is complete b...
VersionNumber getCurrentVersionNumber() const override
Return the current version number which has been received with the last push-type read operation.
void setCurrentVersionNumber(VersionNumber version) override
Set the current version number.
void readAll(bool includeReturnChannels=false)
Read all readable variables in the group.
void readAllNonBlocking(bool includeReturnChannels=false)
Just call readNonBlocking() on all readable variables in the group.
void decrementDataFaultCounter() override
Decrement the fault counter and set the data validity flag to ok if the counter has reached 0.
EntityOwner * _owner
Owner of this instance.
void disable()
Disable the module such that it is not part of the Application.
size_t getCircularNetworkHash() const override
Get the ID of the circular dependency network (0 if none).
void writeAllDestructively(bool includeReturnChannels=false)
Just call writeDestructively() on all writable variables in the group.
DataValidity getDataValidity() const override
Return the data validity flag.
Module * findApplicationModule()
Find ApplicationModule owner.
Module(Module &&other) noexcept
Move constructor.
std::list< EntityOwner * > getInputModulesRecursively(std::list< EntityOwner * > startList) override
Use pointer to the module as unique identifier.
~Module() override
Destructor.
Module & operator=(Module &&other) noexcept
Move assignment operator.
static ConfigReader & appConfig()
Obtain the ConfigReader instance of the application.
ChimeraTK::ReadAnyGroup readAnyGroup()
Create a ChimeraTK::ReadAnyGroup for all readable variables in this Module.
void setOwner(EntityOwner *newOwner)
Set a new owner.
EntityOwner * getOwner() const
void writeAll(bool includeReturnChannels=false)
Just call write() on all writable variables in the group.
std::string getFullDescription() const override
Obtain the full description including the full description of the owner.
virtual void run()
Execute the module.
Module()=default
Default constructor: Allows late initialisation of modules (e.g.
virtual void terminate()
Terminate the module.
void incrementDataFaultCounter() override
Set the data validity flag to fault and increment the fault counter.
virtual std::string getVirtualQualifiedName() const =0
virtual void prepare()
Prepare the execution of the module.
InvalidityTracer application module.