#include <headers.h>
Used to represent P4 header instances. It includes a vector of Field objects.
◆ begin() [1/2]
| iterator bm::Header::begin |
( |
| ) |
|
|
inline |
◆ begin() [2/2]
| const_iterator bm::Header::begin |
( |
| ) |
const |
|
inline |
◆ end() [1/2]
| iterator bm::Header::end |
( |
| ) |
|
|
inline |
◆ end() [2/2]
| const_iterator bm::Header::end |
( |
| ) |
const |
|
inline |
◆ get_field() [1/2]
| Field & bm::Header::get_field |
( |
int |
field_offset | ) |
|
|
inline |
Returns a reference to the Field at the specified offset, with bounds checking. If pos not within the range of the container, an exception of type std::out_of_range is thrown.
◆ get_field() [2/2]
| const Field & bm::Header::get_field |
( |
int |
field_offset | ) |
const |
|
inline |
Returns a reference to the Field at the specified offset, with bounds checking. If pos not within the range of the container, an exception of type std::out_of_range is thrown.
◆ get_field_full_name()
| const std::string bm::Header::get_field_full_name |
( |
int |
field_offset | ) |
const |
Returns the full name of the field at the given offset as a new string. The name is of the form <hdr_name>.<f_name>.
◆ get_field_name()
| const std::string & bm::Header::get_field_name |
( |
int |
field_offset | ) |
const |
Returns a reference to the name of the field at the given offset.
◆ get_header_type_id()
| header_type_id_t bm::Header::get_header_type_id |
( |
| ) |
const |
|
inline |
Returns an integral id which represents the header type of the header. This id can be used to compare whether 2 Header instances have the same header type.
◆ get_nbytes_packet()
| int bm::Header::get_nbytes_packet |
( |
| ) |
const |
|
inline |
Returns the number of byte occupied by this header when it is deserialized in the packet
◆ is_metadata()
| bool bm::Header::is_metadata |
( |
| ) |
const |
|
inline |
Returns true if this header represents metadata.
◆ is_valid()
| bool bm::Header::is_valid |
( |
| ) |
const |
|
inline |
Returns true if this header is marked valid.
◆ is_VL_header()
| bool bm::Header::is_VL_header |
( |
| ) |
const |
|
inline |
Returns true if this header is an instance of a Variable-Length header type, i.e. contains a field whose length is determined when the header is extracted from the packet data.
◆ mark_invalid()
| void bm::Header::mark_invalid |
( |
| ) |
|
Marks the header as not-valid.
◆ mark_valid()
| void bm::Header::mark_valid |
( |
| ) |
|
Marks the header as valid.
◆ operator[]() [1/2]
| reference bm::Header::operator[] |
( |
size_type |
n | ) |
|
|
inline |
Access the character at position n. Will assert if n is greater or equal than the number of fields in the header.
◆ operator[]() [2/2]
| const_reference bm::Header::operator[] |
( |
size_type |
n | ) |
const |
|
inline |
Access the character at position n. Will assert if n is greater or equal than the number of fields in the header.
◆ reset()
| void bm::Header::reset |
( |
| ) |
|
Sets all the fields in the header to value 0.
◆ set_written_to()
| void bm::Header::set_written_to |
( |
bool |
written_to_value | ) |
|
Set the written_to flag maintained by each field. This flag can be queried at any time by the target, using the Field interface, and can be used to check whether the field has been modified since written_to was last set to false.
◆ size()
| size_type bm::Header::size |
( |
| ) |
const |
|
inlinenoexcept |
Returns the number of fields in the header.
The documentation for this class was generated from the following file: