Android-cuttlefish cvd tool
cvdalloc.h
Go to the documentation of this file.
1//
2// Copyright (C) 2025 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 <mutex>
19
20#include "absl/strings/string_view.h"
21#include "fruit/fruit.h"
22
29
30namespace cuttlefish {
31
32enum class CvdallocStatus;
33
35 public:
37
38 // CommandSource
40 std::string Name() const override;
41 bool Enabled() const override;
42 std::unordered_set<SetupFeature*> Dependencies() const override;
43
44 // StatusCheckCommandSource
46
47 private:
48 Result<void> ResultSetup() override;
49 Result<void> BinaryIsValid(absl::string_view path);
51
56};
57
58fruit::Component<fruit::Required<const CuttlefishConfig::InstanceSpecific>>
60
61} // namespace cuttlefish
Definition: cuttlefish_config.h:264
Definition: cvdalloc.h:34
SharedFD their_socket_
Definition: cvdalloc.h:53
const CuttlefishConfig::InstanceSpecific instance_
Definition: cvdalloc.h:52
std::string Name() const override
Definition: cvdalloc.cpp:67
Result< void > BinaryIsValid(absl::string_view path)
Definition: cvdalloc.cpp:97
Result< void > WaitForAvailability() override
Definition: cvdalloc.cpp:73
std::unordered_set< SetupFeature * > Dependencies() const override
Definition: cvdalloc.cpp:71
std::mutex availability_mutex_
Definition: cvdalloc.h:54
bool Enabled() const override
Definition: cvdalloc.cpp:69
SharedFD socket_
Definition: cvdalloc.h:53
StopperResult Stop()
Definition: cvdalloc.cpp:103
INJECT(Cvdalloc(const CuttlefishConfig::InstanceSpecific &instance))
Result< std::vector< MonitorCommand > > Commands() override
Definition: cvdalloc.cpp:54
Result< void > ResultSetup() override
Definition: cvdalloc.cpp:88
CvdallocStatus status_
Definition: cvdalloc.h:55
Definition: shared_fd.h:125
Definition: alloc_driver.h:21
StopperResult
Definition: subprocess.h:28
fruit::Component< fruit::Required< const CuttlefishConfig::InstanceSpecific > > CvdallocComponent()
Definition: cvdalloc.cpp:120
CvdallocStatus
Definition: cvdalloc.cpp:49
tl::expected< T, StackTraceError< E > > Result
Definition: result_type.h:30