diff --git a/DataFormats/Headers/include/Headers/DataHeader.h b/DataFormats/Headers/include/Headers/DataHeader.h index a4741348685e5..1a2c9f8a013eb 100644 --- a/DataFormats/Headers/include/Headers/DataHeader.h +++ b/DataFormats/Headers/include/Headers/DataHeader.h @@ -42,9 +42,7 @@ #include "MemoryResources/Types.h" #include -namespace o2 -{ -namespace header +namespace o2::header { //__________________________________________________________________________________________________ @@ -148,10 +146,6 @@ struct TraitsIntType<4> { using Type = uint32_t; }; -struct defaultPrinter { - void operator()(const char* str) const {} -}; - /// compile time evaluation of a string length, which is either N - 1 or /// shorter if one character in the array has been set to 0. template @@ -253,7 +247,7 @@ struct DescriptorCompareTraits<2> { /// solution is working also for multiples of 64 bit, but then the itg member needs /// to be an array for all. This has not been enabled yet, first the implications /// have to be studied. -template +template struct Descriptor { static_assert(internal::NumberOfActiveBits::value == 1, "Descriptor size is required to be a power of 2"); @@ -351,13 +345,6 @@ struct Descriptor { std::string ret(str, len); return std::move(ret); } - // print function needs to be implemented for every derivation - void print() const - { - // eventually terminate string before printing - PrinterPolicy printer; - printer(str); - }; }; //__________________________________________________________________________________________________ @@ -593,20 +580,8 @@ T stoui(const std::string& str, size_t* pos = nullptr, int base = 10) } }; -//__________________________________________________________________________________________________ -/// this 128 bit type for a header field describing the payload data type -struct printDataDescription { - void operator()(const char* str) const; -}; - -using DataDescription = Descriptor; - -//__________________________________________________________________________________________________ -// 32bit (4 characters) for data origin, ex. the detector or subsystem name -struct printDataOrigin { - void operator()(const char* str) const; -}; -using DataOrigin = Descriptor; +using DataOrigin = Descriptor; +using DataDescription = Descriptor; //__________________________________________________________________________________________________ /// @defgroup data_description_defines Defines for data description @@ -789,7 +764,6 @@ struct DataHeader : public BaseHeader { bool operator==(const DataOrigin&) const; //comparison bool operator==(const DataDescription&) const; //comparison bool operator==(const SerializationMethod&) const; //comparison - void print() const; ///pretty print the contents static const DataHeader* Get(const BaseHeader* baseHeader) { @@ -818,7 +792,6 @@ struct DataIdentifier { } bool operator==(const DataIdentifier&) const; - void print() const; }; //__________________________________________________________________________________________________ @@ -843,12 +816,10 @@ template struct is_descriptor : std::false_type { }; -template -struct is_descriptor> : std::true_type { +template +struct is_descriptor> : std::true_type { }; -} //namespace header - -} //namespace o2 +} //namespace o2::header #endif diff --git a/DataFormats/Headers/src/DataHeader.cxx b/DataFormats/Headers/src/DataHeader.cxx index 0fe5c446cc5a2..33f7f47c70df8 100644 --- a/DataFormats/Headers/src/DataHeader.cxx +++ b/DataFormats/Headers/src/DataHeader.cxx @@ -51,21 +51,6 @@ void o2::header::BaseHeader::throwInconsistentStackError() const throw std::runtime_error("inconsistent header stack, no O2 header at expected offset " + std::to_string(this->headerSize) + "for header of type " + this->description.as()); } -//__________________________________________________________________________________________________ -void o2::header::DataHeader::print() const -{ - printf("Data header version %u, flags: %u\n", headerVersion, flags); - printf(" origin : %s\n", dataOrigin.str); - printf(" serialization: %s\n", payloadSerializationMethod.str); - printf(" description : %s\n", dataDescription.str); - printf(" sub spec. : %llu\n", (long long unsigned int)subSpecification); - printf(" header size : %d\n", headerSize); - printf(" payloadSize : %llu\n", (long long unsigned int)payloadSize); - printf(" firstTFOrbit : %u\n", firstTForbit); - printf(" tfCounter : %u\n", tfCounter); - printf(" runNumber : %u\n", runNumber); -} - //__________________________________________________________________________________________________ bool o2::header::DataHeader::operator==(const DataOrigin& that) const { @@ -98,18 +83,6 @@ bool o2::header::DataHeader::operator==(const DataHeader& that) const subSpecification == that.subSpecification); } -//__________________________________________________________________________________________________ -void o2::header::printDataDescription::operator()(const char* str) const -{ - printf("Data description : %s\n", str); -} - -//__________________________________________________________________________________________________ -void o2::header::printDataOrigin::operator()(const char* str) const -{ - printf("Data origin : %s\n", str); -} - //__________________________________________________________________________________________________ o2::header::DataIdentifier::DataIdentifier() : dataDescription(), dataOrigin() @@ -129,13 +102,6 @@ bool o2::header::DataIdentifier::operator==(const DataIdentifier& other) const return true; } -//__________________________________________________________________________________________________ -void o2::header::DataIdentifier::print() const -{ - dataOrigin.print(); - dataDescription.print(); -} - //__________________________________________________________________________________________________ void o2::header::hexDump(const char* desc, const void* voidaddr, size_t len, size_t max) {