Android-cuttlefish cvd tool
selector.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <utility>
20
26
27namespace cuttlefish {
28namespace selector {
29
30// Selects a single group based on the request's selector options. Asks the user
31// to manually choose a single group if multiple groups match the selector
32// options and stdin is a terminal.
33Result<LocalInstanceGroup> SelectGroup(const InstanceManager& instance_manager,
34 const CommandRequest& request);
35
36// Selects a single instance based on the request's selector options. Unlike
37// SelectGroup it doesn't ask the user to refine the selection in case multiple
38// instances match, it just fails instead. Also returns the group the selected
39// instance belongs to.
40Result<std::pair<LocalInstance, LocalInstanceGroup>> SelectInstance(
41 const InstanceManager& instance_manager, const CommandRequest& request);
42
43} // namespace selector
44} // namespace cuttlefish
Result< std::pair< LocalInstance, LocalInstanceGroup > > SelectInstance(const InstanceManager &instance_manager, const CommandRequest &request)
Definition: selector.cpp:177
Result< LocalInstanceGroup > SelectGroup(const InstanceManager &instance_manager, const CommandRequest &request)
Definition: selector.cpp:158
Definition: alloc_utils.cpp:23