A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
reference_mirror.h
Go to the documentation of this file.
1// Copyright 2026 The A11 Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef A11_ACTIONS_REFERENCE_MIRROR_H_
16#define A11_ACTIONS_REFERENCE_MIRROR_H_
17
18#include <memory>
19#include <string>
20#include <string_view>
21#include <vector>
22
23#include <absl/status/statusor.h>
24
25#include "a11/data/types.h"
26
27namespace a11::net {
28class WireStream;
29} // namespace a11::net
30
31namespace a11::nodes {
32class NodeMap;
33} // namespace a11::nodes
34
35namespace a11::actions {
36
38inline constexpr std::string_view kReferenceMirrorPrefix = "a11_mirror_";
39
42 public:
44 ReferenceMirrorRegistry(std::shared_ptr<net::WireStream> stream,
45 std::vector<std::string> direct_storage_ids);
46
48 absl::StatusOr<data::NodeRef> Rewrite(
49 const data::NodeRef& reference,
50 const std::shared_ptr<nodes::NodeMap>& source_map);
51
52 private:
53 struct State;
54 std::shared_ptr<State> state_;
55};
56
57} // namespace a11::actions
58
59#endif // A11_ACTIONS_REFERENCE_MIRROR_H_
Rewrites inaccessible references to ordered, receiver-owned mirror nodes.
Definition reference_mirror.h:41
absl::StatusOr< data::NodeRef > Rewrite(const data::NodeRef &reference, const std::shared_ptr< nodes::NodeMap > &source_map)
Start or reuse a mirror and return the peer-readable reference.
Definition reference_mirror.cc:225
Definition action.cc:66
constexpr std::string_view kReferenceMirrorPrefix
Reserved node-id prefix for transport-created reference targets.
Definition reference_mirror.h:38
Definition action.h:66
Definition action.h:70
Definition reference_mirror.cc:41
A reference to a (slice of a) logical node, in lieu of inline data.
Definition types.h:311
A11's core wire value types: chunks, node fragments and messages.