Project
Loading...
Searching...
No Matches
SubTimeFrameFile.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12// Adapthed with minimal changes from Gvozden Nescovic code to read sTFs files created by DataDistribution
13
15
16namespace o2
17{
18namespace rawdd
19{
20
21using namespace o2::header;
22
26
28
29std::ostream& operator<<(std::ostream& pStream, const SubTimeFrameFileMeta& pMeta)
30{
31 static_assert(std::is_standard_layout<SubTimeFrameFileMeta>::value,
32 "SubTimeFrameFileMeta must be a std layout type.");
33
34 // write DataHeader
36 pStream.write(reinterpret_cast<const char*>(&lDataHeader), sizeof(o2::header::DataHeader));
37 // write the meta
38
39 return pStream.write(reinterpret_cast<const char*>(&pMeta), sizeof(SubTimeFrameFileMeta));
40}
41
45
47
48std::ostream& operator<<(std::ostream& pStream, const SubTimeFrameFileDataIndex& pIndex)
49{
50 static_assert(std::is_standard_layout<SubTimeFrameFileDataIndex::DataIndexElem>::value,
51 "SubTimeFrameFileDataIndex::DataIndexElem must be a std layout type.");
52
53 // write DataHeader
54 const o2::header::DataHeader lDataHeader = pIndex.getDataHeader();
55 pStream.write(reinterpret_cast<const char*>(&lDataHeader), sizeof(o2::header::DataHeader));
56
57 // write the index
58 return pStream.write(reinterpret_cast<const char*>(pIndex.mDataIndex.data()),
59 pIndex.mDataIndex.size() * sizeof(SubTimeFrameFileDataIndex::DataIndexElem));
60}
61} // namespace rawdd
62} // namespace o2
O2 data header classes and API, v0.1.
Definition DetID.h:49
std::ostream & operator<<(std::ostream &os, const o2::header::RDHAny &rdh)
Definition RDHManip.cxx:84
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
the main header struct
Definition DataHeader.h:618
static const o2::header::DataDescription sDataDescFileStfDataIndex
SubTimeFrameFileDataIndex.
static const o2::header::DataHeader getDataHeader()
static const o2::header::DataDescription sDataDescFileSubTimeFrame
SubTimeFrameFileMeta.