iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MyModule Class Reference

What you derive from determines what you will be allowed to do when interacting with the Blackboard.

Examples:
tests/test-Module.C, and tests/test-split-messages.C.

Definition at line 83 of file test-Module.C.

Inheritance diagram for MyModule:
nrt::Parameter< dims > nrt::MessageSubscriber< InputA, InputCleft, InputCright, SubscriTestMM, SubscriTestMV > nrt::MessageChecker< AsyncInputA, AsyncInputC > nrt::MessagePoster< OutputA, OutputB, OutputCraw, OutputCfilt, PostTestMM, PostTestMV > nrt::Module nrt::MessageSubscriber< mymod::Input, mymod::Input2 > nrt::MessagePoster< mymod::Output, mymod::Output2 > nrt::Module

Public Member Functions

 MyModule (std::string const &instanceid="")
 Example constructor with instanceID.
 
void tryPost ()
 Example post()
 
void tryCheck (nrt::MessageCheckerPolicy const mcp)
 Example check()
 
void tryExpunge ()
 
virtual void onMessage (InputA::InPtr msg)
 Message callback for MessageA.
 
virtual std::unique_ptr< MessageA > onMessage (InputCleft::InPtr msg)
 Message callback for MessageC (first callback)
 
virtual InputCright::OutPtr onMessage (InputCright::InPtr msg)
 Message callback for MessageC (second callback)
 
virtual std::unique_ptr< MessageB > onMessage (SubscriTestMM::InPtr msg)
 Message callback for SubscriTestMM.
 
virtual void onMessage (SubscriTestMV::InPtr msg)
 Message callback for SubscriTestMV.
 
 MyModule (std::string const &instanceid="")
 
void onMessage (mymod::Input::InPtr msg)
 
void onMessage (mymod::Input2::InPtr msg)
 
void tryPost ()
 
- Public Member Functions inherited from nrt::Module
 Module (std::string const &instanceid="")
 Constructor.
 
virtual ~Module ()
 Virtual destructor for safe inheritance.
 
void setNamespace (std::string const &namespac)
 Set the module's namespace. More...
 
void changeNamespace (std::string const &oldnamespc, std::string const &newnamespc)
 If old namespace matches ours, then change ours to new namespace; otherwise, do nothing. More...
 
template<class Mod >
std::shared_ptr< Mod > addSubModule (std::string const &instanceName="")
 Create a message port for a Parameter of this module (or sub-Component or sub-Module) More...
 
template<class Mod >
void removeSubModule (std::shared_ptr< Mod > &module)
 Remove a sub-Module from this Module, by shared_ptr. More...
 
void removeSubModule (std::string const &instanceName)
 Remove a sub-Module from this Module, by instance name.
 
template<class Mod = nrt::Module>
std::shared_ptr< Mod > getSubModule (std::string const &instanceName) const
 Get a sub-module by instance name. More...
 
- Public Member Functions inherited from nrt::Component
 Component (std::string const &instanceName)
 Constructor. More...
 
void prepareForDeletion ()
 Prepare for deletion: uninit and disconnect from our parent. More...
 
virtual ~Component ()
 Virtual destructor for safe inheritance. More...
 
template<>
std::shared_ptr< ComponentgetSubComponent (std::string const &instanceName) const
 
template<class Comp >
std::shared_ptr< Comp > addSubComponent (std::string const &instanceName="")
 Pseudo-constructor: construct and add another component as a subcomponent of this one. More...
 
template<class Comp >
void removeSubComponent (std::shared_ptr< Comp > &component)
 Remove a sub-Component from this Component, by shared_ptr. More...
 
void removeSubComponent (std::string const &instanceName)
 Remove a sub-Component from this Component, by instance name.
 
template<class Comp = nrt::Component>
std::shared_ptr< Comp > getSubComponent (std::string const &instanceName) const
 Get a sub-component by instance name. More...
 
bool isTopLevel () const
 Returns true if this component is top-level, i.e., its parent is an nrt::Manager (including nrt::Blackboard)
 
bool initialized () const
 Has this component been initialized yet?
 
bool started () const
 Is this component started, i.e., it has passed the start() state and not yet entered the stop() state.
 
bool running () const
 Is this component running, i.e., has passed start() and been launch()ed and not yet entered the stop() state.
 
void wait ()
 Wait until all run() functions decide on their own that they are finished. More...
 
Component::MetaInfo const & meta () const
 Get the metainfo of this Component. More...
 
template<typename T >
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 Set a parameter value. More...
 
template<typename T >
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 Set a parameter value, simple version assuming only one parameter match. More...
 
template<typename T >
std::vector< std::pair
< std::string, T > > 
getParamVal (std::string const &paramdescriptor) const
 Get parameter(s) value(s) by descriptor. More...
 
template<typename T >
getParamValUnique (std::string const &paramdescriptor) const
 Get a parameter value, simple version assuming only one parameter match. More...
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 Set a parameter value, by string. More...
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 Set a parameter value by string, simple version assuming only one parameter match. More...
 
std::vector< std::pair
< std::string, std::string > > 
getParamString (std::string const &paramdescriptor) const
 Get a parameter value, by string. More...
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 Get a parameter value by string, simple version assuming only one parameter match. More...
 
std::string descriptor () const
 Get our full descriptor (including all parents) as [Classname-Instancename]:[...]:[...].
 
std::string parentModuleUID () const
 Get the ModuleUID (as string) of this Component's nearest parent Module, or an empty string.
 
void prettyPrintTree (std::ostream &os, int indent=0) const
 Produce a nice textual hierarchy of this Component's sub-tree.
 
std::vector< std::pair
< std::string,
nrt::ParameterSummary > > 
getParamSummary (std::string const &paramdescriptor) const
 Return a list of parameter summaries for a given descriptor. More...
 
std::vector< std::pair
< std::string,
nrt::ParameterSummary > > 
getParamSummary (bool skipsubmodules=false) const
 Return a list of parameter summaries for all parameters of this Component and its subcomponents. More...
 
void setPath (std::string const &path)
 Assign a filesystem path to this component.
 
std::string absolutePath (std::string const &path)
 If given path is relative (not starting with /), prepend the Component path to it; otherwise, no-op.
 
virtual void notifyAllParamChanged (nrt::ParameterState const state) const
 This method is called by the Blackboard to refresh a ParamChangedListener.
 
virtual void getAllParamSummaries (std::vector< nrt::ParameterSummary > &ps) const
 Recursively get all param summaries.
 
- Public Member Functions inherited from nrt::ParameterRegistry
void addParameter (ParameterBase *const param)
 The parameter class uses this method to register itself on construction with it's owning Component.
 
void removeParameter (ParameterBase *const param)
 The parameter class uses this method to un-register itself on destruction with it's owning Component.
 
- Public Member Functions inherited from nrt::ModuleBase
 ModuleBase ()
 Constructor.
 
virtual ~ModuleBase ()
 Virtual destructor for safe inheritance.
 
ModuleUID const & uid () const
 Get our unique ID which will be used to track Module objects in distributed systems.
 
std::string getNamespace () const
 Get the module's namespace. More...
 
void setLogicalPath (std::string const &lp)
 Set the logical path for this module, as categ/subcat/.../classname. More...
 
std::string getLogicalPath () const
 Get the logical path for this module, as categ/subcat/.../classname.
 

Additional Inherited Members

- Protected Member Functions inherited from nrt::Module
virtual void notifyParamChanged (nrt::ParameterState const state, ParameterBase const *const param) const
 Notification when a param is changed.
 
- Protected Attributes inherited from nrt::Component
boost::shared_mutex itsMtx
 Mutex used to protect our internals other than subcomponents and parameters.
 
std::vector< std::shared_ptr
< Component > > 
itsSubComponents
 
boost::shared_mutex itsSubMtx
 
Component *const nrt_component_this
 
- Protected Attributes inherited from nrt::ModuleBase
boost::shared_mutex itsNamespaceMtx
 
std::string namespc
 
std::string logicalpath
 

The documentation for this class was generated from the following files: