Android-cuttlefish cvd tool
fetcher_configs.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 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 <stddef.h>
19
20#include <map>
21#include <string>
22#include <vector>
23
24#include "absl/types/span.h"
25
27
28namespace cuttlefish {
29
31 public:
32 static FetcherConfigs ReadFromDirectories(absl::Span<const std::string>);
33
35 ~FetcherConfigs() = default;
36
37 size_t Size() const { return directories_.size(); }
38
39 const FetcherConfig& ForInstance(size_t instance_index) const;
40
41 private:
42 FetcherConfigs() = default;
43
44 std::vector<std::string> directories_;
45 std::map<std::string, FetcherConfig> directory_to_config_;
46};
47
48} // namespace cuttlefish
Definition: fetcher_config.h:70
Definition: fetcher_configs.h:30
size_t Size() const
Definition: fetcher_configs.h:37
const FetcherConfig & ForInstance(size_t instance_index) const
Definition: fetcher_configs.cc:74
static FetcherConfigs ReadFromDirectories(absl::Span< const std::string >)
Definition: fetcher_configs.cc:37
FetcherConfigs(FetcherConfigs &&)=default
std::vector< std::string > directories_
Definition: fetcher_configs.h:44
std::map< std::string, FetcherConfig > directory_to_config_
Definition: fetcher_configs.h:45
Definition: alloc_driver.h:20