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 , makeb
adda
ora.call
friend
- turn
b.call
class , put body a private constructora
ora.call
friend
- grep source code
b.call
, make sure call ina.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
Post a Comment