4242#include " MemoryResources/Types.h"
4343#include < cerrno>
4444
45- namespace o2
46- {
47- namespace header
45+ namespace o2 ::header
4846{
4947
5048// __________________________________________________________________________________________________
@@ -148,10 +146,6 @@ struct TraitsIntType<4> {
148146 using Type = uint32_t ;
149147};
150148
151- struct defaultPrinter {
152- void operator ()(const char * str) const {}
153- };
154-
155149// / compile time evaluation of a string length, which is either N - 1 or
156150// / shorter if one character in the array has been set to 0.
157151template <int N>
@@ -253,7 +247,7 @@ struct DescriptorCompareTraits<2> {
253247// / solution is working also for multiples of 64 bit, but then the itg member needs
254248// / to be an array for all. This has not been enabled yet, first the implications
255249// / have to be studied.
256- template <std::size_t N, typename PrinterPolicy = internal::defaultPrinter >
250+ template <std::size_t N>
257251struct Descriptor {
258252 static_assert (internal::NumberOfActiveBits<N>::value == 1 ,
259253 " Descriptor size is required to be a power of 2" );
@@ -351,13 +345,6 @@ struct Descriptor {
351345 std::string ret (str, len);
352346 return std::move (ret);
353347 }
354- // print function needs to be implemented for every derivation
355- void print () const
356- {
357- // eventually terminate string before printing
358- PrinterPolicy printer;
359- printer (str);
360- };
361348};
362349
363350// __________________________________________________________________________________________________
@@ -593,20 +580,8 @@ T stoui(const std::string& str, size_t* pos = nullptr, int base = 10)
593580 }
594581};
595582
596- // __________________________________________________________________________________________________
597- // / this 128 bit type for a header field describing the payload data type
598- struct printDataDescription {
599- void operator ()(const char * str) const ;
600- };
601-
602- using DataDescription = Descriptor<gSizeDataDescriptionString , printDataDescription>;
603-
604- // __________________________________________________________________________________________________
605- // 32bit (4 characters) for data origin, ex. the detector or subsystem name
606- struct printDataOrigin {
607- void operator ()(const char * str) const ;
608- };
609- using DataOrigin = Descriptor<gSizeDataOriginString , printDataOrigin>;
583+ using DataOrigin = Descriptor<gSizeDataOriginString >;
584+ using DataDescription = Descriptor<gSizeDataDescriptionString >;
610585
611586// __________________________________________________________________________________________________
612587// / @defgroup data_description_defines Defines for data description
@@ -789,7 +764,6 @@ struct DataHeader : public BaseHeader {
789764 bool operator ==(const DataOrigin&) const ; // comparison
790765 bool operator ==(const DataDescription&) const ; // comparison
791766 bool operator ==(const SerializationMethod&) const ; // comparison
792- void print () const ; // /pretty print the contents
793767
794768 static const DataHeader* Get (const BaseHeader* baseHeader)
795769 {
@@ -818,7 +792,6 @@ struct DataIdentifier {
818792 }
819793
820794 bool operator ==(const DataIdentifier&) const ;
821- void print () const ;
822795};
823796
824797// __________________________________________________________________________________________________
@@ -843,12 +816,10 @@ template <typename T>
843816struct is_descriptor : std::false_type {
844817};
845818
846- template <std::size_t S, typename P >
847- struct is_descriptor <o2::header::Descriptor<S, P >> : std::true_type {
819+ template <std::size_t S>
820+ struct is_descriptor <o2::header::Descriptor<S>> : std::true_type {
848821};
849822
850- } // namespace header
851-
852- } // namespace o2
823+ } // namespace o2::header
853824
854825#endif
0 commit comments