iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::MessageChecker< Checker, Tail...> Class Template Reference

#include <nrt/Core/Blackboard/Module.H>

template<class Checker, class... Tail>
class nrt::MessageChecker< Checker, Tail...>

Module objects which derive from nrt::MessageChecker<Checking> will be allowed to check() for Message objects.

This interface exposes a check() function for the Checker's Message type. Modules that wish to check() for Message objects to the Blackboard must virtually derive from MessageChecker, as this is the only way to obtain check() access to the Blackboard.

check() is a fast and inexpensive function if the only posters posting messages with matching message type, namespace, and topic are local. It becomes a more expensive call if remote posters are known to possibly post matching messages, as those need to be remotely checked for, and if found, serialized and transported back to the checker over the network. In both cases, however, check() returns immediately, querying of remote Blackboards is dispatched in parallel threads, and a MessageCheckerResults object is returned which contains future access to the found messages, if any. Use message types, namespaces, and topics when building distributed systems to maximize throughput and minimize network congestion.

Canonical use example is as follows:

NRT_DECLARE_MESSAGECHECKER_PORT(AsyncInputA, MessageA, "MessageA Async Input");
class MyModule : public nrt::Module, public nrt::MessageChecker<AsyncInputA, MyOtherChecker, ...>
{
public:
void myMemberFunction() {
nrt::MessageCheckerResults<MessageA> result = AsyncInputA::check();
// may wait on the result, check returned messages, catch exceptions, etc see class MessageCheckerResults
}
}

Definition at line 120 of file Module.H.

Inheritance diagram for nrt::MessageChecker< Checker, Tail...>:
nrt::MessageChecker< Tail...>

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