c++ - Converting member function pointer to string -


i have class consists of function. need call function periodically. 1 timer callback api there of form mentioned below:

timer(&obj,&class::func,time)  

so if attach member function api, called periodically.

there wrapper api accepts arguments string. need pass every argument string , necessary parsing , call actual api.

so want first convert object address , member function address string , use in project. can me giving sample code this.

you cannot convert member function string , use @ all.

there few way convert type or expression string, typeid, works in way, not in opposite.

there no native way in c++ convert string member function address. however, can make associative container (like std::map) associating strings member function pointers, , use wrapping , unwrapping.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -