P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::IR::IndexedVector< T > Class Template Reference

#include <indexed_vector.h>

Inheritance diagram for P4::IR::IndexedVector< T >:
[legend]

Public Types

typedef Vector< T >::iterator iterator
 
- Public Types inherited from P4::IR::Vector< T >
typedef safe_vector< constT * >::const_iterator const_iterator
 
typedef safe_vector< constT * >::iterator iterator
 
typedef const T * value_type
 
- Public Types inherited from P4::IR::VectorBase
typedef const Node *const * iterator
 

Public Member Functions

 IndexedVector (const IndexedVector &)=default
 
 IndexedVector (const safe_vector< const T * > &a)
 
 IndexedVector (const T *a)
 
 IndexedVector (const Vector< T > &a)
 
 IndexedVector (IndexedVector &&)=default
 
 IndexedVector (JSONLoader &json)
 
 IndexedVector (std::initializer_list< const T * > a)
 
template<typename Container >
iterator append (const Container &toAppend)
 
void clear ()
 
 DECLARE_TYPEINFO_WITH_DISCRIMINATOR (IndexedVector< T >, NodeDiscriminator::IndexedVectorT, T, Vector< T >)
 
template<class... Args>
void emplace_back (Args &&...args)
 
iterator erase (iterator i)
 
const IDeclarationgetDeclaration (cstring name) const
 
template<class U >
const U * getDeclaration (cstring name) const
 
const IDeclarationgetDeclaration (std::string_view name) const
 
template<class U >
const U * getDeclaration (std::string_view name) const
 
Util::Enumerator< const IDeclaration * > * getDeclarations () const
 
iterator insert (iterator i, const T *v)
 
template<typename ForwardIter >
iterator insert (iterator i, ForwardIter b, ForwardIter e)
 
cstring node_type_name () const override
 
IndexedVectoroperator= (const IndexedVector &)=default
 
IndexedVectoroperator= (IndexedVector &&)=default
 
bool operator== (const IndexedVector &a) const override
 
bool operator== (const Node &a) const override
 
bool operator== (const Vector< T > &a) const override
 
void pop_back ()
 
template<typename Container >
iterator prepend (const Container &toAppend)
 
void push_back (const T *a)
 
void push_back (T *a)
 
template<class U >
void push_back (U &a)
 
bool removeByName (cstring name)
 
iterator replace (iterator i, const T *v)
 
void toJSON (JSONGenerator &json) const override
 
void validate () const override
 
void visit_children (Visitor &v) const override
 
void visit_children (Visitor &v) override
 
- Public Member Functions inherited from P4::IR::Vector< T >
 Vector (const safe_vector< const T * > &a)
 
 Vector (const T *a)
 
 Vector (const Vector &)=default
 
template<class InputIt >
 Vector (InputIt first, InputIt last)
 
 Vector (JSONLoader &json)
 
 Vector (std::initializer_list< const T * > a)
 
 Vector (Util::Enumerator< const T * > *e)
 
 Vector (Vector &&)=default
 
template<typename Container >
iterator append (const Container &toAppend)
 
const T *& at (size_t idx)
 
const T *const & at (size_t idx) const
 
const T *& back ()
 
const T *const & back () const
 
iterator begin ()
 
const_iterator begin () const
 
void check_null () const
 
void clear ()
 
void dbprint (std::ostream &out) const override
 
 DECLARE_TYPEINFO_WITH_DISCRIMINATOR (Vector< T >, NodeDiscriminator::VectorT, T, VectorBase)
 
template<class... Args>
void emplace_back (Args &&...args)
 
bool empty () const override
 
iterator end ()
 
const_iterator end () const
 
bool equiv (const Node &a_) const override
 
iterator erase (iterator i)
 
iterator erase (iterator s, iterator e)
 
const T *& front ()
 
const T *const & front () const
 
Util::Enumerator< const T * > * getEnumerator () const
 
iterator insert (iterator i, const T *v)
 
template<typename ForwardIter >
iterator insert (iterator i, ForwardIter b, ForwardIter e)
 
iterator insert (iterator i, size_t n, const T *v)
 
cstring node_type_name () const override
 
template<typename S >
Util::Enumerator< const S * > * only () const
 
Vectoroperator= (const Vector &)=default
 
Vectoroperator= (Vector &&)=default
 
bool operator== (const Node &a) const override
 
bool operator== (const Vector &a) const override
 
const T *& operator[] (size_t idx)
 
const T *const & operator[] (size_t idx) const
 
virtual void parallel_visit_children (Visitor &v)
 
virtual void parallel_visit_children (Visitor &v) const
 
void pop_back ()
 
template<typename Container >
iterator prepend (const Container &toAppend)
 
void push_back (const T *a)
 
void push_back (T *a)
 
template<class U >
void push_back (U &a)
 
void pushBackOrAppend (const IR::Node *item)
 
std::reverse_iterator< iterator > rbegin ()
 
std::reverse_iterator< const_iterator > rbegin () const
 
std::reverse_iterator< iterator > rend ()
 
std::reverse_iterator< const_iterator > rend () const
 
void resize (size_t sz)
 
size_t size () const override
 
void toJSON (JSONGenerator &json) const override
 
VectorBase::iterator VectorBase_begin () const override
 
VectorBase::iterator VectorBase_end () const override
 
void visit_children (Visitor &v) const override
 
void visit_children (Visitor &v) override
 
template<class Filter >
auto where (Filter f) const
 
- Public Member Functions inherited from P4::IR::VectorBase
 VectorBase (const VectorBase &)=default
 
 VectorBase (VectorBase &&)=default
 
iterator begin () const
 
iterator end () const
 
VectorBaseoperator= (const VectorBase &)=default
 
VectorBaseoperator= (VectorBase &&)=default
 
- Public Member Functions inherited from P4::IR::Node
 Node (const Node &other)
 
 Node (JSONLoader &json)
 
 Node (Util::SourceInfo si)
 
const Nodeapply (Visitor &&v, const Visitor_Context *ctxt=nullptr) const
 
const Nodeapply (Visitor &v, const Visitor_Context *ctxt=nullptr) const
 
virtual void apply_visitor_loop_revisit (Inspector &v) const
 
virtual void apply_visitor_loop_revisit (Modifier &v) const
 
virtual void apply_visitor_loop_revisit (Transform &v) const
 
virtual void apply_visitor_postorder (Inspector &v) const
 
virtual void apply_visitor_postorder (Modifier &v)
 
virtual const Nodeapply_visitor_postorder (Transform &v)
 
virtual bool apply_visitor_preorder (Inspector &v) const
 
virtual bool apply_visitor_preorder (Modifier &v)
 
virtual const Nodeapply_visitor_preorder (Transform &v)
 
virtual void apply_visitor_revisit (Inspector &v) const
 
virtual void apply_visitor_revisit (Modifier &v, const Node *n) const
 
virtual void apply_visitor_revisit (Transform &v, const Node *n) const
 
virtual Nodeclone () const =0
 
 DECLARE_TYPEINFO_WITH_TYPEID (Node, NodeKind::Node, INode)
 
virtual void dump_fields (std::ostream &) const
 
const NodegetNode () const final
 
NodegetNode () final
 
Util::SourceInfo getSourceInfo () const override
 
virtual int num_children ()
 
bool operator!= (const Node &n) const
 
Nodeoperator= (const Node &)=default
 
Nodeoperator= (Node &&)=default
 
Util::JsonObjectsourceInfoJsonObj () const
 
void sourceInfoToJSON (JSONGenerator &json) const
 
cstring toString () const override
 
void traceCreation () const
 
- Public Member Functions inherited from P4::IR::INode
template<typename T >
std::enable_if_t<!has_static_type_name_v< T >, const T * > checkedTo () const
 
template<typename T >
std::enable_if_t< has_static_type_name_v< T >, const T * > checkedTo () const
 
 DECLARE_TYPEINFO_WITH_TYPEID (INode, NodeKind::INode)
 
- Public Member Functions inherited from P4::Util::IHasSourceInfo
- Public Member Functions inherited from P4::IHasDbPrint
void print () const
 
- 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
 

Static Public Member Functions

static IndexedVector< T > * fromJSON (JSONLoader &json)
 
static cstring static_type_name ()
 
- Static Public Member Functions inherited from P4::IR::Vector< T >
static Vector< T > * fromJSON (JSONLoader &json)
 
static cstring static_type_name ()
 
- Static Public Member Functions inherited from P4::IR::Node
static cstring static_type_name ()
 

Additional Inherited Members

- Public Attributes inherited from P4::IR::Node
int clone_id
 
int id
 
Util::SourceInfo srcInfo
 
- Protected Member Functions inherited from P4::IR::VectorBase
 VectorBase (JSONLoader &json)
 
 DECLARE_TYPEINFO_WITH_TYPEID (VectorBase, NodeKind::VectorBase, Node)
 
- Protected Member Functions inherited from P4::IR::Node
cstring prepareSourceInfoForJSON (Util::SourceInfo &si, unsigned *lineNumber, unsigned *columnNumber) const
 
void traceVisit (const char *visitor) const
 
- Protected Member Functions inherited from P4::RTTI::Base
virtual const void * toImpl (TypeId typeId) const noexcept=0
 
- Static Protected Attributes inherited from P4::IR::Node
static int currentId = 0
 

Detailed Description

template<class T>
class P4::IR::IndexedVector< T >

A Vector which holds objects which are instances of IDeclaration, and keeps an index so that they can be quickly looked up by name.

Member Function Documentation

◆ node_type_name()

template<class T >
cstring P4::IR::IndexedVector< T >::node_type_name ( ) const
inlineoverridevirtual

Implements P4::IR::INode.

◆ operator==()

template<class T >
bool P4::IR::IndexedVector< T >::operator== ( const Node & a) const
inlineoverridevirtual

Reimplemented from P4::IR::Node.

◆ toJSON()

template<class T >
void P4::IR::IndexedVector< T >::toJSON ( JSONGenerator & json) const
overridevirtual

Implements P4::IR::INode.

◆ validate()

template<class T >
void P4::IR::IndexedVector< T >::validate ( ) const
inlineoverridevirtual

Reimplemented from P4::IR::INode.

◆ visit_children() [1/2]

template<class T >
void P4::IR::IndexedVector< T >::visit_children ( Visitor & v) const
overridevirtual

Reimplemented from P4::IR::Node.

◆ visit_children() [2/2]

template<class T >
void P4::IR::IndexedVector< T >::visit_children ( Visitor & v)
overridevirtual

Reimplemented from P4::IR::Node.