P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::P4Testgen::TableRule Class Reference
Inheritance diagram for P4::P4Tools::P4Testgen::TableRule:
[legend]

Public Member Functions

 TableRule (TableMatchMap matches, int priority, ActionCall action, int ttl)
 
 DECLARE_TYPEINFO (TableRule, TestObject)
 
const TableRuleevaluate (const Model &model, bool doComplete) const override
 
const ActionCallgetActionCall () const
 
const TableMatchMap * getMatches () const
 
cstring getObjectName () const override
 
int getPriority () const
 
int getTTL () const
 
- Public Member Functions inherited from P4::P4Tools::P4Testgen::TestObject
 TestObject (const TestObject &)=default
 
 TestObject (TestObject &&)=default
 
 DECLARE_TYPEINFO (TestObject)
 
TestObjectoperator= (const TestObject &)=default
 
TestObjectoperator= (TestObject &&)=default
 
- Public Member Functions inherited from P4::ICastable
template<typename T >
T & as ()
 Tries to convert the class to type T. A BUG occurs if the cast fails.
 
template<typename T >
const T & as () const
 Tries to convert the class to type T. A BUG occurs if the cast fails.
 
template<typename T >
T * checkedTo ()
 Performs a checked cast. A BUG occurs if the cast fails.
 
template<typename T >
const T * checkedTo () const
 Performs a checked cast. A BUG occurs if the cast fails.
 
- Public Member Functions inherited from P4::RTTI::Base
template<typename T >
bool is () const noexcept
 
virtual bool isA (TypeId typeId) const noexcept=0
 
template<typename T >
const T * to () const noexcept
 Same as to, but returns const pointer to T.
 
template<typename T >
T * to () noexcept
 
virtual TypeId typeId () const noexcept=0
 

Additional Inherited Members

- Protected Member Functions inherited from P4::RTTI::Base
virtual const void * toImpl (TypeId typeId) const noexcept=0
 

Member Function Documentation

◆ evaluate()

const TableRule * P4::P4Tools::P4Testgen::TableRule::evaluate ( const Model & model,
bool doComplete ) const
nodiscardoverridevirtual
Returns
a version of the test object where all expressions are resolved and symbolic variables are substituted according to the mapping present in the
Parameters
model.

Implements P4::P4Tools::P4Testgen::TestObject.

◆ getActionCall()

const ActionCall * P4::P4Tools::P4Testgen::TableRule::getActionCall ( ) const
nodiscard
Returns
action that is called when the key matches.

◆ getMatches()

const TableMatchMap * P4::P4Tools::P4Testgen::TableRule::getMatches ( ) const
nodiscard
Returns
the list of keys that need to match to execute the action.

◆ getObjectName()

cstring P4::P4Tools::P4Testgen::TableRule::getObjectName ( ) const
nodiscardoverridevirtual
Returns
the string name of this particular test object.

Implements P4::P4Tools::P4Testgen::TestObject.

◆ getPriority()

int P4::P4Tools::P4Testgen::TableRule::getPriority ( ) const
nodiscard
Returns
the priority of this entry.

◆ getTTL()

int P4::P4Tools::P4Testgen::TableRule::getTTL ( ) const
nodiscard
Returns
the time-to-live of this particular entry.