p4lang / tdi

Table-Driven Interface (TDI) for a P4-programmable backend device.
Apache License 2.0
40 stars 23 forks source link

Refactoring dynamic APIs into target independent and dependent parts #91

Closed satish153 closed 2 years ago

satish153 commented 2 years ago

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.