Moving template code to CPP

This commit is contained in:
bernat 2020-10-30 12:52:22 +01:00
parent b96428adec
commit 1b205b388d
2 changed files with 26 additions and 19 deletions

View File

@ -0,0 +1,26 @@
// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
// de Barcelona (UAB).
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
#include "Carla/Game/CarlaEngine.h"
#include "Carla/Sensor/AsyncDataStream.h"
template <typename T>
template <typename SensorT>
inline FAsyncDataStreamTmpl<T>::FAsyncDataStreamTmpl(
const SensorT &Sensor,
double Timestamp,
StreamType InStream)
: Stream(std::move(InStream)),
Header([&Sensor, Timestamp]() {
//check(IsInGameThread());
using Serializer = carla::sensor::s11n::SensorHeaderSerializer;
return Serializer::Serialize(
carla::sensor::SensorRegistry::template get<SensorT*>::index,
FCarlaEngine::GetFrameCounter(),
Timestamp,
/// TODO: raname to 'GetActorTransform' once the new tick pipeline is done
Sensor.GetSyncActorTransform());
}()) {}

View File

@ -15,7 +15,6 @@
template <typename T>
class FDataStreamTmpl;
class FCarlaEngine;
// =============================================================================
// -- FAsyncDataStreamTmpl -----------------------------------------------------
@ -94,21 +93,3 @@ inline void FAsyncDataStreamTmpl<T>::Send(SensorT &Sensor, ArgsT &&... Args)
std::move(Header),
carla::sensor::SensorRegistry::Serialize(Sensor, std::forward<ArgsT>(Args)...));
}
template <typename T>
template <typename SensorT>
inline FAsyncDataStreamTmpl<T>::FAsyncDataStreamTmpl(
const SensorT &Sensor,
double Timestamp,
StreamType InStream)
: Stream(std::move(InStream)),
Header([&Sensor, Timestamp]() {
//check(IsInGameThread());
using Serializer = carla::sensor::s11n::SensorHeaderSerializer;
return Serializer::Serialize(
carla::sensor::SensorRegistry::template get<SensorT*>::index,
FCarlaEngine::GetFrameCounter(),
Timestamp,
/// TODO: raname to 'GetActorTransform' once the new tick pipeline is done
Sensor.GetSyncActorTransform());
}()) {}