Quantum Resource Manager and Compiler Infrastructure (QRM&CI) 0.1.0
ConstantsMapping.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 MQSS Maintainers
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 */
7
19
20#pragma once
21
22#include "mqss/Protocol.hpp"
23#include "qrmci/Error.h"
24
25#include <MQSSCIInterfaces/MQSSCompiler.h>
26#include <expected>
27#include <mqss/submitter/Error.h>
28#include <string>
29
30namespace mqss::qrmci {
31
42[[nodiscard]] Error toQrmciError(Error::Kind kind,
43 const mqss::submitter::Error &error);
44
54[[nodiscard]] mqss::CircuitFormat mapProtoCircuitFormat(int format) noexcept;
55
64[[nodiscard]] mqss::BackendType mapProtoBackendType(int type) noexcept;
65
75[[nodiscard]] mqss::BackendStatus mapProtoBackendStatus(int status) noexcept;
76
84[[nodiscard]] std::expected<mqss::mqssci::OptLevel, Error>
86
91[[nodiscard]] bool isOnlineBackendStatus(mqss::BackendStatus status) noexcept;
92
100[[nodiscard]] std::string circuitFormatLabel(mqss::CircuitFormat format);
101
106[[nodiscard]] std::string backendStatusLabel(mqss::BackendStatus status);
107
108} // namespace mqss::qrmci
std::string backendStatusLabel(mqss::BackendStatus status)
Name a backend status for a log line.
mqss::BackendType mapProtoBackendType(int type) noexcept
Translate a raw backend-type value received over the wire into a mqss::BackendType,...
mqss::CircuitFormat mapProtoCircuitFormat(int format) noexcept
Translate a raw circuit-format value received over the wire into a mqss::CircuitFormat.
std::expected< mqss::mqssci::OptLevel, Error > getCompilerOptimizationLevel(int level)
Translate a task's requested optimisation level into the matching mqss-ci compiler optimisation level...
mqss::BackendStatus mapProtoBackendStatus(int status) noexcept
Translate a raw backend-status value received over the wire into a mqss::BackendStatus,...
bool isOnlineBackendStatus(mqss::BackendStatus status) noexcept
Check whether a backend status means the backend is able to accept tasks.
std::string circuitFormatLabel(mqss::CircuitFormat format)
Name a circuit format for a log line.
Error toQrmciError(Error::Kind kind, const mqss::submitter::Error &error)
Wrap a submitter failure as a QRM&CI failure of a kind the caller names.
The error type every std::expected in QRM&CI's public interfaces carries.
A failure reported by a QRM&CI operation: a kind the caller can act on, plus a human-readable detail ...
Definition Error.h:29
Kind
What kind of failure occurred.
Definition Error.h:32