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