Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/JANA/examples/PodioDatamodel/MutableExampleCluster.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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(const double energy);
0047 
0048   /// copy constructor
0049   MutableExampleCluster(const MutableExampleCluster& other) = default;
0050 
0051   /// copy-assignment operator
0052   MutableExampleCluster& operator=(MutableExampleCluster other) &; // Rebind this to other's internal object
0053   MutableExampleCluster& operator=(MutableExampleCluster other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0054 
0055   /// create a mutable deep-copy of the object with identical relations
0056   /// if cloneRelations=false, the relations are not cloned and will be empty
0057   MutableExampleCluster clone(bool cloneRelations=true) const;
0058 
0059   /// destructor
0060   ~MutableExampleCluster() = default;
0061 
0062 
0063 public:
0064 
0065   /// Access the cluster energy
0066   double energy() const;
0067 
0068 
0069 
0070   /// Set the cluster energy
0071   void energy(const double energy);
0072   /// Get mutable reference to cluster energy
0073   double& energy();
0074 
0075 
0076 
0077   void addHits(const ExampleHit&);
0078   std::size_t Hits_size() const;
0079   ExampleHit Hits(std::size_t) const;
0080   std::vector<ExampleHit>::const_iterator Hits_begin() const;
0081   std::vector<ExampleHit>::const_iterator Hits_end() const;
0082   podio::RelationRange<ExampleHit> Hits() const;
0083   void addClusters(const ExampleCluster&);
0084   std::size_t Clusters_size() const;
0085   ExampleCluster Clusters(std::size_t) const;
0086   std::vector<ExampleCluster>::const_iterator Clusters_begin() const;
0087   std::vector<ExampleCluster>::const_iterator Clusters_end() const;
0088   podio::RelationRange<ExampleCluster> Clusters() const;
0089 
0090 
0091 
0092   /// check whether the object is actually available
0093   bool isAvailable() const;
0094   /// disconnect from ExampleClusterObj instance
0095   void unlink() { m_obj = podio::utils::MaybeSharedPtr<ExampleClusterObj>{nullptr}; }
0096 
0097   bool operator==(const MutableExampleCluster& other) const { return m_obj == other.m_obj; }
0098   bool operator==(const ExampleCluster& other) const;
0099 
0100   bool operator!=(const MutableExampleCluster& other) const { return !(*this == other); }
0101   bool operator!=(const ExampleCluster& other) const { return !(*this == other); }
0102 
0103   // less comparison operator, so that objects can be e.g. stored in sets.
0104   bool operator<(const MutableExampleCluster& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0105 
0106   podio::ObjectID id() const { return getObjectID(); }
0107 
0108   const podio::ObjectID getObjectID() const;
0109 
0110   friend std::hash<MutableExampleCluster>;
0111 
0112   friend void swap(MutableExampleCluster& a, MutableExampleCluster& b) {
0113     using std::swap;
0114     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0115   }
0116 
0117 private:
0118   /// constructor from existing ExampleClusterObj
0119   explicit MutableExampleCluster(podio::utils::MaybeSharedPtr<ExampleClusterObj> obj);
0120 
0121   podio::utils::MaybeSharedPtr<ExampleClusterObj> m_obj{nullptr};
0122 };
0123 
0124 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0125 void to_json(nlohmann::json& j, const MutableExampleCluster& value);
0126 #endif
0127 
0128 
0129 
0130 
0131 
0132 template<>
0133 struct std::hash<MutableExampleCluster> {
0134   std::size_t operator()(const MutableExampleCluster& obj) const {
0135     return std::hash<ExampleClusterObj*>{}(obj.m_obj.get());
0136   }
0137 };
0138 
0139 
0140 #endif