P4C
The P4 Compiler
Loading...
Searching...
No Matches
PHV::v2::SrcPackVec Struct Reference

#include <copacker.h>

Public Member Functions

bool empty () const
 
size_t size () const
 

Public Attributes

std::optional< PHV::Containercontainer = std::nullopt
 pack to this container.
 
FieldSliceAllocStartMap fs_starts = {}
 field slices and their starting indexes.
 

Detailed Description

SrcPackVec represents a way of how to pack and allocate a set of source field slices to a source container.

Member Function Documentation

◆ empty()

bool PHV::v2::SrcPackVec::empty ( ) const
inline

true if it is okay to left shift (increase starting index) for fields in fs_starts. disabled because we have not found a good algorithm to generate shiftable candidates.

Returns
true the hint is empty.

◆ size()

size_t PHV::v2::SrcPackVec::size ( ) const
inline
Returns
the number of field slices that needs to be packed in this hint.