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