iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::MessageCheckerCore< Checking > Class Template Reference

#include <nrt/Core/Blackboard/details/ModulePortHelpers.H>

template<class Checking>
class nrt::MessageCheckerCore< Checking >

Module objects which derive from MessageChecker will be allowed to post Message objects.

Definition at line 58 of file Blackboard.H.

Inheritance diagram for nrt::MessageCheckerCore< Checking >:
nrt::ModuleBase nrt::MessageCheckerCoreBase

Public Types

typedef Checking CheckingType
 Our underlying subscription type (used by Connectors)

Public Member Functions

 MessageCheckerCore ()
 Constructor, will register us with the Blackboard.
virtual ~MessageCheckerCore ()
 Destructor, will un-register us with the Blackboard.
virtual bool isSplit () const
 Return true if we currently have split-sub-checkers. More...
< typename Checking::MsgType > 
check (MessageCheckerPolicy const mcp=MessageCheckerPolicy::Unseen) const
 Check for a message on the Blackboard. More...
std::string make_connector (std::string const &name, std::string const &namespc, nrt::ConnectorType const type, std::string const &topic, std::string const &topicfilter) const
 Create a connector for this port's Checking type on the master Blackboard. More...
- Public Member Functions inherited from nrt::ModuleBase
 ModuleBase ()
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.
- Public Member Functions inherited from nrt::MessageCheckerCoreBase
virtual ~MessageCheckerCoreBase ()
 Virtual destructor for safe inheritance.
void setTopicFilter (std::string const &topicfilt_)
 Set the Topic Filter for this checking. More...


template<class... >
class nrt::MessageChecker
class nrt::Blackboard
template<class T >
class nrt::ParameterCore

Additional Inherited Members

- Protected Attributes inherited from nrt::ModuleBase
boost::shared_mutex itsNamespaceMtx
std::string namespc
std::string logicalpath
- Protected Attributes inherited from nrt::MessageCheckerCoreBase
std::string msgtype
 Type of Message we check for.
std::string module
 Module which we belong to.
std::string portname
 String name for our Checking port class.
std::string description
 String human description for our Checking.
std::string topicfilt
 TopicFilter with which we check()
int sequence
 Checker sequence number within module used for ordering of ports in the GUI.
bool splittable
 Can this port be split into sub-ports?
< nrt::blackboard::msgkey > 
< nrt::blackboard::MessageCheckerRemoteCall > 
boost::shared_mutex mtx

Member Function Documentation

template<class Checking >
bool nrt::MessageCheckerCore< Checking >::isSplit ( ) const

Return true if we currently have split-sub-checkers.

Currently, this is always false, no support yet for split checkers

Implements nrt::MessageCheckerCoreBase.

Definition at line 705 of file ModulePortImpl.H.

template<class Checking >
nrt::MessageCheckerResults< typename Checking::MsgType > nrt::MessageCheckerCore< Checking >::check ( nrt::MessageCheckerPolicy const  mcp = MessageCheckerPolicy::Unseen) const

Check for a message on the Blackboard.

mcppolicy, either only return new messages which have not been returned yet by previous identical check() calls from that exact identical caller, or return all matching messages, previously seen or not.

Note that the declaration of check() is a bit obfuscated by the SFINAE paradigm used to allow multiple checkers in one Module; the simplified declaration would look essentially like this:

Note that an exception will be thrown if you try to check() from a MessageChecker that is not attached to a Module, or if you try to check() while the system in not in the running() state. Have a look at Component.H and Manager.H for some explanations about the running() state.

Definition at line 716 of file ModulePortImpl.H.

References nrt::async(), BBTHROW, BBTHROWX, nrt::Singleton< T >::instance(), NRT_BBDEBUG, and NRT_WARNING.

template<class Checking >
std::string nrt::MessageCheckerCore< Checking >::make_connector ( std::string const &  name,
std::string const &  namespc,
nrt::ConnectorType const  type,
std::string const &  topic,
std::string const &  topicfilter 
) const

Create a connector for this port's Checking type on the master Blackboard.

The connector uid. This is the only way to "access" the connector, as it lives hidden deep inside the master Blackboard. The Blackboard class exposes functions that allow one to set connector topics, etc using the connector uid to address a particular connector.

Beware of the order of the topic and topicfilter arguments as they differ between the poster checker and subscriber version of make_connector. Think of the first one as directly connected to the physical port, and the other one as the other end of the connector.

Definition at line 797 of file ModulePortImpl.H.

References nrt::Checker, and nrt::Singleton< T >::instance().

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