Warning, file /include/JANA/examples/PodioDatamodel/MutableTimesliceInfo.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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(const int TimesliceNumber, const int RunNumber);
0044
0045
0046 MutableTimesliceInfo(const MutableTimesliceInfo& other) = default;
0047
0048
0049 MutableTimesliceInfo& operator=(MutableTimesliceInfo other) &;
0050 MutableTimesliceInfo& operator=(MutableTimesliceInfo other) && = delete;
0051
0052
0053
0054 MutableTimesliceInfo clone(bool cloneRelations=true) const;
0055
0056
0057 ~MutableTimesliceInfo() = default;
0058
0059
0060 public:
0061
0062
0063 int TimesliceNumber() const;
0064
0065
0066 int RunNumber() const;
0067
0068
0069
0070
0071 void TimesliceNumber(const int TimesliceNumber);
0072
0073 int& TimesliceNumber();
0074
0075
0076 void RunNumber(const int RunNumber);
0077
0078 int& RunNumber();
0079
0080
0081
0082
0083
0084
0085
0086 bool isAvailable() const;
0087
0088 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TimesliceInfoObj>{nullptr}; }
0089
0090 bool operator==(const MutableTimesliceInfo& other) const { return m_obj == other.m_obj; }
0091 bool operator==(const TimesliceInfo& other) const;
0092
0093 bool operator!=(const MutableTimesliceInfo& other) const { return !(*this == other); }
0094 bool operator!=(const TimesliceInfo& other) const { return !(*this == other); }
0095
0096
0097 bool operator<(const MutableTimesliceInfo& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0098
0099 podio::ObjectID id() const { return getObjectID(); }
0100
0101 const podio::ObjectID getObjectID() const;
0102
0103 friend std::hash<MutableTimesliceInfo>;
0104
0105 friend void swap(MutableTimesliceInfo& a, MutableTimesliceInfo& b) {
0106 using std::swap;
0107 swap(a.m_obj, b.m_obj);
0108 }
0109
0110 private:
0111
0112 explicit MutableTimesliceInfo(podio::utils::MaybeSharedPtr<TimesliceInfoObj> obj);
0113
0114 podio::utils::MaybeSharedPtr<TimesliceInfoObj> m_obj{nullptr};
0115 };
0116
0117 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0118 void to_json(nlohmann::json& j, const MutableTimesliceInfo& value);
0119 #endif
0120
0121
0122
0123
0124
0125 template<>
0126 struct std::hash<MutableTimesliceInfo> {
0127 std::size_t operator()(const MutableTimesliceInfo& obj) const {
0128 return std::hash<TimesliceInfoObj*>{}(obj.m_obj.get());
0129 }
0130 };
0131
0132
0133 #endif