CARLA
 
载入中...
搜索中...
未找到
EpisodeStateSerializer.h
浏览该文件的文档.
1// Copyright (c) 2017 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 "carla/Buffer.h"
10#include "carla/Debug.h"
11#include "carla/Memory.h"
16
17#include <cstdint>
18
19namespace carla {
20namespace sensor {
21
22 class SensorData;
23
24namespace s11n {
25
26 /// Serializes the current state of the whole episode.
28 public:
29
31 None = (0x0 << 0),
32 MapChange = (0x1 << 0),
33 PendingLightUpdate = (0x1 << 1)
34 };
35
36#pragma pack(push, 1)
44#pragma pack(pop)
45
46 constexpr static auto header_offset = sizeof(Header);
47
48 static const Header &DeserializeHeader(const RawData &message) {
49 return *reinterpret_cast<const Header *>(message.begin());
50 }
51
52 template <typename SensorT>
53 static Buffer Serialize(const SensorT &, Buffer &&buffer) {
54 return std::move(buffer);
55 }
56
58 };
59
60} // namespace s11n
61} // namespace sensor
62} // namespace carla
A piece of raw data.
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition RawData.h:21
auto begin() noexcept
Begin iterator to the data generated by the sensor.
Definition RawData.h:52
Serializes the current state of the whole episode.
static Buffer Serialize(const SensorT &, Buffer &&buffer)
static const Header & DeserializeHeader(const RawData &message)
static SharedPtr< SensorData > Deserialize(RawData &&data)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
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