c++ - How can I check a function was called by another function? -


i trying make sure member function of 1 class only called member function of class.

the architecture imposed , cannot changed, port means logic has done in a.call() before calling b.call(). a.call() therefore calls b.call() simplify things , make sure order respected.

i found this answer question. only, problem using classes, , 2 classes have same member function name , #define tries replace occurrences have different prototypes.

off top of head, options be:

  • make b.call private , make b add a or a.call friend
  • turn b.call class , put body a private constructor a or a.call friend
  • grep source code b.call, make sure call in a.call, , add comment @ declaration saying "if call function fired"
  • change b.call take @ least 1 of values needs parameter (even if ignores , uses value somewhere else)

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -