Approach used to bifurcate dynamic APIs into target independent and dependents parts:
Target derives TDILeaf and overrides dynamic API generation functions(eg: _create_add_with_action). In these functions, code_str is set with the code that is to be used to generate APIs. The target then calls the corresponding parent class function, which creates and adds the dynamic function.
Same changes as in https://github.com/p4lang/tdi/pull/91 Creating new PR as the old one was reverted.
Approach used to bifurcate dynamic APIs into target independent and dependents parts:
Target derives TDILeaf and overrides dynamic API generation functions(eg: _create_add_with_action). In these functions, code_str is set with the code that is to be used to generate APIs. The target then calls the corresponding parent class function, which creates and adds the dynamic function.