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

Type of an axis (x, y, or z). More...

Public Member Functions

 Axis (const cqasm::v1::primitives::Bool &assignable=cqasm::v1::primitives::initialize< cqasm::v1::primitives::Bool >())
 Constructor. More...
 
void find_reachable (::tree::base::PointerMap &map) const override
 Registers all reachable nodes with the given PointerMap. More...
 
void check_complete (const ::tree::base::PointerMap &map) const override
 Returns whether this Axis is complete/fully defined. More...
 
NodeType type () const override
 Returns the NodeType of this node. More...
 
Axisas_axis () override
 Interprets this node to a node of type Axis. More...
 
const Axisas_axis () const override
 Interprets this node to a node of type Axis. More...
 
One< Nodecopy () const override
 Returns a shallow copy of this node. More...
 
One< Nodeclone () const override
 Returns a deep copy of this node. More...
 
bool equals (const Node &rhs) const override
 Value-based equality operator. More...
 
bool operator== (const Node &rhs) const override
 Pointer-based equality operator. More...
 
void serialize (::tree::cbor::MapWriter &map, const ::tree::base::PointerMap &ids) const override
 Serializes this node to the given map. More...
 
- Public Member Functions inherited from cqasm::v1::types::TypeBase
 TypeBase (const cqasm::v1::primitives::Bool &assignable=cqasm::v1::primitives::initialize< cqasm::v1::primitives::Bool >())
 Constructor. More...
 
TypeBaseas_type_base () override
 Interprets this node to a node of type TypeBase. More...
 
const TypeBaseas_type_base () const override
 Interprets this node to a node of type TypeBase. More...
 
- Public Member Functions inherited from cqasm::v1::types::Node
bool operator!= (const Node &rhs) const
 Pointer-based inequality operator. More...
 
template<typename T >
visit (Visitor< T > &visitor)
 Visit this object. More...
 
void dump (std::ostream &out=std::cout, int indent=0)
 Writes a debug dump of this node to the given stream. More...
 
void dump_seq (std::ostream &out=std::cout, int indent=0)
 Alternate debug dump that represents links and node uniqueness via sequence number tags. More...
 
virtual Boolas_bool ()
 Interprets this node to a node of type Bool. More...
 
virtual const Boolas_bool () const
 Interprets this node to a node of type Bool. More...
 
virtual Complexas_complex ()
 Interprets this node to a node of type Complex. More...
 
virtual const Complexas_complex () const
 Interprets this node to a node of type Complex. More...
 
virtual ComplexMatrixas_complex_matrix ()
 Interprets this node to a node of type ComplexMatrix. More...
 
virtual const ComplexMatrixas_complex_matrix () const
 Interprets this node to a node of type ComplexMatrix. More...
 
virtual Intas_int ()
 Interprets this node to a node of type Int. More...
 
virtual const Intas_int () const
 Interprets this node to a node of type Int. More...
 
virtual Jsonas_json ()
 Interprets this node to a node of type Json. More...
 
virtual const Jsonas_json () const
 Interprets this node to a node of type Json. More...
 
virtual Qubitas_qubit ()
 Interprets this node to a node of type Qubit. More...
 
virtual const Qubitas_qubit () const
 Interprets this node to a node of type Qubit. More...
 
virtual Realas_real ()
 Interprets this node to a node of type Real. More...
 
virtual const Realas_real () const
 Interprets this node to a node of type Real. More...
 
virtual RealMatrixas_real_matrix ()
 Interprets this node to a node of type RealMatrix. More...
 
virtual const RealMatrixas_real_matrix () const
 Interprets this node to a node of type RealMatrix. More...
 
virtual Stringas_string ()
 Interprets this node to a node of type String. More...
 
virtual const Stringas_string () const
 Interprets this node to a node of type String. More...
 

Static Public Member Functions

static std::shared_ptr< Axisdeserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids)
 Deserializes the given node. More...
 
- Static Public Member Functions inherited from cqasm::v1::types::TypeBase
static std::shared_ptr< TypeBasedeserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids)
 Deserializes the given node. More...
 
- Static Public Member Functions inherited from cqasm::v1::types::Node
static std::shared_ptr< Nodedeserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids)
 Deserializes the given node. More...
 

Protected Member Functions

void visit_internal (VisitorBase &visitor, void *retval) override
 Helper method for visiting nodes. More...
 

Additional Inherited Members

- Public Attributes inherited from cqasm::v1::types::TypeBase
cqasm::v1::primitives::Bool assignable
 Whether a value of this type can be assigned (true), or can only be read (false). More...
 

Detailed Description

Type of an axis (x, y, or z).

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

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

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

Constructor & Destructor Documentation

◆ Axis()

cqasm::v1::types::Axis::Axis ( const cqasm::v1::primitives::Bool assignable = cqasm::v1::primitives::initialize<cqasm::v1::primitives::Bool>())

Constructor.

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

Member Function Documentation

◆ find_reachable()

void cqasm::v1::types::Axis::find_reachable ( ::tree::base::PointerMap &  map) const
override

Registers all reachable nodes with the given PointerMap.

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

◆ check_complete()

void cqasm::v1::types::Axis::check_complete ( const ::tree::base::PointerMap &  map) const
override

Returns whether this Axis is complete/fully defined.

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

◆ type()

NodeType cqasm::v1::types::Axis::type ( ) const
overridevirtual

Returns the NodeType of this node.

Implements cqasm::v1::types::Node.

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

◆ visit_internal()

void cqasm::v1::types::Axis::visit_internal ( VisitorBase visitor,
void *  retval 
)
overrideprotectedvirtual

Helper method for visiting nodes.

Implements cqasm::v1::types::Node.

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

◆ as_axis() [1/2]

Axis * cqasm::v1::types::Axis::as_axis ( )
overridevirtual

Interprets this node to a node of type Axis.

Returns null if it has the wrong type.

Reimplemented from cqasm::v1::types::Node.

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

◆ as_axis() [2/2]

const Axis * cqasm::v1::types::Axis::as_axis ( ) const
overridevirtual

Interprets this node to a node of type Axis.

Returns null if it has the wrong type.

Reimplemented from cqasm::v1::types::Node.

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

◆ copy()

One< Node > cqasm::v1::types::Axis::copy ( ) const
overridevirtual

Returns a shallow copy of this node.

Implements cqasm::v1::types::Node.

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

◆ clone()

One< Node > cqasm::v1::types::Axis::clone ( ) const
overridevirtual

Returns a deep copy of this node.

Implements cqasm::v1::types::Node.

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

◆ equals()

bool cqasm::v1::types::Axis::equals ( const Node rhs) const
overridevirtual

Value-based equality operator.

Ignores annotations!

Implements cqasm::v1::types::Node.

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

◆ operator==()

bool cqasm::v1::types::Axis::operator== ( const Node rhs) const
overridevirtual

Pointer-based equality operator.

Implements cqasm::v1::types::Node.

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

◆ serialize()

void cqasm::v1::types::Axis::serialize ( ::tree::cbor::MapWriter &  map,
const ::tree::base::PointerMap &  ids 
) const
overridevirtual

Serializes this node to the given map.

Implements cqasm::v1::types::Node.

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

◆ deserialize()

std::shared_ptr< Axis > cqasm::v1::types::Axis::deserialize ( const ::tree::cbor::MapReader &  map,
::tree::base::IdentifierMap &  ids 
)
static

Deserializes the given node.

Writes a debug dump of this node to the given stream.

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


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