Project
Loading...
Searching...
No Matches
ObjectStore.h
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#ifndef O2_OBJECTSTORE_H
13#define O2_OBJECTSTORE_H
14
19
20#include <variant>
21#include <memory>
22#include <vector>
23#include <Headers/DataHeader.h>
24
25class TObject;
26
27namespace o2
28{
29
30namespace framework
31{
32struct DataRef;
33struct DataAllocator;
34} // namespace framework
35
36namespace mergers
37{
38
39class MergeInterface;
40
41using TObjectPtr = std::shared_ptr<TObject>;
42using VectorOfRawTObjects = std::vector<TObject*>;
43using VectorOfTObjectPtrs = std::vector<TObjectPtr>;
44using MergeInterfacePtr = std::shared_ptr<MergeInterface>;
45using ObjectStore = std::variant<std::monostate, TObjectPtr, VectorOfTObjectPtrs, MergeInterfacePtr>;
46
47namespace object_store_helpers
48{
49
52
56
60bool snapshot(framework::DataAllocator& allocator, const header::DataHeader::SubSpecificationType subSpec, const ObjectStore& mergedObject);
61
62} // namespace object_store_helpers
63
64} // namespace mergers
65} // namespace o2
66
67#endif // O2_OBJECTSTORE_H
ObjectStore extractObjectFrom(const framework::DataRef &ref)
Takes a DataRef, deserializes it (if type is supported) and puts into an ObjectStore.
VectorOfRawTObjects toRawObserverPointers(const VectorOfTObjectPtrs &)
Helper function that converts vector of smart pointers to the vector of raw pointers that is serializ...
bool snapshot(framework::DataAllocator &allocator, const header::DataHeader::SubSpecificationType subSpec, const ObjectStore &mergedObject)
Used in FullHistorMerger's and IntegratingMerger's publish function. Checks mergedObject for every st...
std::vector< TObjectPtr > VectorOfTObjectPtrs
Definition ObjectStore.h:43
std::vector< TObject * > VectorOfRawTObjects
Definition ObjectStore.h:42
std::shared_ptr< TObject > TObjectPtr
Definition ObjectStore.h:41
std::shared_ptr< MergeInterface > MergeInterfacePtr
Definition ObjectStore.h:44
std::variant< std::monostate, TObjectPtr, VectorOfTObjectPtrs, MergeInterfacePtr > ObjectStore
Definition ObjectStore.h:45
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
uint32_t SubSpecificationType
Definition DataHeader.h:620