Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:27

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