X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fconfig%2Fconfig_cb.cpp;fp=src%2Fconfig%2Fconfig_cb.cpp;h=9fd417b3234e4e6ab389c0215b901f26f35adf5f;hb=c85ac8bccf13f6aba024fef47453f3e1b6c3c615;hp=309ddba12ebbaa3305957da97cc708eba4ac9ed5;hpb=b0c88ede74392fc3d73270c3b9a545b7e641d9ab;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/config/config_cb.cpp b/src/config/config_cb.cpp index 309ddba..9fd417b 100644 --- a/src/config/config_cb.cpp +++ b/src/config/config_cb.cpp @@ -37,9 +37,9 @@ namespace xapp { /* Builder. */ -Config_cb::Config_cb( notify_callback ufun, void* udata ) : +Config_cb::Config_cb( notify_callback ufun, void* user_data ) : user_fun( ufun ), - udata( udata ) + udata( user_data ) { /* empty body */ } @@ -50,13 +50,14 @@ Config_cb::Config_cb( notify_callback ufun, void* udata ) : /* Drive_cb will invoke the callback and pass along the stuff passed here. + User_data may be nil which causes the data registered with the callback + to be used. */ -void xapp::Config_cb::Drive_cb( xapp::Config& c, void* udata ) { +void xapp::Config_cb::Drive_cb( xapp::Config& c, void* user_data ) const { if( user_fun != NULL ) { - user_fun( c, udata ); + user_fun( c, user_data == NULL ? udata : user_data ); } } - } // namespace