Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
entry_manager.hpp
Go to the documentation of this file.
1#pragma once
2
3/*
4 * Copyright (C) 2023 LEIDOS.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 * use this file except in compliance with the License. You may obtain a copy of
8 * the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 * License for the specific language governing permissions and limitations under
16 * the License.
17 */
18
19#include <vector>
20#include <boost/optional.hpp>
21#include <unordered_map>
22#include "entry.hpp"
23
24
26{
31 {
32
33 public:
34
42 EntryManager(std::vector<std::string> required_entries);
43
47 EntryManager(std::vector<std::string> required_entries, std::vector<std::string> camera_entries);
48
53 void update_entry(const Entry& entry);
54
58 std::vector<Entry> get_entries() const;
59
63 boost::optional<Entry> get_entry_by_name(const std::string& name) const;
64
68 void delete_entry(const std::string& name);
69
73 bool is_entry_required(const std::string& name) const;
74
78 int is_camera_entry_required(const std::string& name) const;
79
80 private:
81
83 std::vector<Entry> entry_list_;
84
85 //list of required entries
86 std::vector<std::string> required_entries_;
87
88 //list of camera entries
89 std::vector<std::string> camera_entries_;
90
91 };
92
93
94}
The EntryManager serves as a component to track the status of each required CARMA ROS 1 driver.
std::vector< Entry > entry_list_
private list to keep track of all entries
std::vector< std::string > required_entries_
bool is_entry_required(const std::string &name) const
Check if the entry is required.
boost::optional< Entry > get_entry_by_name(const std::string &name) const
Get a entry using name as the key.
EntryManager()
Default constructor for EntryManager.
void delete_entry(const std::string &name)
Delete an entry using the given name as the key.
int is_camera_entry_required(const std::string &name) const
Check if the entry is a required camera entry.
void update_entry(const Entry &entry)
Add a new entry if the given name does not exist. Update an existing entry if the given name exists.
std::vector< std::string > camera_entries_
std::vector< Entry > get_entries() const
Get all registed entries as a list.
An entry represents a driver details for the purposes of tracking.
Definition: entry.hpp:27