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

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

template<class Poster, class... Tail>
class nrt::MessagePoster< Poster, Tail...>

MessagePoster class.

This interface exposes a post() function for each Poster listed in the variadic template argument list. Each element of the list must derive from nrt::MessagePoster<Msg, Ret, Description> with various types for Msg, Ret and Description. Modules that wish to post() Message objects to the Blackboard must virtually derive from MessagePoster as this is the only way to obtain post() access to the Blackboard. Canonical use example is:

NRT_DECLARE_MESSAGEPOSTER_PORT(OutputA, MessageA, void, "MessageA Output"); // Our Poster is named OutputA
class MyModule : public nrt::Module, public nrt::MessagePoster<OutputA, MyOtherPoster, ...>
{
public:
void myMemberFunction() {
std::unique_ptr<MyMessageA> message(new MyMessageA());
nrt::MessagePosterResults<OutputA> result = OutputA::post(message);
// may wait on the result, check return values, catch exceptions, etc see class MessagePosterResults
}
}

Definition at line 83 of file Module.H.

Inheritance diagram for nrt::MessagePoster< Poster, Tail...>:
nrt::MessagePoster< Tail...>

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