P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::IR::NameMap< T, MAP, COMP, ALLOC > Class Template Reference
Inheritance diagram for P4::IR::NameMap< T, MAP, COMP, ALLOC >:
[legend]

Public Types

typedef map_t::const_iterator const_iterator
 
typedef map_t::const_reverse_iterator const_reverse_iterator
 
typedef map_t::iterator iterator
 
typedef map_t::reverse_iterator reverse_iterator
 
typedef map_t::value_type value_type
 

Public Member Functions

 NameMap (const NameMap &)=default
 
 NameMap (JSONLoader &)
 
 NameMap (NameMap &&)=default
 
void add (cstring name, const T *n)
 
void addUnique (cstring name, const T *n)
 
const T *& at (cstring name)
 
const T *const & at (cstring name) const
 
iterator begin ()
 
const_iterator begin () const
 
void check_null () const
 
void clear ()
 
size_t count (cstring name) const
 
 DECLARE_TYPEINFO (NameMap, Node)
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
std::pair< const_iterator, const_iterator > equal_range (cstring key) const
 
bool equiv (const Node &a_) const override
 
size_t erase (cstring n)
 
iterator erase (iterator f, iterator l)
 
iterator erase (iterator p)
 
const_iterator find (cstring name) const
 
template<class U >
const U * get (cstring name) const
 
const T * getUnique (cstring name) const
 
cstring node_type_name () const override
 
template<typename S >
Util::Enumerator< const S * > * only () const
 
NameMapoperator= (const NameMap &)=default
 
NameMapoperator= (NameMap &&)=default
 
bool operator== (const NameMap &a) const
 
bool operator== (const Node &a) const override
 
elem_ref operator[] (cstring name)
 
const T * operator[] (cstring name) const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
size_t size () const
 
void toJSON (JSONGenerator &json) const override
 
Util::Enumerator< const T * > * valueEnumerator () const
 
void visit_children (Visitor &v) const override
 
void visit_children (Visitor &v) override
 
- 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
 
void dbprint (std::ostream &out) const override
 
 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
 
cstring node_type_name () 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
 
void toJSON (JSONGenerator &json) const override
 
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)
 
virtual void validate () const
 
- 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 NameMap< T, MAP, COMP, ALLOC > * 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::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
 

Member Function Documentation

◆ equiv()

template<class T , template< class K, class V, class COMP, class ALLOC > class MAP = std::map, class COMP = std::less<cstring>, class ALLOC = std::allocator<std::pair<const cstring, const T *>>>
bool P4::IR::NameMap< T, MAP, COMP, ALLOC >::equiv ( const Node & a_) const
inlineoverridevirtual

Reimplemented from P4::IR::Node.

◆ node_type_name()

template<class T , template< class K, class V, class COMP, class ALLOC > class MAP = std::map, class COMP = std::less<cstring>, class ALLOC = std::allocator<std::pair<const cstring, const T *>>>
cstring P4::IR::NameMap< T, MAP, COMP, ALLOC >::node_type_name ( ) const
inlineoverridevirtual

Implements P4::IR::INode.

◆ operator==()

template<class T , template< class K, class V, class COMP, class ALLOC > class MAP = std::map, class COMP = std::less<cstring>, class ALLOC = std::allocator<std::pair<const cstring, const T *>>>
bool P4::IR::NameMap< T, MAP, COMP, ALLOC >::operator== ( const Node & a) const
inlineoverridevirtual

Reimplemented from P4::IR::Node.

◆ toJSON()

template<class T , template< class K, class V, class COMP, class ALLOC > class MAP, class COMP , class ALLOC >
void P4::IR::NameMap< T, MAP, COMP, ALLOC >::toJSON ( JSONGenerator & json) const
overridevirtual

Implements P4::IR::INode.

◆ visit_children() [1/2]

template<class T , template< class K, class V, class COMP, class ALLOC > class MAP, class COMP , class ALLOC >
void P4::IR::NameMap< T, MAP, COMP, ALLOC >::visit_children ( Visitor & v) const
overridevirtual

Reimplemented from P4::IR::Node.

◆ visit_children() [2/2]

template<class T , template< class K, class V, class COMP, class ALLOC > class MAP, class COMP , class ALLOC >
void P4::IR::NameMap< T, MAP, COMP, ALLOC >::visit_children ( Visitor & v)
overridevirtual

Reimplemented from P4::IR::Node.