bmv2
Designing your own switch target with bmv2
|
Go to the documentation of this file.
105 #ifndef BM_BM_SIM_LOOKUP_STRUCTURES_H_
106 #define BM_BM_SIM_LOOKUP_STRUCTURES_H_
110 #include "match_key_types.h"
119 template <
typename K>
128 internal_handle_t *handle)
const = 0;
140 internal_handle_t *handle)
const = 0;
144 virtual void add_entry(
const K &key, internal_handle_t handle) = 0;
151 virtual void clear() = 0;
176 template <
typename K>
177 static std::unique_ptr<LookupStructure<K> >
create(
181 virtual std::unique_ptr<ExactLookupStructure>
185 virtual std::unique_ptr<LPMLookupStructure>
189 virtual std::unique_ptr<TernaryLookupStructure>
193 virtual std::unique_ptr<RangeLookupStructure>
197 bool enable_ternary_cache;
204 #endif // BM_BM_SIM_LOOKUP_STRUCTURES_H_
Definition: lookup_structures.h:120
virtual void delete_entry(const K &key)=0
virtual bool retrieve_handle(const K &key, internal_handle_t *handle) const =0
Definition: bytecontainer.h:39
virtual std::unique_ptr< TernaryLookupStructure > create_for_ternary(size_t size, size_t nbytes_key)
Create a lookup structure for ternary matches.
virtual std::unique_ptr< RangeLookupStructure > create_for_range(size_t size, size_t nbytes_key)
Create a lookup structure for range macthes.
virtual bool entry_exists(const K &key) const =0
Definition: lookup_structures.h:167
virtual void add_entry(const K &key, internal_handle_t handle)=0
virtual std::unique_ptr< ExactLookupStructure > create_for_exact(size_t size, size_t nbytes_key)
Create a lookup structure for exact matches.
virtual bool lookup(const ByteContainer &key_data, internal_handle_t *handle) const =0
virtual void clear()=0
Completely remove all entries from the data structure.
static std::unique_ptr< LookupStructure< K > > create(LookupStructureFactory *f, size_t size, size_t nbytes_key)
virtual std::unique_ptr< LPMLookupStructure > create_for_LPM(size_t size, size_t nbytes_key)
Create a lookup structure for LPM matches.