P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::AbstractRepCheckedNode< Self, Node > Class Template Reference

#include <formulae.h>

Inheritance diagram for P4::P4Tools::AbstractRepCheckedNode< Self, Node >:
[legend]

Protected Member Functions

 AbstractRepCheckedNode (const Node *node, std::string classDesc)
 
 DECLARE_TYPEINFO (AbstractRepCheckedNode)
 
 operator const Node * () const
 
const Node & operator* () const
 
const Node * operator-> () const
 
- Protected Member Functions inherited from P4::RTTI::Base
virtual const void * toImpl (TypeId typeId) const noexcept=0
 

Protected Attributes

std::reference_wrapper< const Node > node
 

Additional Inherited Members

- 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
 

Detailed Description

template<class Self, class Node = IR::Expression>
class P4::P4Tools::AbstractRepCheckedNode< Self, Node >

Provides common functionality for implementing a thin wrapper around a 'const Node*' to enforce invariants on which forms of IR nodes can inhabit implementations of this type. Implementations must provide a static repOk(const Node*) function.

Constructor & Destructor Documentation

◆ AbstractRepCheckedNode()

template<class Self , class Node = IR::Expression>
P4::P4Tools::AbstractRepCheckedNode< Self, Node >::AbstractRepCheckedNode ( const Node * node,
std::string classDesc )
inlineexplicitprotected
Parameters
classDesca user-friendly description of the class, for reporting errors to the user.