Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 08:35:35

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef PODIODATAMODEL_MutableExampleCluster_H
0004 #define PODIODATAMODEL_MutableExampleCluster_H
0005 
0006 #include "PodioDatamodel/ExampleClusterObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "PodioDatamodel/ExampleCluster.h"
0009 
0010 #include "PodioDatamodel/ExampleHit.h"
0011 #include "podio/RelationRange.h"
0012 #include <vector>
0013 
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
0016 #include <cstdint>
0017 
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021 
0022 // forward declarations
0023 class ExampleClusterCollection;
0024 
0025 
0026 
0027 
0028 /** @class MutableExampleCluster
0029  *  Cluster
0030  *  @author: B. Hegner
0031  */
0032 class MutableExampleCluster {
0033 
0034   friend class ExampleClusterCollection;
0035   friend class ExampleClusterMutableCollectionIterator;
0036   friend class ExampleCluster;
0037 
0038 public:
0039   using object_type = ExampleCluster;
0040   using collection_type = ExampleClusterCollection;
0041 
0042   /// default constructor
0043   MutableExampleCluster();
0044 
0045   /// Constructor initializing all members
0046   MutableExampleCluster(double energy);
0047 
0048   /// copy constructor
0049   MutableExampleCluster(const MutableExampleCluster& other) = default;
0050 
0051   /// copy-assignment operator
0052   MutableExampleCluster& operator=(MutableExampleCluster other);
0053 
0054   /// create a mutable deep-copy of the object with identical relations
0055   /// if cloneRelations=false, the relations are not cloned and will be empty
0056   MutableExampleCluster clone(bool cloneRelations=true) const;
0057 
0058   /// destructor
0059   ~MutableExampleCluster() = default;
0060 
0061 
0062 public:
0063 
0064   /// Access the cluster energy
0065   double energy() const;
0066 
0067 
0068 
0069   /// Set the cluster energy
0070   void energy(double value);
0071   /// Get mutable reference to cluster energy
0072   double& energy();
0073 
0074 
0075 
0076   void addHits(const ExampleHit&);
0077   std::size_t Hits_size() const;
0078   ExampleHit Hits(std::size_t) const;
0079   std::vector<ExampleHit>::const_iterator Hits_begin() const;
0080   std::vector<ExampleHit>::const_iterator Hits_end() const;
0081   podio::RelationRange<ExampleHit> Hits() const;
0082   void addClusters(const ExampleCluster&);
0083   std::size_t Clusters_size() const;
0084   ExampleCluster Clusters(std::size_t) const;
0085   std::vector<ExampleCluster>::const_iterator Clusters_begin() const;
0086   std::vector<ExampleCluster>::const_iterator Clusters_end() const;
0087   podio::RelationRange<ExampleCluster> Clusters() const;
0088 
0089 
0090 
0091   /// check whether the object is actually available
0092   bool isAvailable() const;
0093   /// disconnect from ExampleClusterObj instance
0094   void unlink() { m_obj = podio::utils::MaybeSharedPtr<ExampleClusterObj>{nullptr}; }
0095 
0096   bool operator==(const MutableExampleCluster& other) const { return m_obj == other.m_obj; }
0097   bool operator==(const ExampleCluster& other) const;
0098 
0099   bool operator!=(const MutableExampleCluster& other) const { return !(*this == other); }
0100   bool operator!=(const ExampleCluster& other) const { return !(*this == other); }
0101 
0102   // less comparison operator, so that objects can be e.g. stored in sets.
0103   bool operator<(const MutableExampleCluster& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0104 
0105   podio::ObjectID id() const { return getObjectID(); }
0106 
0107   const podio::ObjectID getObjectID() const;
0108 
0109   friend void swap(MutableExampleCluster& a, MutableExampleCluster& b) {
0110     using std::swap;
0111     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0112   }
0113 
0114 private:
0115   /// constructor from existing ExampleClusterObj
0116   explicit MutableExampleCluster(podio::utils::MaybeSharedPtr<ExampleClusterObj> obj);
0117 
0118   podio::utils::MaybeSharedPtr<ExampleClusterObj> m_obj{nullptr};
0119 };
0120 
0121 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0122 void to_json(nlohmann::json& j, const MutableExampleCluster& value);
0123 #endif
0124 
0125 
0126 
0127 
0128 #endif