libqasm
library for handling cQASM files
Public Member Functions | List of all members
cqasm::v1::resolver::MappingTable Class Reference

Table of all mappings within a certain scope. More...

Public Member Functions

void add (const std::string &name, const values::Value &value, const tree::Maybe< ast::Mapping > &node=tree::Maybe< ast::Mapping >())
 Adds a mapping. More...
 
values::Value resolve (const std::string &name) const
 Resolves a mapping. More...
 
const std::unordered_map< std::string, std::pair< const values::Value, tree::Maybe< ast::Mapping > > > & get_table () const
 Grants read access to the underlying map. More...
 

Detailed Description

Table of all mappings within a certain scope.

Definition at line 38 of file cqasm-v1-resolver.hpp.

#include <cqasm-v1-resolver.hpp>

Member Function Documentation

◆ add()

void cqasm::v1::resolver::MappingTable::add ( const std::string &  name,
const values::Value value,
const tree::Maybe< ast::Mapping > &  node = tree::Maybe<ast::Mapping>() 
)

Adds a mapping.

Definition at line 23 of file cqasm-v1-resolver.cpp.

◆ resolve()

Value cqasm::v1::resolver::MappingTable::resolve ( const std::string &  name) const

Resolves a mapping.

Throws NameResolutionFailure if no mapping by the given name exists.

Definition at line 45 of file cqasm-v1-resolver.cpp.

◆ get_table()

const std::unordered_map< std::string, std::pair< const values::Value, tree::Maybe< ast::Mapping > > > & cqasm::v1::resolver::MappingTable::get_table ( ) const

Grants read access to the underlying map.

Definition at line 57 of file cqasm-v1-resolver.cpp.


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