libqasm
library for handling cQASM files
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cqasm::v1::types::Dumper Class Reference

Visitor class that debug-dumps a tree to a stream. More...

Public Member Functions

 Dumper (std::ostream &out, int indent=0, ::tree::base::PointerMap *ids=nullptr)
 Construct a dumping visitor. More...
 
void visit_node (Node &node) override
 Dumps a Node. More...
 
void visit_axis (Axis &node) override
 Dumps a Axis node. More...
 
void visit_bool (Bool &node) override
 Dumps a Bool node. More...
 
void visit_complex (Complex &node) override
 Dumps a Complex node. More...
 
void visit_complex_matrix (ComplexMatrix &node) override
 Dumps a ComplexMatrix node. More...
 
void visit_int (Int &node) override
 Dumps a Int node. More...
 
void visit_json (Json &node) override
 Dumps a Json node. More...
 
void visit_qubit (Qubit &node) override
 Dumps a Qubit node. More...
 
void visit_real (Real &node) override
 Dumps a Real node. More...
 
void visit_real_matrix (RealMatrix &node) override
 Dumps a RealMatrix node. More...
 
void visit_string (String &node) override
 Dumps a String node. More...
 
void visit_type_base (TypeBase &node) override
 Dumps a TypeBase node. More...
 
- Public Member Functions inherited from cqasm::v1::types::Visitor< void >
virtual void visit_node (Node &node)=0
 Fallback function for nodes of any type. More...
 
- Public Member Functions inherited from cqasm::v1::types::VisitorBase
virtual ~VisitorBase ()=default
 Virtual destructor for proper cleanup. More...
 

Protected Member Functions

void write_indent ()
 Writes the current indentation level's worth of spaces. More...
 
- Protected Member Functions inherited from cqasm::v1::types::Visitor< void >
void raw_visit_node (Node &node, void *retval) override
 Internal visitor function for nodes of any type. More...
 
void raw_visit_node (Node &node, void *retval)
 Internal visitor function for nodes of any type. More...
 
void raw_visit_node (Node &node, void *retval)
 Internal visitor function for nodes of any type. More...
 
void raw_visit_axis (Axis &node, void *retval) override
 Internal visitor function for Axis nodes. More...
 
void raw_visit_axis (Axis &node, void *retval)
 Internal visitor function for Axis nodes. More...
 
void raw_visit_axis (Axis &node, void *retval)
 Internal visitor function for Axis nodes. More...
 
void raw_visit_bool (Bool &node, void *retval) override
 Internal visitor function for Bool nodes. More...
 
void raw_visit_bool (Bool &node, void *retval)
 Internal visitor function for Bool nodes. More...
 
void raw_visit_bool (Bool &node, void *retval)
 Internal visitor function for Bool nodes. More...
 
void raw_visit_complex (Complex &node, void *retval) override
 Internal visitor function for Complex nodes. More...
 
void raw_visit_complex (Complex &node, void *retval)
 Internal visitor function for Complex nodes. More...
 
void raw_visit_complex (Complex &node, void *retval)
 Internal visitor function for Complex nodes. More...
 
void raw_visit_complex_matrix (ComplexMatrix &node, void *retval) override
 Internal visitor function for ComplexMatrix nodes. More...
 
void raw_visit_complex_matrix (ComplexMatrix &node, void *retval)
 Internal visitor function for ComplexMatrix nodes. More...
 
void raw_visit_complex_matrix (ComplexMatrix &node, void *retval)
 Internal visitor function for ComplexMatrix nodes. More...
 
void raw_visit_int (Int &node, void *retval) override
 Internal visitor function for Int nodes. More...
 
void raw_visit_int (Int &node, void *retval)
 Internal visitor function for Int nodes. More...
 
void raw_visit_int (Int &node, void *retval)
 Internal visitor function for Int nodes. More...
 
void raw_visit_json (Json &node, void *retval) override
 Internal visitor function for Json nodes. More...
 
void raw_visit_json (Json &node, void *retval)
 Internal visitor function for Json nodes. More...
 
void raw_visit_json (Json &node, void *retval)
 Internal visitor function for Json nodes. More...
 
void raw_visit_qubit (Qubit &node, void *retval) override
 Internal visitor function for Qubit nodes. More...
 
void raw_visit_qubit (Qubit &node, void *retval)
 Internal visitor function for Qubit nodes. More...
 
void raw_visit_qubit (Qubit &node, void *retval)
 Internal visitor function for Qubit nodes. More...
 
void raw_visit_real (Real &node, void *retval) override
 Internal visitor function for Real nodes. More...
 
void raw_visit_real (Real &node, void *retval)
 Internal visitor function for Real nodes. More...
 
void raw_visit_real (Real &node, void *retval)
 Internal visitor function for Real nodes. More...
 
void raw_visit_real_matrix (RealMatrix &node, void *retval) override
 Internal visitor function for RealMatrix nodes. More...
 
void raw_visit_real_matrix (RealMatrix &node, void *retval)
 Internal visitor function for RealMatrix nodes. More...
 
void raw_visit_real_matrix (RealMatrix &node, void *retval)
 Internal visitor function for RealMatrix nodes. More...
 
void raw_visit_string (String &node, void *retval) override
 Internal visitor function for String nodes. More...
 
void raw_visit_string (String &node, void *retval)
 Internal visitor function for String nodes. More...
 
void raw_visit_string (String &node, void *retval)
 Internal visitor function for String nodes. More...
 
void raw_visit_type_base (TypeBase &node, void *retval) override
 Internal visitor function for TypeBase nodes. More...
 
void raw_visit_type_base (TypeBase &node, void *retval)
 Internal visitor function for TypeBase nodes. More...
 
void raw_visit_type_base (TypeBase &node, void *retval)
 Internal visitor function for TypeBase nodes. More...
 
- Protected Member Functions inherited from cqasm::v1::types::VisitorBase
virtual void raw_visit_node (Node &node, void *retval)=0
 Internal visitor function for nodes of any type. More...
 

Protected Attributes

std::ostream & out
 Output stream to dump to. More...
 
int indent = 0
 Current indentation level. More...
 
::tree::base::PointerMap * ids
 When non-null, the print node IDs from here instead of link contents. More...
 
bool in_link = false
 Whether we're printing the contents of a link. More...
 

Detailed Description

Visitor class that debug-dumps a tree to a stream.

Definition at line 1735 of file cqasm-v1-types-gen.hpp.

#include <cqasm-v1-types-gen.hpp>

Inheritance diagram for cqasm::v1::types::Dumper:
Inheritance graph
[legend]
Collaboration diagram for cqasm::v1::types::Dumper:
Collaboration graph
[legend]

Constructor & Destructor Documentation

◆ Dumper()

cqasm::v1::types::Dumper::Dumper ( std::ostream &  out,
int  indent = 0,
::tree::base::PointerMap *  ids = nullptr 
)
inline

Construct a dumping visitor.

Definition at line 1767 of file cqasm-v1-types-gen.hpp.

Member Function Documentation

◆ write_indent()

void cqasm::v1::types::Dumper::write_indent ( )
protected

Writes the current indentation level's worth of spaces.

Definition at line 1654 of file cqasm-v1-types-gen.cpp.

◆ visit_node()

void cqasm::v1::types::Dumper::visit_node ( Node node)
override

Dumps a Node.

Definition at line 1663 of file cqasm-v1-types-gen.cpp.

◆ visit_axis()

void cqasm::v1::types::Dumper::visit_axis ( Axis node)
overridevirtual

Dumps a Axis node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 1672 of file cqasm-v1-types-gen.cpp.

◆ visit_bool()

void cqasm::v1::types::Dumper::visit_bool ( Bool node)
overridevirtual

Dumps a Bool node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 1713 of file cqasm-v1-types-gen.cpp.

◆ visit_complex()

void cqasm::v1::types::Dumper::visit_complex ( Complex node)
overridevirtual

Dumps a Complex node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 1754 of file cqasm-v1-types-gen.cpp.

◆ visit_complex_matrix()

void cqasm::v1::types::Dumper::visit_complex_matrix ( ComplexMatrix node)
overridevirtual

Dumps a ComplexMatrix node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 1795 of file cqasm-v1-types-gen.cpp.

◆ visit_int()

void cqasm::v1::types::Dumper::visit_int ( Int node)
overridevirtual

Dumps a Int node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 1884 of file cqasm-v1-types-gen.cpp.

◆ visit_json()

void cqasm::v1::types::Dumper::visit_json ( Json node)
overridevirtual

Dumps a Json node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 1925 of file cqasm-v1-types-gen.cpp.

◆ visit_qubit()

void cqasm::v1::types::Dumper::visit_qubit ( Qubit node)
overridevirtual

Dumps a Qubit node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 1966 of file cqasm-v1-types-gen.cpp.

◆ visit_real()

void cqasm::v1::types::Dumper::visit_real ( Real node)
overridevirtual

Dumps a Real node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 2007 of file cqasm-v1-types-gen.cpp.

◆ visit_real_matrix()

void cqasm::v1::types::Dumper::visit_real_matrix ( RealMatrix node)
overridevirtual

Dumps a RealMatrix node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 2048 of file cqasm-v1-types-gen.cpp.

◆ visit_string()

void cqasm::v1::types::Dumper::visit_string ( String node)
overridevirtual

Dumps a String node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 2137 of file cqasm-v1-types-gen.cpp.

◆ visit_type_base()

void cqasm::v1::types::Dumper::visit_type_base ( TypeBase node)
overridevirtual

Dumps a TypeBase node.

Reimplemented from cqasm::v1::types::RecursiveVisitor.

Definition at line 2178 of file cqasm-v1-types-gen.cpp.

Member Data Documentation

◆ out

std::ostream& cqasm::v1::types::Dumper::out
protected

Output stream to dump to.

Definition at line 1741 of file cqasm-v1-types-gen.hpp.

◆ indent

int cqasm::v1::types::Dumper::indent = 0
protected

Current indentation level.

Definition at line 1746 of file cqasm-v1-types-gen.hpp.

◆ ids

::tree::base::PointerMap* cqasm::v1::types::Dumper::ids
protected

When non-null, the print node IDs from here instead of link contents.

Definition at line 1751 of file cqasm-v1-types-gen.hpp.

◆ in_link

bool cqasm::v1::types::Dumper::in_link = false
protected

Whether we're printing the contents of a link.

Definition at line 1755 of file cqasm-v1-types-gen.hpp.


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