1313#include < fairmq/FairMQDevice.h>
1414#include " Headers/DataHeader.h"
1515#include " Framework/OutputRoute.h"
16+ #include " Framework/Output.h"
1617#include " Framework/DataChunk.h"
1718#include " Framework/MessageContext.h"
1819#include " Framework/RootObjectContext.h"
@@ -52,15 +53,15 @@ class DataAllocator
5253 RootObjectContext *rootContext,
5354 const AllowedOutputsMap &outputs);
5455
55- DataChunk newChunk (const OutputSpec &, size_t );
56- DataChunk adoptChunk (const OutputSpec &, char *, size_t , fairmq_free_fn*, void *);
56+ DataChunk newChunk (const Output &, size_t );
57+ DataChunk adoptChunk (const Output &, char *, size_t , fairmq_free_fn*, void *);
5758
5859 // In case no extra argument is provided and the passed type is trivially
5960 // copyable and non polymorphic, the most likely wanted behavior is to create
6061 // a message with that type, and so we do.
6162 template <typename T>
6263 typename std::enable_if<is_messageable<T>::value == true , T&>::type
63- make (const OutputSpec & spec)
64+ make (const Output & spec)
6465 {
6566 DataChunk chunk = newChunk (spec, sizeof (T));
6667 return *reinterpret_cast <T*>(chunk.data );
@@ -70,7 +71,7 @@ class DataAllocator
7071 // collection elements of that type
7172 template <typename T>
7273 typename std::enable_if<is_messageable<T>::value == true , gsl::span<T>>::type
73- make (const OutputSpec & spec, size_t nElements)
74+ make (const Output & spec, size_t nElements)
7475 {
7576 auto size = nElements*sizeof (T);
7677 DataChunk chunk = newChunk (spec, size);
@@ -86,7 +87,7 @@ class DataAllocator
8687 // / once the processing callback completes.
8788 template <typename T, typename ... Args>
8889 typename std::enable_if<std::is_base_of<TObject, T>::value == true , T&>::type
89- make (const OutputSpec & spec, Args... args) {
90+ make (const Output& spec, Args... args) {
9091 auto obj = new T (args...);
9192 adopt (spec, obj);
9293 return *obj;
@@ -100,7 +101,7 @@ class DataAllocator
100101 std::is_base_of<TObject, T>::value == false &&
101102 is_messageable<T>::value == false ,
102103 T&>::type
103- make (const OutputSpec &)
104+ make (const Output &)
104105 {
105106 static_assert (is_messageable<T>::value == true ||
106107 std::is_base_of<TObject, T>::value == true ,
@@ -116,7 +117,7 @@ class DataAllocator
116117 std::is_base_of<TObject, T>::value == false &&
117118 is_messageable<T>::value == false ,
118119 gsl::span<T>>::type
119- make (const OutputSpec &, size_t )
120+ make (const Output &, size_t )
120121 {
121122 static_assert (is_messageable<T>::value == true ,
122123 " data type T not supported by API, \n specializations available for"
@@ -131,7 +132,7 @@ class DataAllocator
131132 std::is_base_of<TObject, T>::value == false &&
132133 is_messageable<T>::value == false ,
133134 T&>::type
134- make (const OutputSpec &, U, V, Args...)
135+ make (const Output &, U, V, Args...)
135136 {
136137 static_assert (is_messageable<T>::value == true || std::is_base_of<TObject, T>::value == true ,
137138 " data type T not supported by API, \n specializations available for"
@@ -143,7 +144,7 @@ class DataAllocator
143144 // / Adopt a TObject in the framework and serialize / send
144145 // / it to the consumers of @a spec once done.
145146 void
146- adopt (const OutputSpec & spec, TObject*obj);
147+ adopt (const Output& spec, TObject*obj);
147148
148149 // / Serialize a snapshot of an object with root dictionary when called,
149150 // / will then be sent once the computation ends.
@@ -155,7 +156,7 @@ class DataAllocator
155156 // / explicitely otherwise by using ROOTSerialized wrapper type.
156157 template <typename T>
157158 typename std::enable_if<has_root_dictionary<T>::value == true && is_messageable<T>::value == false , void >::type
158- snapshot (const OutputSpec & spec, T& object)
159+ snapshot (const Output & spec, T& object)
159160 {
160161 FairMQMessagePtr payloadMessage (mDevice ->NewMessage ());
161162 auto * cl = TClass::GetClass (typeid (T));
@@ -173,7 +174,7 @@ class DataAllocator
173174 // / after the call will not be sent.
174175 template <typename W>
175176 typename std::enable_if<is_specialization<W, ROOTSerialized>::value == true , void >::type
176- snapshot (const OutputSpec & spec, W wrapper)
177+ snapshot (const Output & spec, W wrapper)
177178 {
178179 using T = typename W::wrapped_type;
179180 static_assert (std::is_same<typename W::hint_type, const char >::value || //
@@ -214,7 +215,7 @@ class DataAllocator
214215 // / unserialized. Use @a ROOTSerialized type wrapper to force ROOT serialization.
215216 template <typename T>
216217 typename std::enable_if<is_messageable<T>::value == true , void >::type
217- snapshot (const OutputSpec & spec, T const & object)
218+ snapshot (const Output & spec, T const & object)
218219 {
219220 FairMQMessagePtr payloadMessage (mDevice ->NewMessage (sizeof (T)));
220221 memcpy (payloadMessage->GetData (), &object, sizeof (T));
@@ -230,7 +231,7 @@ class DataAllocator
230231 typename std::enable_if<is_specialization<C, std::vector>::value == true &&
231232 std::is_pointer<typename C::value_type>::value == false &&
232233 is_messageable<typename C::value_type>::value == true >::type
233- snapshot (const OutputSpec & spec, C const & v)
234+ snapshot (const Output & spec, C const & v)
234235 {
235236 auto sizeInBytes = sizeof (typename C::value_type) * v.size ();
236237 FairMQMessagePtr payloadMessage (mDevice ->NewMessage (sizeInBytes));
@@ -250,7 +251,7 @@ class DataAllocator
250251 is_specialization<C, std::vector>::value == true &&
251252 std::is_pointer<typename C::value_type>::value == true &&
252253 is_messageable<typename std::remove_pointer<typename C::value_type>::type>::value == true >::type
253- snapshot (const OutputSpec & spec, C const & v)
254+ snapshot (const Output & spec, C const & v)
254255 {
255256 using ElementType = typename std::remove_pointer<typename C::value_type>::type;
256257 constexpr auto elementSizeInBytes = sizeof (ElementType);
@@ -273,7 +274,7 @@ class DataAllocator
273274 is_messageable<T>::value == false && //
274275 std::is_pointer<T>::value == false && //
275276 is_specialization<T, std::vector>::value == false >::type //
276- snapshot (const OutputSpec & spec, T const &)
277+ snapshot (const Output & spec, T const &)
277278 {
278279 static_assert (has_root_dictionary<T>::value == true ||
279280 is_specialization<T, ROOTSerialized>::value == true ||
@@ -294,7 +295,7 @@ class DataAllocator
294295 typename std::remove_pointer<typename T::value_type>::type
295296 >::value == false
296297 >::type
297- snapshot (const OutputSpec & spec, T const &)
298+ snapshot (const Output & spec, T const &)
298299 {
299300 static_assert (is_messageable<typename std::remove_pointer<typename T::value_type>::type>::value == true ,
300301 " data type T not supported by API, \n specializations available for"
@@ -306,20 +307,20 @@ class DataAllocator
306307 // / specialization to catch the case where a pointer to an object has been
307308 // / accidentally given as parameter
308309 template <typename T>
309- typename std::enable_if<std::is_pointer<T>::value>::type snapshot (const OutputSpec & spec, T const &)
310+ typename std::enable_if<std::is_pointer<T>::value>::type snapshot (const Output & spec, T const &)
310311 {
311312 static_assert (std::is_pointer<T>::value == false ,
312313 " pointer to data type not supported by API. Please pass object by reference" );
313314 }
314315
315316 private:
316- std::string matchDataHeader (const OutputSpec &spec, size_t timeframeId);
317- FairMQMessagePtr headerMessageFromSpec (OutputSpec const &spec,
318- std::string const &channel,
319- o2::header::SerializationMethod serializationMethod);
317+ std::string matchDataHeader (const Output &spec, size_t timeframeId);
318+ FairMQMessagePtr headerMessageFromOutput (Output const &spec,
319+ std::string const &channel,
320+ o2::header::SerializationMethod serializationMethod);
320321
321322 void addPartToContext (FairMQMessagePtr&& payload,
322- const OutputSpec &spec,
323+ const Output &spec,
323324 o2::header::SerializationMethod serializationMethod);
324325
325326 FairMQDevice *mDevice ;
0 commit comments