5 #include "IDebugSnapshotReceiver.h"
6 #include "ITimestampProvider.h"
7 #include "../../GrailData/DebugInfo/GrailDebugInfo.h"
21 void ResetDebugInfo();
23 void SaveToFile(
const std::string& filePath,
bool useBinaryFormat =
true)
const;
31 template <
typename SnapshotType>
32 void ProcessNewSnapshot(SnapshotType& snapshot,
33 std::vector<SnapshotType>& snapshotList)
35 debugInfo.endTime = std::fmax(snapshot.absoluteTime, debugInfo.endTime);
36 snapshot.relativeTime = timestampProvider->GetTimestamp() - debugInfo.startTime;
37 snapshotList.push_back(snapshot);
40 template <
typename SnapshotType>
41 void ProcessReasonerSnapshot(SnapshotType& reasonerSnapshot,
42 std::map<
size_t, std::vector<SnapshotType>>& listsPerEntity,
45 auto iter = listsPerEntity.find(entityId);
46 if(iter == listsPerEntity.end())
48 std::vector<SnapshotType> snapshots;
49 ProcessNewSnapshot(reasonerSnapshot, snapshots);
50 listsPerEntity[entityId] = std::move(snapshots);
54 ProcessNewSnapshot(reasonerSnapshot, iter->second);
58 std::shared_ptr<ITimestampProvider> timestampProvider =
nullptr;