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

Type of an arbitrary string. More...

Public Member Functions

 String (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 String is complete/fully defined. More...
 
NodeType type () const override
 Returns the NodeType of this node. More...
 
Stringas_string () override
 Interprets this node to a node of type String. More...
 
const Stringas_string () const override
 Interprets this node to a node of type String. 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 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...
 

Static Public Member Functions

static std::shared_ptr< Stringdeserialize (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 arbitrary string.

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

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

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

Constructor & Destructor Documentation

◆ String()

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

Constructor.

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

Member Function Documentation

◆ find_reachable()

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

Registers all reachable nodes with the given PointerMap.

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

◆ check_complete()

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

Returns whether this String is complete/fully defined.

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

◆ type()

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

Returns the NodeType of this node.

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

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

◆ visit_internal()

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

Helper method for visiting nodes.

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

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

◆ as_string() [1/2]

String * cqasm::v1::types::String::as_string ( )
overridevirtual

Interprets this node to a node of type String.

Returns null if it has the wrong type.

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

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

◆ as_string() [2/2]

const String * cqasm::v1::types::String::as_string ( ) const
overridevirtual

Interprets this node to a node of type String.

Returns null if it has the wrong type.

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

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

◆ copy()

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

Returns a shallow copy of this node.

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

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

◆ clone()

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

Returns a deep copy of this node.

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

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

◆ equals()

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

Value-based equality operator.

Ignores annotations!

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

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

◆ operator==()

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

Pointer-based equality operator.

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

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

◆ serialize()

void cqasm::v1::types::String::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 1438 of file cqasm-v1-types-gen.cpp.

◆ deserialize()

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


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