Android-cuttlefish cvd tool
ps.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 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 <map>
20#include <string>
21
25
26namespace cuttlefish {
27
28enum class PsColumns {
29 kGroups = 0,
30 kNames,
31 kId,
32 kStatus,
36};
37
38using PsRow = std::map<PsColumns, std::string>;
39
41 public:
42 CvdPsCommandHandler(InstanceManager& instance_manager);
43
44 Result<void> Handle(const CommandRequest& request) override;
45 std::vector<std::string> CmdList() const override;
46
47 std::string SummaryHelp() const override;
48
49 bool RequiresDeviceExists() const override { return true; }
50
51 Result<std::string> DetailedHelp(const CommandRequest& request) override;
52
53 private:
55
57 LocalInstance& instance) const;
58};
59
60} // namespace cuttlefish
Definition: command_request.h:33
Definition: command_handler.h:28
Result< std::string > DetailedHelp(const CommandRequest &request) override
Definition: ps.cpp:111
Result< void > Handle(const CommandRequest &request) override
Definition: ps.cpp:115
std::string SummaryHelp() const override
Definition: ps.cpp:107
InstanceManager & instance_manager_
Definition: ps.h:54
CvdPsCommandHandler(InstanceManager &instance_manager)
Definition: ps.cpp:100
PsRow InstanceToRow(const LocalInstanceGroup &group, LocalInstance &instance) const
Definition: ps.cpp:134
std::vector< std::string > CmdList() const override
Definition: ps.cpp:103
bool RequiresDeviceExists() const override
Definition: ps.h:49
Definition: instance_manager.h:50
Definition: local_instance_group.h:32
Definition: local_instance.h:36
Definition: alloc_driver.h:20
PsColumns
Definition: ps.h:28
tl::expected< T, StackTraceError > Result
Definition: result_type.h:30
std::map< PsColumns, std::string > PsRow
Definition: ps.h:38