Android-cuttlefish cvd tool
command_sequence.h
Go to the documentation of this file.
1//
2// Copyright (C) 2022 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#pragma once
17
18#include <memory>
19#include <string>
20#include <ostream>
21#include <vector>
22
25
26namespace cuttlefish {
27
29 public:
31 const std::vector<std::unique_ptr<CvdCommandHandler>>& server_handlers);
32
33 Result<void> Execute(const std::vector<CommandRequest>&,
34 std::ostream& report);
35 Result<void> ExecuteOne(const CommandRequest&, std::ostream& report);
36
37 std::vector<std::string> CmdList() const;
39
40 private:
41 const std::vector<std::unique_ptr<CvdCommandHandler>>& server_handlers_;
42 std::vector<CvdCommandHandler*> handler_stack_;
43};
44} // namespace cuttlefish
Definition: expected.h:86
Definition: command_request.h:33
Definition: command_sequence.h:28
Result< CvdCommandHandler * > GetHandler(const CommandRequest &request)
Definition: command_sequence.cpp:115
Result< void > ExecuteOne(const CommandRequest &, std::ostream &report)
Definition: command_sequence.cpp:97
std::vector< std::string > CmdList() const
Definition: command_sequence.cpp:103
CommandSequenceExecutor(const std::vector< std::unique_ptr< CvdCommandHandler > > &server_handlers)
Definition: command_sequence.cpp:80
Result< void > Execute(const std::vector< CommandRequest > &, std::ostream &report)
Definition: command_sequence.cpp:84
std::vector< CvdCommandHandler * > handler_stack_
Definition: command_sequence.h:42
const std::vector< std::unique_ptr< CvdCommandHandler > > & server_handlers_
Definition: command_sequence.h:41
Definition: alloc_utils.cpp:23