CARLA
CarlaRecorderFrameCounter.cpp
Go to the documentation of this file.
1 // Copyright (c) 2022 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 CarlaRecorderFrameCounter::Read(std::istream &InFile)
12 {
13  ReadValue<uint64_t>(InFile, this->FrameCounter);
14 }
15 
16 void CarlaRecorderFrameCounter::Write(std::ostream &OutFile)
17 {
18  // write the packet id
19  WriteValue<char>(OutFile, static_cast<char>(CarlaRecorderPacketId::FrameCounter));
20 
21  // write packet size
22  uint32_t Total = sizeof(uint64_t);
23  WriteValue<uint32_t>(OutFile, Total);
24 
25  WriteValue<uint64_t>(OutFile, this->FrameCounter);
26 }
void Write(std::ostream &OutFile)
void Read(std::istream &InFile)