bmv2
Designing your own switch target with bmv2
|
Public Member Functions | |
color_t | execute_meter (const Packet &pkt, size_t idx, color_t pre_color=0) |
Meter & | get_meter (size_t idx) |
Access the meter at position idx , asserts if bad idx . More... | |
const Meter & | get_meter (size_t idx) const |
Access the meter at position idx , asserts if bad idx . More... | |
Meter & | at (size_t idx) |
const Meter & | at (size_t idx) const |
Meter & | operator[] (size_t idx) |
Access the meter at position idx , asserts if bad idx . More... | |
const Meter & | operator[] (size_t idx) const |
Access the meter at position idx , asserts if bad idx . More... | |
iterator | begin () |
NC. More... | |
const_iterator | begin () const |
NC. More... | |
iterator | end () |
NC. More... | |
const_iterator | end () const |
NC. More... | |
size_t | size () const |
Returns the size of the MeterArray (i.e. number of meters it includes) More... | |
![]() | |
const std::string & | get_name () const |
Get the name of the P4 instance. More... | |
p4object_id_t | get_id () const |
Get the compiler-provided id. More... | |
NamedP4Object (const NamedP4Object &other)=delete | |
Deleted copy constructor. More... | |
NamedP4Object & | operator= (const NamedP4Object &other)=delete |
Deleted copy assignment operator. More... | |
NamedP4Object (NamedP4Object &&other)=default | |
Default move constructor. More... | |
NamedP4Object & | operator= (NamedP4Object &&other)=default |
Default assignment operator. More... | |
MeterArray corresponds to the meter
standard P4 v1.02 object. A MeterArray reference can be used as a P4 primitive parameter. For example:
|
inline |
Access the meter at position idx
, with bound-checking. If pos not within the range of the array, an exception of type std::out_of_range is thrown.
|
inline |
Access the meter at position idx
, with bound-checking. If pos not within the range of the array, an exception of type std::out_of_range is thrown.
|
inline |
NC.
|
inline |
NC.
|
inline |
NC.
|
inline |
NC.
color_t bm::MeterArray::execute_meter | ( | const Packet & | pkt, |
size_t | idx, | ||
color_t | pre_color = 0 |
||
) |
Executes the meter at index idx
on the given packet and returns the correct integral color value. See Meter::execute() for more information.
|
inline |
Access the meter at position idx
, asserts if bad idx
.
|
inline |
Access the meter at position idx
, asserts if bad idx
.
|
inline |
Access the meter at position idx
, asserts if bad idx
.
|
inline |
Access the meter at position idx
, asserts if bad idx
.
|
inline |
Returns the size of the MeterArray (i.e. number of meters it includes)