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

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -