File indexing completed on 2025-01-18 10:01:28
0001
0002
0003 #ifndef PODIODATAMODEL_TimesliceInfo_H
0004 #define PODIODATAMODEL_TimesliceInfo_H
0005
0006 #include "PodioDatamodel/TimesliceInfoObj.h"
0007
0008
0009 #include "podio/utilities/MaybeSharedPtr.h"
0010
0011 #include <ostream>
0012 #include <cstdint>
0013
0014 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0015 #include "nlohmann/json_fwd.hpp"
0016 #endif
0017
0018
0019
0020
0021 class MutableTimesliceInfo;
0022 class TimesliceInfoCollection;
0023 class TimesliceInfoCollectionData;
0024
0025
0026
0027
0028
0029 class TimesliceInfo {
0030
0031 friend class MutableTimesliceInfo;
0032 friend class TimesliceInfoCollection;
0033 friend class TimesliceInfoCollectionData;
0034 friend class TimesliceInfoCollectionIterator;
0035
0036 public:
0037 using mutable_type = MutableTimesliceInfo;
0038 using collection_type = TimesliceInfoCollection;
0039
0040
0041 TimesliceInfo();
0042
0043
0044 TimesliceInfo(int TimesliceNumber, int RunNumber);
0045
0046
0047 TimesliceInfo(const TimesliceInfo& other) = default;
0048
0049
0050 TimesliceInfo& operator=(TimesliceInfo other);
0051
0052
0053
0054 MutableTimesliceInfo clone(bool cloneRelations=true) const;
0055
0056
0057 ~TimesliceInfo() = default;
0058
0059
0060 TimesliceInfo(const MutableTimesliceInfo& other);
0061
0062 static TimesliceInfo makeEmpty();
0063
0064 public:
0065
0066
0067 int TimesliceNumber() const;
0068
0069
0070 int RunNumber() const;
0071
0072
0073
0074
0075
0076
0077 bool isAvailable() const;
0078
0079 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TimesliceInfoObj>{nullptr}; }
0080
0081 bool operator==(const TimesliceInfo& other) const { return m_obj == other.m_obj; }
0082 bool operator==(const MutableTimesliceInfo& other) const;
0083
0084 bool operator!=(const TimesliceInfo& other) const { return !(*this == other); }
0085 bool operator!=(const MutableTimesliceInfo& other) const { return !(*this == other); }
0086
0087
0088 bool operator<(const TimesliceInfo& other) const { return m_obj < other.m_obj; }
0089
0090 podio::ObjectID id() const { return getObjectID(); }
0091
0092 const podio::ObjectID getObjectID() const;
0093
0094 friend void swap(TimesliceInfo& a, TimesliceInfo& b) {
0095 using std::swap;
0096 swap(a.m_obj, b.m_obj);
0097 }
0098
0099 private:
0100
0101 explicit TimesliceInfo(podio::utils::MaybeSharedPtr<TimesliceInfoObj> obj);
0102 TimesliceInfo(TimesliceInfoObj* obj);
0103
0104 podio::utils::MaybeSharedPtr<TimesliceInfoObj> m_obj{nullptr};
0105 };
0106
0107 std::ostream& operator<<(std::ostream& o, const TimesliceInfo& value);
0108
0109 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0110 void to_json(nlohmann::json& j, const TimesliceInfo& value);
0111 #endif
0112
0113
0114
0115
0116 #endif