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