File indexing completed on 2025-07-15 08:59:01
0001
0002
0003 #ifndef PODIODATAMODEL_ExampleCluster_H
0004 #define PODIODATAMODEL_ExampleCluster_H
0005
0006 #include "PodioDatamodel/ExampleClusterObj.h"
0007
0008 #include "PodioDatamodel/ExampleHit.h"
0009 #include "podio/RelationRange.h"
0010 #include <vector>
0011
0012 #include "podio/utilities/MaybeSharedPtr.h"
0013 #include "podio/detail/OrderKey.h"
0014
0015 #include <ostream>
0016 #include <cstdint>
0017
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021
0022
0023 class ExampleClusterCollection;
0024
0025
0026 namespace podio::detail {
0027
0028 OrderKey getOrderKey(const ::ExampleCluster& obj);
0029 };
0030
0031
0032 class MutableExampleCluster;
0033 class ExampleClusterCollection;
0034 class ExampleClusterCollectionData;
0035
0036
0037
0038
0039
0040 class ExampleCluster {
0041
0042 friend class MutableExampleCluster;
0043 friend class ExampleClusterCollection;
0044 friend class ExampleClusterCollectionData;
0045 friend class ExampleClusterCollectionIterator;
0046 friend podio::detail::OrderKey podio::detail::getOrderKey(const ExampleCluster & obj);
0047
0048 public:
0049 using mutable_type = MutableExampleCluster;
0050 using collection_type = ExampleClusterCollection;
0051
0052
0053 ExampleCluster();
0054
0055
0056 ExampleCluster(double energy);
0057
0058
0059 ExampleCluster(const ExampleCluster& other) = default;
0060
0061
0062 ExampleCluster& operator=(ExampleCluster other);
0063
0064
0065
0066 MutableExampleCluster clone(bool cloneRelations=true) const;
0067
0068
0069 ~ExampleCluster() = default;
0070
0071
0072 ExampleCluster(const MutableExampleCluster& other);
0073
0074 static ExampleCluster makeEmpty();
0075
0076 public:
0077
0078 static constexpr auto typeName = "ExampleCluster";
0079
0080
0081 double energy() const;
0082
0083
0084
0085 std::size_t Hits_size() const;
0086 ExampleHit Hits(std::size_t) const;
0087 std::vector<ExampleHit>::const_iterator Hits_begin() const;
0088 std::vector<ExampleHit>::const_iterator Hits_end() const;
0089 podio::RelationRange<ExampleHit> Hits() const;
0090 std::size_t Clusters_size() const;
0091 ExampleCluster Clusters(std::size_t) const;
0092 std::vector<ExampleCluster>::const_iterator Clusters_begin() const;
0093 std::vector<ExampleCluster>::const_iterator Clusters_end() const;
0094 podio::RelationRange<ExampleCluster> Clusters() const;
0095
0096
0097
0098 bool isAvailable() const;
0099
0100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ExampleClusterObj>{nullptr}; }
0101
0102 bool operator==(const ExampleCluster& other) const { return m_obj == other.m_obj; }
0103 bool operator==(const MutableExampleCluster& other) const;
0104
0105 bool operator!=(const ExampleCluster& other) const { return !(*this == other); }
0106 bool operator!=(const MutableExampleCluster& other) const { return !(*this == other); }
0107
0108
0109 bool operator<(const ExampleCluster& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0110
0111 podio::ObjectID id() const { return getObjectID(); }
0112
0113 const podio::ObjectID getObjectID() const;
0114
0115 friend void swap(ExampleCluster& a, ExampleCluster& b) {
0116 using std::swap;
0117 swap(a.m_obj, b.m_obj);
0118 }
0119
0120 private:
0121
0122 explicit ExampleCluster(podio::utils::MaybeSharedPtr<ExampleClusterObj> obj);
0123 ExampleCluster(ExampleClusterObj* obj);
0124
0125 podio::utils::MaybeSharedPtr<ExampleClusterObj> m_obj{nullptr};
0126 };
0127
0128 std::ostream& operator<<(std::ostream& o, const ExampleCluster& value);
0129
0130 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0131 void to_json(nlohmann::json& j, const ExampleCluster& value);
0132 #endif
0133
0134
0135
0136
0137 #endif