CARLA
 
载入中...
搜索中...
未找到
Memory.h
浏览该文件的文档.
1// Copyright (c) 2019 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 <boost/enable_shared_from_this.hpp>
10#include <boost/make_shared.hpp>
11#include <boost/shared_ptr.hpp>
12#include <boost/weak_ptr.hpp>
13
14namespace carla {
15
16 /// Use this SharedPtr (boost::shared_ptr) to keep compatibility with
17 /// boost::python, but it would be nice if in the future we can make a Python
18 /// adaptor for std::shared_ptr.
19 template <typename T>
20 using SharedPtr = boost::shared_ptr<T>;
21
22 template <typename T>
23 using WeakPtr = boost::weak_ptr<T>;
24
25 template <typename T>
26 using EnableSharedFromThis = boost::enable_shared_from_this<T>;
27
28 template <typename T, typename... Args>
29 static inline auto MakeShared(Args &&... args) {
30 return boost::make_shared<T>(std::forward<Args>(args)...);
31 }
32
33} // namespace carla
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
boost::weak_ptr< T > WeakPtr
Definition Memory.h:23
static auto MakeShared(Args &&... args)
Definition Memory.h:29
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
Definition Memory.h:20