CARLA
Loading...
Searching...
No Matches
Memory.h
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
9#include <memory>
10#include <utility>
11
12namespace carla {
13
14 template <typename T>
15 using SharedPtr = std::shared_ptr<T>;
16
17 template <typename T>
18 using WeakPtr = std::weak_ptr<T>;
19
20 template <typename T>
21 using EnableSharedFromThis = std::enable_shared_from_this<T>;
22
23 template <typename T, typename... Args>
24 static inline auto MakeShared(Args &&... args) {
25 return std::make_shared<T>(std::forward<Args>(args)...);
26 }
27
28} // namespace carla
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr
Definition Memory.h:15
static auto MakeShared(Args &&... args)
Definition Memory.h:24
std::weak_ptr< T > WeakPtr
Definition Memory.h:18
std::enable_shared_from_this< T > EnableSharedFromThis
Definition Memory.h:21