X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fmessaging%2Fcallback.cpp;h=6f1ed62b80b73c4b4bb6ce2325a8dbb7c59743f9;hb=c85ac8bccf13f6aba024fef47453f3e1b6c3c615;hp=d7eacc6ae679e65eea98e7219fe9d507081a160f;hpb=8cb3c6f5d5062b83f17a5739e0671490beb543de;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/messaging/callback.cpp b/src/messaging/callback.cpp index d7eacc6..6f1ed62 100644 --- a/src/messaging/callback.cpp +++ b/src/messaging/callback.cpp @@ -30,33 +30,31 @@ #include #include "message.hpp" -//class Messenger; +namespace xapp { /* Builder. */ -Callback::Callback( user_callback ufun, void* data ) { // builder - user_fun = ufun; - udata = data; -} +Callback::Callback( user_callback ufun, void* data ) : // builder + user_fun( ufun ), + udata( data ) +{ /* empty body */ } /* - Wrecking ball. + there is nothing to be done from a destruction perspective, so no + destruction function needed at the moment. */ -Callback::~Callback() { - // nothing to do at the moment. -} /* Drive_cb will invoke the callback and pass along the stuff passed here. */ -void Callback::Drive_cb( Messenger& mr, Message& m ) { - if( user_fun == NULL ) { - return; +void xapp::Callback::Drive_cb( Message& m ) { + if( user_fun != NULL ) { + user_fun( m, m.Get_mtype(), m.Get_subid(), m.Get_len(), m.Get_payload(), udata ); } - - user_fun( mr, m, m.Get_mtype(), m.Get_subid(), m.Get_len(), m.Get_payload(), udata ); } + +} // namespace