bmv2
Designing your own switch target with bmv2
Public Member Functions | List of all members
bm::LookupStructure< K > Class Template Referenceabstract

Public Member Functions

virtual bool lookup (const ByteContainer &key_data, internal_handle_t *handle) const =0
 
virtual bool entry_exists (const K &key) const =0
 
virtual bool retrieve_handle (const K &key, internal_handle_t *handle) const =0
 
virtual void add_entry (const K &key, internal_handle_t handle)=0
 
virtual void delete_entry (const K &key)=0
 
virtual void clear ()=0
 Completely remove all entries from the data structure. More...
 

Detailed Description

template<typename K>
class bm::LookupStructure< K >

This class defines an interface for all data structures used in Match Units to perform lookups. Custom data strucures can be created by implementing this interface, and creating a LookupStructureFactory subclass which will create them.

Member Function Documentation

◆ add_entry()

template<typename K >
virtual void bm::LookupStructure< K >::add_entry ( const K &  key,
internal_handle_t  handle 
)
pure virtual

Store an entry in the lookup structure. Associates the given handle with the given entry.

◆ clear()

template<typename K >
virtual void bm::LookupStructure< K >::clear ( )
pure virtual

Completely remove all entries from the data structure.

◆ delete_entry()

template<typename K >
virtual void bm::LookupStructure< K >::delete_entry ( const K &  key)
pure virtual

Remove a given entry from the structure. Has no effect if the entry does not exist.

◆ entry_exists()

template<typename K >
virtual bool bm::LookupStructure< K >::entry_exists ( const K &  key) const
pure virtual

Check whether an entry exists. This is distinct from a lookup operation in that this will also match against the prefix length in the case of an LPM structure, and against the mask and priority in the case of a Ternary structure.

◆ lookup()

template<typename K >
virtual bool bm::LookupStructure< K >::lookup ( const ByteContainer key_data,
internal_handle_t *  handle 
) const
pure virtual

Look up a given key in the data structure. Return true and set handle to the found value if there is a match Return false if there is no match (value in handle is undefined)

◆ retrieve_handle()

template<typename K >
virtual bool bm::LookupStructure< K >::retrieve_handle ( const K &  key,
internal_handle_t *  handle 
) const
pure virtual

Retrieve the handle of an entry. Returns true if and only if an entry exists. See entry_exists() for more information about the notion of entry existence.


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