RIC-641 Fixing client/server model definitions and adding client and server API
[ric-plt/xapp-frame-cpp.git] / src / messaging / callback.cpp
index d4d697d..6f1ed62 100644 (file)
 #include <rmr/rmr.h>
 
 #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 */ }
 
 /*
        there is nothing to be done from a destruction perspective, so no
@@ -49,10 +49,12 @@ Callback::Callback( user_callback ufun, void* data ) {              // builder
 /*
        Drive_cb will invoke the callback and pass along the stuff passed here.
 */
-void Callback::Drive_cb( Message& m ) {
+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( m, m.Get_mtype(), m.Get_subid(), m.Get_len(), m.Get_payload(), udata );
        }
 }
 
 
+
+} // namespace