bmv2
Designing your own switch target with bmv2
|
Public Member Functions | |
virtual std::unique_ptr< ExactLookupStructure > | create_for_exact (size_t size, size_t nbytes_key) |
Create a lookup structure for exact matches. More... | |
virtual std::unique_ptr< LPMLookupStructure > | create_for_LPM (size_t size, size_t nbytes_key) |
Create a lookup structure for LPM matches. More... | |
virtual std::unique_ptr< TernaryLookupStructure > | create_for_ternary (size_t size, size_t nbytes_key) |
Create a lookup structure for ternary matches. More... | |
virtual std::unique_ptr< RangeLookupStructure > | create_for_range (size_t size, size_t nbytes_key) |
Create a lookup structure for range macthes. More... | |
Static Public Member Functions | |
template<typename K > | |
static std::unique_ptr< LookupStructure< K > > | create (LookupStructureFactory *f, size_t size, size_t nbytes_key) |
This class is used by match units to create instances of the appropriate LookupStructure implementation. In order to use custom data structures in a target, the data structures should be defined, and then a new subclass of LookupStructureFactory should be created, overriding the create_for_<match type>
function or functions corresponding to the new data structure.
|
static |
This is a utility to call the correct create_for_<type>
function based on the bm::MatchKey subtype passed as the template parameter K. This is used by bm::MatchUnitGeneric when creating its lookup structure.
|
virtual |
Create a lookup structure for exact matches.
|
virtual |
Create a lookup structure for LPM matches.
|
virtual |
Create a lookup structure for range macthes.
|
virtual |
Create a lookup structure for ternary matches.