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

Represents a constant value. More...

Public Member Functions

Constantas_constant () override
 Interprets this node to a node of type Constant. More...
 
const Constantas_constant () const override
 Interprets this node to a node of type Constant. More...
 
- Public Member Functions inherited from cqasm::v1::values::Node
virtual NodeType type () const =0
 Returns the NodeType of this node. More...
 
virtual One< Nodecopy () const =0
 Returns a shallow copy of this node. More...
 
virtual One< Nodeclone () const =0
 Returns a deep copy of this node. More...
 
virtual bool equals (const Node &rhs) const =0
 Value-based equality operator. More...
 
virtual bool operator== (const Node &rhs) const =0
 Pointer-based equality operator. More...
 
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 BitRefsas_bit_refs ()
 Interprets this node to a node of type BitRefs. More...
 
virtual const BitRefsas_bit_refs () const
 Interprets this node to a node of type BitRefs. More...
 
virtual ConstAxisas_const_axis ()
 Interprets this node to a node of type ConstAxis. More...
 
virtual const ConstAxisas_const_axis () const
 Interprets this node to a node of type ConstAxis. More...
 
virtual ConstBoolas_const_bool ()
 Interprets this node to a node of type ConstBool. More...
 
virtual const ConstBoolas_const_bool () const
 Interprets this node to a node of type ConstBool. More...
 
virtual ConstComplexas_const_complex ()
 Interprets this node to a node of type ConstComplex. More...
 
virtual const ConstComplexas_const_complex () const
 Interprets this node to a node of type ConstComplex. More...
 
virtual ConstComplexMatrixas_const_complex_matrix ()
 Interprets this node to a node of type ConstComplexMatrix. More...
 
virtual const ConstComplexMatrixas_const_complex_matrix () const
 Interprets this node to a node of type ConstComplexMatrix. More...
 
virtual ConstIntas_const_int ()
 Interprets this node to a node of type ConstInt. More...
 
virtual const ConstIntas_const_int () const
 Interprets this node to a node of type ConstInt. More...
 
virtual ConstJsonas_const_json ()
 Interprets this node to a node of type ConstJson. More...
 
virtual const ConstJsonas_const_json () const
 Interprets this node to a node of type ConstJson. More...
 
virtual ConstRealas_const_real ()
 Interprets this node to a node of type ConstReal. More...
 
virtual const ConstRealas_const_real () const
 Interprets this node to a node of type ConstReal. More...
 
virtual ConstRealMatrixas_const_real_matrix ()
 Interprets this node to a node of type ConstRealMatrix. More...
 
virtual const ConstRealMatrixas_const_real_matrix () const
 Interprets this node to a node of type ConstRealMatrix. More...
 
virtual ConstStringas_const_string ()
 Interprets this node to a node of type ConstString. More...
 
virtual const ConstStringas_const_string () const
 Interprets this node to a node of type ConstString. More...
 
virtual Functionas_function ()
 Interprets this node to a node of type Function. More...
 
virtual const Functionas_function () const
 Interprets this node to a node of type Function. More...
 
virtual QubitRefsas_qubit_refs ()
 Interprets this node to a node of type QubitRefs. More...
 
virtual const QubitRefsas_qubit_refs () const
 Interprets this node to a node of type QubitRefs. More...
 
virtual Referenceas_reference ()
 Interprets this node to a node of type Reference. More...
 
virtual const Referenceas_reference () const
 Interprets this node to a node of type Reference. More...
 
virtual VariableRefas_variable_ref ()
 Interprets this node to a node of type VariableRef. More...
 
virtual const VariableRefas_variable_ref () const
 Interprets this node to a node of type VariableRef. More...
 
virtual void serialize (::tree::cbor::MapWriter &map, const ::tree::base::PointerMap &ids) const =0
 Serializes this node to the given map. More...
 

Static Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from cqasm::v1::values::Node
virtual void visit_internal (VisitorBase &visitor, void *retval=nullptr)=0
 Internal helper method for visiter pattern. More...
 

Detailed Description

Represents a constant value.

Definition at line 514 of file cqasm-v1-values-gen.hpp.

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

Inheritance diagram for cqasm::v1::values::Constant:
Inheritance graph
[legend]
Collaboration diagram for cqasm::v1::values::Constant:
Collaboration graph
[legend]

Member Function Documentation

◆ as_constant() [1/2]

Constant * cqasm::v1::values::Constant::as_constant ( )
overridevirtual

Interprets this node to a node of type Constant.

Returns null if it has the wrong type.

Reimplemented from cqasm::v1::values::Node.

Definition at line 450 of file cqasm-v1-values-gen.cpp.

◆ as_constant() [2/2]

const Constant * cqasm::v1::values::Constant::as_constant ( ) const
overridevirtual

Interprets this node to a node of type Constant.

Returns null if it has the wrong type.

Reimplemented from cqasm::v1::values::Node.

Definition at line 458 of file cqasm-v1-values-gen.cpp.

◆ deserialize()

std::shared_ptr< Constant > cqasm::v1::values::Constant::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 465 of file cqasm-v1-values-gen.cpp.


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