Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Pyston::NodeBase Class Referenceabstract

#include <Node.h>

Inheritance diagram for Pyston::NodeBase:
Inheritance graph
[legend]
Collaboration diagram for Pyston::NodeBase:
Collaboration graph
[legend]

Public Member Functions

 NodeBase (const std::type_index &type_index)
 
virtual ~NodeBase ()=default
 
virtual std::string repr () const =0
 
virtual void visit (Visitor &) const =0
 
const std::type_indextype () const
 

Private Attributes

const std::type_index m_type_index
 

Detailed Description

To make the visitor independent of the primitive type wrapped by a Node, all instances of the templated class inherit from this one, which declares the API required by the visitor

Definition at line 39 of file Node.h.

Constructor & Destructor Documentation

◆ NodeBase()

Pyston::NodeBase::NodeBase ( const std::type_index type_index)
inlineexplicit

Constructor

Parameters
type_infoType info of the inheriting Node T

Definition at line 46 of file Node.h.

◆ ~NodeBase()

virtual Pyston::NodeBase::~NodeBase ( )
virtualdefault

Destructor

Member Function Documentation

◆ repr()

virtual std::string Pyston::NodeBase::repr ( ) const
pure virtual
Returns
A human readable representation of the node
Note
It should not include the representation of the children, if any. That's what visitors are for.

Implemented in Pyston::Cast< To, From >, Pyston::Constant< T >, Pyston::Function< R, Args >, Pyston::Placeholder< T >, Pyston::AttrGetter< T >, and Pyston::PythonCall< T >.

Referenced by Pyston::GraphvizGenerator::enter(), and Pyston::TextReprVisitor::exit().

◆ type()

const std::type_index & Pyston::NodeBase::type ( ) const
inline
Returns
The type information of the inheriting Node

Definition at line 71 of file Node.h.

References m_type_index.

◆ visit()

virtual void Pyston::NodeBase::visit ( Visitor ) const
pure virtual

Member Data Documentation

◆ m_type_index

const std::type_index Pyston::NodeBase::m_type_index
private

Definition at line 76 of file Node.h.

Referenced by type().


The documentation for this class was generated from the following file: