41 #include "WMTemplateContainers.h"
42 #include "core/kernel/WKernel.h"
43 #include "core/kernel/WModuleFactory.h"
44 #include "core/kernel/WPrototypeRequirement.h"
53 "Show the possibilities of combining and re-using existing modules in container modules." )
145 gauss->isReady().wait();
156 scalarOp->isReady().wait();
167 iso->isReady().wait();
177 gauss->getProperties()->getProperty(
"Iterations" )->set( 5 );
194 m_properties->addProperty( scalarOp->getProperties()->getProperty(
"Operation" ) );
196 scalarOp->getProperties()->getProperty(
"Operation" )->set( 1 );
200 iso->getProperties()->getProperty(
"Iso value" )->set( 1 );
212 scalarOp->getInputConnector(
"operandA" )->connect( gauss->getOutputConnector(
"out" ) );
224 iso->getInputConnector(
"values" )->connect( scalarOp->getOutputConnector(
"result" ) );
void setResetable(bool resetable=true, bool autoReset=true)
Sets the resetable flag.
WModuleOutputForwardData< WDataSetScalar >::SPtr m_output
Define an output connector, which only forwards the data.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
virtual ~WMTemplateContainers()
Destructor.
virtual void connectors()
Initialize the connectors this module is using.
virtual void requirements()
Initialize requirements for this module.
virtual void properties()
Initialize the properties for this module.
virtual void moduleMain()
Entry point after loading the module.
WMTemplateContainers()
Constuctor.
WModuleInputForwardData< WDataSetScalar >::SPtr m_input
Define an input connector, which only forwards the data.
Class able to contain other modules.
virtual void stop()
Stops all modules inside this container.
virtual void add(std::shared_ptr< WModule > module, bool run=true)
Add a module to this container and start it.
static SPtr getModuleFactory()
Returns instance of the module factory to use to create modules.
virtual void forward(std::shared_ptr< WModuleConnector > from)
Forward the output to the specified output.
static PtrType createAndAdd(std::shared_ptr< WModule > module, std::string name="", std::string description="")
Convenience method to create a new instance of this out data connector with proper type and add it to...
std::shared_ptr< WModule > SPtr
Shared pointer to a WModule.
Requirements m_requirements
The list of requirements.
virtual void properties()
Initialize properties in this function.
wlog::WStreamedLogger debugLog() const
Logger instance for comfortable debug logging.
std::shared_ptr< WProperties > m_properties
The property object for the module.
void ready()
Call this whenever your module is ready and can react on property changes.
WConditionSet m_moduleState
The internal state of the module.
virtual void connectors()
Initialize connectors in this function.
This requirement ensures that the specified prototype exists in the factory.
void waitForStop()
Let the thread sleep until a stop request was given.