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

Base for all types, with a member indicating whether values of this type are assignable (references) or not (constants, expression results). More...

Public Member Functions

 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
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 Axisas_axis ()
 Interprets this node to a node of type Axis. More...
 
virtual const Axisas_axis () const
 Interprets this node to a node of type Axis. 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...
 
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< 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...
 

Public Attributes

cqasm::v1::primitives::Bool assignable
 Whether a value of this type can be assigned (true), or can only be read (false). More...
 

Additional Inherited Members

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

Detailed Description

Base for all types, with a member indicating whether values of this type are assignable (references) or not (constants, expression results).

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

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

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

Constructor & Destructor Documentation

◆ TypeBase()

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

Constructor.

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

Member Function Documentation

◆ as_type_base() [1/2]

TypeBase * cqasm::v1::types::TypeBase::as_type_base ( )
overridevirtual

Interprets this node to a node of type TypeBase.

Returns null if it has the wrong type.

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

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

◆ as_type_base() [2/2]

const TypeBase * cqasm::v1::types::TypeBase::as_type_base ( ) const
overridevirtual

Interprets this node to a node of type TypeBase.

Returns null if it has the wrong type.

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

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

◆ deserialize()

std::shared_ptr< TypeBase > cqasm::v1::types::TypeBase::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 257 of file cqasm-v1-types-gen.cpp.

Member Data Documentation

◆ assignable

cqasm::v1::primitives::Bool cqasm::v1::types::TypeBase::assignable

Whether a value of this type can be assigned (true), or can only be read (false).

For constraints, whether the value must be assignable (true), or only has to be read. In C++ terminology, true = lvalue, false = rvalue (more or less).

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


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