A common use of functionvoidShare::initacrossmanager () {gsmgrevent gsmgrevents;//structure that holds functionGsmgrevents.fnsenddata2client = [ This](intNchannelid,void* PData,intNlen)//Lambda bindings, of course, can also be bound with Std::bind{sendcmd2c (Nchannelid, s2c_prop_opt, PData, Nlen); }; Gsmgrevents.fnsenddata2msbymapid= [ This](intNmapid,void* PData,intNlen) {Sendcmd2msbymapid (Nmapid, Gs2ms_prop_mgr, PData, Nlen); }; Gsmgrevents.fnsenddata2ms= [ This](intNchannelid,void* PData,intNlen) {Sendcmd2msbychannelid (Nchannelid, Gs2ms_prop_mgr, PData, Nlen); }; M_sppropmanager-Init (gsmgrevents);} By the time the Propmanager module can be called directly through the function in the m_cevents share functions, is a callback process, working very little contact with this, so every time it feels awkward I know the callback is two threads, When another thread completes a callback, the NGP is passed through the NGP context. I was just thinking that another module can be called through an interface or function, but sometimes it has to function, because functions can be bound to any one of the public, private, Regardless of the class, as long as a process can be, with the interface function does not matter, this is more flexible, and the module is more independent, but the function needs to be bound in advance
A common use of function