14 template<
typename InputType,
typename OutputType = InputType,
size_t NELEMS = 1>
18 output(this,
"output",
"", NELEMS, description),
factor(theFactor) {}
28 if(!std::numeric_limits<OutputType>::is_integer) {
29 for(
size_t i = 0; i < NELEMS; ++i) {
34 for(
size_t i = 0; i < NELEMS; ++i) {
49 template<
typename InputType,
typename OutputType = InputType,
size_t NELEMS = 1>
53 Multiplier(
ModuleGroup* owner,
const std::string& name,
const std::string& factorName,
const std::string& unitInput,
54 const std::string& unitOutput,
const std::string& description,
55 const std::unordered_set<std::string>& tagsInput = {},
const std::unordered_set<std::string>& tagsOutput = {},
56 const std::unordered_set<std::string>& tagsFactor = {})
58 input.
replace(ArrayPushInput<InputType>(
input, name, unitInput, NELEMS, description, tagsInput));
60 input, factorName,
"(" + unitOutput +
")/(" + unitInput +
")", description, tagsFactor));
61 output.replace(ArrayOutput<OutputType>(
input, name, unitOutput, NELEMS, description, tagsOutput));
65 const std::string& factorPath,
const std::string& outputPath,
const std::string& outputUnit,
66 const std::string& description,
const std::unordered_set<std::string>& inputTags = {},
67 const std::unordered_set<std::string>& factorTags = {},
const std::unordered_set<std::string>& outputTags = {})
69 std::string factorUnit =
"(" + outputUnit +
")/(" + inputUnit +
")";
70 input.
replace(ArrayPushInput<InputType>(
this, inputPath, inputUnit, NELEMS, description, inputTags));
71 factor.
replace(ScalarPushInput<InputType>(
this, factorPath, factorUnit, description, factorTags));
72 output.replace(ArrayOutput<InputType>(
this, outputPath, outputUnit, NELEMS, description, outputTags));
83 if constexpr(!std::numeric_limits<OutputType>::is_integer) {
84 for(
size_t i = 0; i < NELEMS; ++i) {
89 for(
size_t i = 0; i < NELEMS; ++i) {
104 template<
typename InputType,
typename OutputType = InputType,
size_t NELEMS = 1>
109 divider(this,
"divider",
"",
"Divider to scale the input value with"),
110 output(this,
"output",
"", NELEMS, description) {}
120 if(!std::numeric_limits<OutputType>::is_integer) {
121 for(
size_t i = 0; i < NELEMS; ++i) {
126 for(
size_t i = 0; i < NELEMS; ++i) {
ApplicationModule()=default
Default constructor: Allows late initialisation of modules (e.g.
void replace(const ChimeraTK::NDRegisterAccessorAbstractor< UserType > &newAccessor)=delete
void replace(const ChimeraTK::NDRegisterAccessorAbstractor< UserType > &newAccessor)=delete
InvalidityTracer application module.
Convenience class for output array accessors (always UpdateMode::push)
ArrayPushInput< InputType > input
ArrayOutput< OutputType > output
ConstMultiplier(ModuleGroup *owner, const std::string &name, const std::string &description, double theFactor)
void mainLoop() override
To be implemented by the user: function called in a separate thread executing the main loop of the mo...
void mainLoop() override
To be implemented by the user: function called in a separate thread executing the main loop of the mo...
Divider(ModuleGroup *owner, const std::string &name, const std::string &description)
ArrayOutput< OutputType > output
ArrayPushInput< InputType > input
ScalarPushInput< double > divider
Multiplier(ModuleGroup *owner, const std::string &name, const std::string &factorName, const std::string &unitInput, const std::string &unitOutput, const std::string &description, const std::unordered_set< std::string > &tagsInput={}, const std::unordered_set< std::string > &tagsOutput={}, const std::unordered_set< std::string > &tagsFactor={})
ArrayOutput< OutputType > output
ArrayPushInput< InputType > input
ApplicationModule()=default
Default constructor: Allows late initialisation of modules (e.g.
Multiplier(ModuleGroup *owner, const std::string &inputPath, const std::string &inputUnit, const std::string &factorPath, const std::string &outputPath, const std::string &outputUnit, const std::string &description, const std::unordered_set< std::string > &inputTags={}, const std::unordered_set< std::string > &factorTags={}, const std::unordered_set< std::string > &outputTags={})
ScalarPushInput< double > factor
void mainLoop() override
To be implemented by the user: function called in a separate thread executing the main loop of the mo...