P4C
The P4 Compiler
Loading...
Searching...
No Matches
PHV::Container Class Reference

Public Member Functions

 Container ()
 

- e.g., "B0" for container B0.

Construct a container from

 Container (const char *name, bool abort_if_invalid=true)
 
 Container (PHV::Type t, unsigned index)
 
size_t size () const
 
unsigned log2sz () const
 
size_t msb () const
 
size_t lsb () const
 
PHV::Type type () const
 
unsigned index () const
 
bool is (PHV::Kind k) const
 
bool is (PHV::Size sz) const
 
 operator bool () const
 
Container operator++ ()
 
Container operator++ (int)
 
bool operator== (Container c) const
 
bool operator!= (Container c) const
 
bool operator< (Container c) const
 
void toJSON (P4::JSONGenerator &json) const
 JSON serialization/deserialization.
 
cstring toString () const
 
size_t hash_value (const Container &c)
 
static Container fromJSON (P4::JSONLoader &json)
 

Constructor & Destructor Documentation

◆ Container() [1/2]

PHV::Container::Container ( )
inline

Construct an empty container. Most operations aren't defined on empty containers. (Use operator bool() to check if a container is empty.)

◆ Container() [2/2]

PHV::Container::Container ( PHV::Type t,
unsigned index )
inline

Construct a container from kind and index - e.g., (Kind::B, 0) for container B0.

Member Function Documentation

◆ operator bool()

PHV::Container::operator bool ( ) const
inlineexplicit
Returns
true if this container is nonempty (i.e., refers to an actual PHV container).

◆ toString()

cstring PHV::Container::toString ( ) const
Returns
a string representation of this container.