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