14#ifndef _ALICEO2_SUBTIMEFRAME_FILE_RAWDD_H_
15#define _ALICEO2_SUBTIMEFRAME_FILE_RAWDD_H_
104 return !(*
this ==
other);
109 return fmt::format(
"{}/{}/{}",
158 using namespace std::chrono;
159 return time_point<system_clock, milliseconds>{milliseconds{
mWriteTimeMs}};
164 using namespace std::chrono;
165 std::time_t lTime = system_clock::to_time_t(
getTimePoint());
167 std::stringstream lTimeStream;
168 lTimeStream << std::put_time(std::localtime(&lTime),
"%F %T");
169 return lTimeStream.str();
186 using namespace std::chrono;
187 mWriteTimeMs = time_point_cast<milliseconds>(system_clock::now()).time_since_epoch().count();
193std::ostream&
operator<<(std::ostream& pStream,
const SubTimeFrameFileMeta& pMeta);
217 const std::uint32_t pCnt,
218 const std::uint64_t pOff,
219 const std::uint64_t pSize)
228 "DataIndexElem changed -> Binary compatibility is lost!");
239 void clear() noexcept { mDataIndex.clear(); }
240 bool empty() const noexcept {
return mDataIndex.empty(); }
243 const std::uint32_t pCnt,
244 const std::uint64_t pOffset,
245 const std::uint64_t pSize)
247 mDataIndex.emplace_back(pEqDataId, pCnt, pOffset, pSize);
255 const std::vector<DataIndexElem>&
getDataIndex()
const {
return mDataIndex; }
266 mDataIndex.size() *
sizeof(DataIndexElem));
273 std::vector<DataIndexElem> mDataIndex;
276std::ostream&
operator<<(std::ostream& pStream,
const SubTimeFrameFileDataIndex& pIndex);
293 "DataOrigin must be 4B long (uint32_t itg[1])");
294 return std::hash<o2::header::DataOrigin::ItgType>{}(
a.itg[0]);
299struct hash<
o2::header::DataDescription> {
308 "DataDescription must be 16B long (uint64_t itg[2])");
310 return std::hash<o2::header::DataDescription::ItgType>{}(
a.itg[0]) ^
311 std::hash<o2::header::DataDescription::ItgType>{}(
a.itg[1]);
317template <
typename T,
typename... Rest>
321 seed ^= hasher(
v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
346 return std::hash<o2::header::DataDescription>{}(
a.dataDescription) ^
347 std::hash<o2::header::DataOrigin>{}(
a.dataOrigin);
352struct hash<
o2::rawdd::EquipmentIdentifier> {
359 return std::hash<o2::header::DataDescription>{}(
a.mDataDescription) ^
360 (std::hash<o2::header::DataOrigin>{}(
a.mDataOrigin) << 1) ^
Class for time synchronization of RawReader instances.
GLboolean GLboolean GLboolean GLboolean a
constexpr o2::header::DataOrigin gDataOriginFLP
constexpr o2::header::DataOrigin gDataOriginAny
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void hash_combine(std::size_t &seed)
static std::string describe(InputSpec const &spec)
o2::header::DataDescription mDataDescription
EquipmentIdentifier(const o2::header::DataHeader &pDh) noexcept
o2::header::DataHeader::SubSpecificationType mSubSpecification
bool operator==(const EquipmentIdentifier &other) const noexcept
bool operator!=(const EquipmentIdentifier &other) const noexcept
EquipmentIdentifier(const o2::header::DataDescription &pDataDesc, const o2::header::DataOrigin &pDataOrig, const o2::header::DataHeader::SubSpecificationType &pSubSpec) noexcept
bool operator<(const EquipmentIdentifier &other) const noexcept
EquipmentIdentifier(const EquipmentIdentifier &pEid) noexcept
EquipmentIdentifier()=delete
o2::header::DataOrigin mDataOrigin
const std::string info() const
EquipmentIdentifier(const o2::header::DataIdentifier &pDataId, const o2::header::DataHeader::SubSpecificationType &pSubSpec) noexcept
o2::header::DataOrigin mDataOrigin
o2::header::DataHeader::SubSpecificationType mSubSpecification
subspecification (u64)
DataIndexElem(const EquipmentIdentifier &pId, const std::uint32_t pCnt, const std::uint64_t pOff, const std::uint64_t pSize)
const std::string info() const
std::uint64_t mSize
Total size of data blocks including headers.
std::uint64_t mOffset
Offset of data block (corresponding data header) relative to.
o2::header::DataDescription mDataDescription
Equipment Identifier: unrolled to pack better.
std::uint32_t mDataBlockCnt
Number of data blocks <data_header, data>
SubTimeFrameFileDataIndex.
bool empty() const noexcept
const std::vector< DataIndexElem > & getDataIndex() const
SubTimeFrameFileDataIndex()=default
std::uint64_t getSizeInFile() const
void AddStfElement(const EquipmentIdentifier &pEqDataId, const std::uint32_t pCnt, const std::uint64_t pOffset, const std::uint64_t pSize)
static const o2::header::DataDescription sDataDescFileStfDataIndex
SubTimeFrameFileDataIndex.
friend std::ostream & operator<<(std::ostream &pStream, const SubTimeFrameFileDataIndex &pIndex)
result_type operator()(argument_type const &a) const noexcept
std::uint64_t result_type
o2::rawdd::EquipmentIdentifier argument_type
VectorOfTObjectPtrs other