Project
Loading...
Searching...
No Matches
SerializationMethods.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#ifndef O2_FRAMEWORK_SERIALIZATIONMETHODS_H_
12#define O2_FRAMEWORK_SERIALIZATIONMETHODS_H_
13
16
18
19namespace o2::framework
20{
21
45template <typename T, typename HintType = void>
47{
48 public:
50 using wrapped_type = T;
51 using hint_type = HintType;
52
53 static_assert(std::is_pointer<T>::value == false, "wrapped type can not be a pointer");
54 static_assert(std::is_pointer<HintType>::value == false, "hint type can not be a pointer");
55
56 ROOTSerialized() = delete;
57 ROOTSerialized(wrapped_type& ref, hint_type* hint = nullptr) : mRef(ref), mHint(hint) {}
58
59 T& operator()() { return mRef; }
60 T const& operator()() const { return mRef; }
61
62 hint_type* getHint() const { return mHint; }
63
64 private:
65 wrapped_type& mRef;
66 hint_type* mHint; // optional hint e.g. class info or class name
67};
68
69template <typename T, typename HintType = void>
71{
72 public:
74 using wrapped_type = T;
75 using hint_type = HintType;
76
77 static_assert(std::is_pointer<T>::value == false, "wrapped type can not be a pointer");
78 static_assert(std::is_pointer<HintType>::value == false, "hint type can not be a pointer");
79
80 CCDBSerialized() = delete;
81 CCDBSerialized(wrapped_type& ref, hint_type* hint = nullptr) : mRef(ref), mHint(hint) {}
82
83 T& operator()() { return mRef; }
84 T const& operator()() const { return mRef; }
85
86 hint_type* getHint() const { return mHint; }
87
88 private:
89 wrapped_type& mRef;
90 hint_type* mHint; // optional hint e.g. class info or class name
91};
92
93} // namespace o2::framework
94#endif // O2_FRAMEWORK_SERIALIZATIONMETHODS_H_
CCDBSerialized(wrapped_type &ref, hint_type *hint=nullptr)
ROOTSerialized(wrapped_type &ref, hint_type *hint=nullptr)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20