CARLA
CarlaRecorderVisualTime.cpp
Go to the documentation of this file.
1 // Copyright (c) 2020 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 
8 #include "CarlaRecorder.h"
9 #include "CarlaRecorderHelpers.h"
10 
11 void CarlaRecorderVisualTime::SetTime(double ThisTime)
12 {
13  Time = ThisTime;
14 }
15 
16 void CarlaRecorderVisualTime::Read(std::ifstream &InFile)
17 {
18  ReadValue<double>(InFile, this->Time);
19 }
20 
21 void CarlaRecorderVisualTime::Write(std::ofstream &OutFile)
22 {
23  // write the packet id
24  WriteValue<char>(OutFile, static_cast<char>(CarlaRecorderPacketId::VisualTime));
25 
26  // write packet size
27  uint32_t Total = sizeof(double);
28  WriteValue<uint32_t>(OutFile, Total);
29 
30  WriteValue<double>(OutFile, this->Time);
31 }
void Write(std::ofstream &OutFile)
void Read(std::ifstream &InFile)