10 #ifndef mm_radio_SUBSCRIBER_HPP_ 11 #define mm_radio_SUBSCRIBER_HPP_ 33 template<
unsigned int ID,
typename DataType>
47 void (*f)(DataType)) :
54 ss <<
"id '" <<
id <<
"' has not been registered";
57 if ( !MessageRegistry::isRegisteredWithType<DataType>(ID) ) {
59 ss <<
"id '" <<
id <<
"' is registered, but not with this type";
75 void (C::*f)(DataType), C &c) :
78 function(new
ecl::PartiallyBoundUnaryMemberFunction<C, DataType,void>(f,c))
87 void processPacket(
const unsigned char* buffer,
const unsigned int& size) {
Subscriber(const std::string &name, void(*f)(DataType))
mm_messages::MessageRegistry MessageRegistry
ecl::UnaryFunction< DataType, void > * function
static void unregisterSubscriber(const std::string &name, const unsigned int &id)
Subscriber(const std::string &name, void(C::*f)(DataType), C &c)
static bool isRegistered(const int &id)
mm_messages::ByteArray ByteArray
static void registerSubscriber(const std::string &name, const unsigned int &id, void(C::*processPacket)(const unsigned char *, const unsigned int &), C &s)
Register a callback with the specified demux.
std::vector< unsigned char > ByteArray
void processPacket(const unsigned char *buffer, const unsigned int &size)
void f(int i) ecl_debug_throw_decl(StandardException)
static T decode(const unsigned char *buffer, const unsigned int &size)