P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::P4Testgen::Continuation::Body Class Reference

A continuation body is a list of commands. More...

#include <continuation.h>

Public Member Functions

 Body (const std::vector< Command > &cmds)
 
 Body (std::initializer_list< Command > cmds)
 Allows the command stack to be initialized with a list initializer.
 
void clear ()
 Removes all commands in this body.
 
bool empty () const
 Determines whether this body is empty.
 
const Command next () const
 
bool operator== (const Body &) const
 
void pop ()
 
void push (Command cmd)
 Pushes the given command onto the command stack.
 

Friends

class Continuation
 
class Test::SmallStepTest
 

Detailed Description

A continuation body is a list of commands.

Constructor & Destructor Documentation

◆ Body()

P4::P4Tools::P4Testgen::Continuation::Body::Body ( const std::vector< Command > & cmds)
explicit

Allow deque initialization with a vector. We iterate and push through the vector in reverse.

Member Function Documentation

◆ next()

const Continuation::Command P4::P4Tools::P4Testgen::Continuation::Body::next ( ) const

Returns the next command to be executed. This is the top of the command stack. A BUG occurs if this body is @empty.

◆ pop()

void P4::P4Tools::P4Testgen::Continuation::Body::pop ( )

Pops the next element off the command stack. A BUG occurs if the command stack is empty.