#include <meters.h>
MeterArray corresponds to the meter standard P4 v1.02 object. A MeterArray reference can be used as a P4 primitive parameter. For example:
dst.set(meter_array.
execute_meter(get_packet(), idx.get_uint()));
}
};
color_t execute_meter(const Packet &pkt, size_t idx, color_t pre_color=0)
◆ at() [1/2]
| Meter & bm::MeterArray::at |
( |
size_t |
idx | ) |
|
|
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.
◆ at() [2/2]
| const Meter & bm::MeterArray::at |
( |
size_t |
idx | ) |
const |
|
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.
◆ begin() [1/2]
| iterator bm::MeterArray::begin |
( |
| ) |
|
|
inline |
◆ begin() [2/2]
| const_iterator bm::MeterArray::begin |
( |
| ) |
const |
|
inline |
◆ end() [1/2]
| iterator bm::MeterArray::end |
( |
| ) |
|
|
inline |
◆ end() [2/2]
| const_iterator bm::MeterArray::end |
( |
| ) |
const |
|
inline |
◆ execute_meter()
| 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.
◆ get_meter() [1/2]
| Meter & bm::MeterArray::get_meter |
( |
size_t |
idx | ) |
|
|
inline |
Access the meter at position idx, asserts if bad idx.
◆ get_meter() [2/2]
| const Meter & bm::MeterArray::get_meter |
( |
size_t |
idx | ) |
const |
|
inline |
Access the meter at position idx, asserts if bad idx.
◆ operator[]() [1/2]
| Meter & bm::MeterArray::operator[] |
( |
size_t |
idx | ) |
|
|
inline |
Access the meter at position idx, asserts if bad idx.
◆ operator[]() [2/2]
| const Meter & bm::MeterArray::operator[] |
( |
size_t |
idx | ) |
const |
|
inline |
Access the meter at position idx, asserts if bad idx.
◆ size()
| size_t bm::MeterArray::size |
( |
| ) |
const |
|
inline |
Returns the size of the MeterArray (i.e. number of meters it includes)
The documentation for this class was generated from the following file: