File indexing completed on 2026-09-10 08:39:04
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
0021 namespace ActsPodioEdm {
0022 class BoundParametersCollection;
0023 }
0024
0025 namespace ActsPodioEdm {
0026
0027
0028
0029
0030
0031 class MutableBoundParameters {
0032 friend class BoundParametersCollection;
0033 friend class BoundParametersMutableCollectionIterator;
0034 friend class BoundParameters;
0035
0036 public:
0037 using object_type = BoundParameters;
0038 using collection_type = BoundParametersCollection;
0039
0040
0041 MutableBoundParameters() = default;
0042
0043
0044 MutableBoundParameters(const ActsPodioEdm::BoundParametersInfo& data);
0045
0046
0047 MutableBoundParameters(const MutableBoundParameters& other) = default;
0048
0049
0050 MutableBoundParameters& operator=(
0051 MutableBoundParameters
0052 other) &;
0053 MutableBoundParameters& operator=(MutableBoundParameters other) && =
0054 delete;
0055
0056
0057
0058 MutableBoundParameters clone(bool cloneRelations = true) const;
0059
0060
0061 ~MutableBoundParameters() = default;
0062
0063 public:
0064
0065 const ActsPodioEdm::BoundParametersInfo& getData() const;
0066
0067
0068 void setData(const ActsPodioEdm::BoundParametersInfo& data);
0069
0070 ActsPodioEdm::BoundParametersInfo& getData();
0071
0072
0073 bool isAvailable() const;
0074
0075 void unlink() {
0076 m_obj = podio::utils::MaybeSharedPtr<BoundParametersObj>{nullptr};
0077 }
0078
0079 constexpr bool operator==(const MutableBoundParameters& other) const {
0080 return m_obj == other.m_obj;
0081 }
0082 bool operator==(const BoundParameters& other) const;
0083
0084 constexpr bool operator!=(const MutableBoundParameters& other) const {
0085 return !(*this == other);
0086 }
0087 bool operator!=(const BoundParameters& other) const {
0088 return !(*this == other);
0089 }
0090
0091
0092 bool operator<(const MutableBoundParameters& other) const {
0093 return podio::detail::getOrderKey(*this) <
0094 podio::detail::getOrderKey(other);
0095 }
0096
0097 podio::ObjectID id() const { return getObjectID(); }
0098
0099 const podio::ObjectID getObjectID() const;
0100
0101 friend std::hash<MutableBoundParameters>;
0102
0103 friend void swap(MutableBoundParameters& a, MutableBoundParameters& b) {
0104 using std::swap;
0105 swap(a.m_obj, b.m_obj);
0106 }
0107
0108 private:
0109
0110 explicit MutableBoundParameters(
0111 podio::utils::MaybeSharedPtr<BoundParametersObj> obj);
0112
0113 podio::utils::MaybeSharedPtr<BoundParametersObj> m_obj{
0114 new BoundParametersObj{}, podio::utils::MarkOwned};
0115 };
0116
0117 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0118 void to_json(nlohmann::json& j, const MutableBoundParameters& value);
0119 #endif
0120
0121 }
0122
0123 template <>
0124 struct std::hash<ActsPodioEdm::MutableBoundParameters> {
0125 std::size_t operator()(
0126 const ActsPodioEdm::MutableBoundParameters& obj) const {
0127 return std::hash<ActsPodioEdm::BoundParametersObj*>{}(obj.m_obj.get());
0128 }
0129 };
0130
0131 #endif