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

#include <utils.h>

Public Types

using const_iterator = std::vector<PHV::Container>::const_iterator
 

Public Member Functions

 ContainerGroup (PHV::Size size, bitvec container_group)
 
 ContainerGroup (PHV::Size size, const std::vector< PHV::Container > containers)
 
const_iterator begin () const
 
bool contains (PHV::Container c) const
 
bool empty () const
 
const_iterator end () const
 
const ordered_set< PHV::ContainergetAllContainersOfKind (PHV::Kind kind) const
 
bool hasType (PHV::Type t) const
 
bitvec ids () const
 
bool is (PHV::Kind k) const
 
bool is (PHV::Size s) const
 
size_t size () const
 
const std::set< PHV::Typetypes () const
 
PHV::Size width () const
 

Detailed Description

A set of PHV containers of the same size.

Constructor & Destructor Documentation

◆ ContainerGroup() [1/2]

PHV::ContainerGroup::ContainerGroup ( PHV::Size size,
const std::vector< PHV::Container > containers )

Creates a container group from a vector of containers. Fails catastrophically if containers has containers not of size size.

◆ ContainerGroup() [2/2]

PHV::ContainerGroup::ContainerGroup ( PHV::Size size,
bitvec container_group )

Creates a container group from a bitvec of container IDs. Fails catastrophically if container_group has containers not of size size.

Member Function Documentation

◆ contains()

bool PHV::ContainerGroup::contains ( PHV::Container c) const
inline
Returns
true if is in this group.

◆ empty()

bool PHV::ContainerGroup::empty ( ) const
inline
Returns
true if there are no containers in this group.

◆ getAllContainersOfKind()

const ordered_set< PHV::Container > PHV::ContainerGroup::getAllContainersOfKind ( PHV::Kind kind) const
inline
Returns
all the dark containers in this MAU group.

◆ hasType()

bool PHV::ContainerGroup::hasType ( PHV::Type t) const
inline
Returns
true if the type t is present in this group.

◆ ids()

bitvec PHV::ContainerGroup::ids ( ) const
inline
Returns
the ids of containers in this group.

◆ is() [1/2]

bool PHV::ContainerGroup::is ( PHV::Kind k) const
inline
Returns
true if the ContainerGroup has kind k.

◆ is() [2/2]

bool PHV::ContainerGroup::is ( PHV::Size s) const
inline
Returns
true if the ContainerGroup is of size s.

◆ size()

size_t PHV::ContainerGroup::size ( ) const
inline
Returns
the number of containers in this group.

◆ types()

const std::set< PHV::Type > PHV::ContainerGroup::types ( ) const
inline
Returns
the types of PHVs in this group.

◆ width()

PHV::Size PHV::ContainerGroup::width ( ) const
inline
Returns
the PHV::Size of this group.