bmv2
Designing your own switch target with bmv2
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
bm::LookupStructureFactory Class Reference

Public Member Functions

virtual std::unique_ptr< ExactLookupStructurecreate_for_exact (size_t size, size_t nbytes_key)
 Create a lookup structure for exact matches. More...
 
virtual std::unique_ptr< LPMLookupStructurecreate_for_LPM (size_t size, size_t nbytes_key)
 Create a lookup structure for LPM matches. More...
 
virtual std::unique_ptr< TernaryLookupStructurecreate_for_ternary (size_t size, size_t nbytes_key)
 Create a lookup structure for ternary matches. More...
 
virtual std::unique_ptr< RangeLookupStructurecreate_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)
 

Detailed Description

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.

Member Function Documentation

◆ create()

template<typename K >
static std::unique_ptr<LookupStructure<K> > bm::LookupStructureFactory::create ( LookupStructureFactory f,
size_t  size,
size_t  nbytes_key 
)
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.

◆ create_for_exact()

virtual std::unique_ptr<ExactLookupStructure> bm::LookupStructureFactory::create_for_exact ( size_t  size,
size_t  nbytes_key 
)
virtual

Create a lookup structure for exact matches.

◆ create_for_LPM()

virtual std::unique_ptr<LPMLookupStructure> bm::LookupStructureFactory::create_for_LPM ( size_t  size,
size_t  nbytes_key 
)
virtual

Create a lookup structure for LPM matches.

◆ create_for_range()

virtual std::unique_ptr<RangeLookupStructure> bm::LookupStructureFactory::create_for_range ( size_t  size,
size_t  nbytes_key 
)
virtual

Create a lookup structure for range macthes.

◆ create_for_ternary()

virtual std::unique_ptr<TernaryLookupStructure> bm::LookupStructureFactory::create_for_ternary ( size_t  size,
size_t  nbytes_key 
)
virtual

Create a lookup structure for ternary matches.


The documentation for this class was generated from the following file: