Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/JANA/examples/PodioDatamodel/MutableTimesliceInfo.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_MutableTimesliceInfo_H
0004 #define PODIODATAMODEL_MutableTimesliceInfo_H
0005 
0006 #include "PodioDatamodel/TimesliceInfoObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "PodioDatamodel/TimesliceInfo.h"
0009 
0010 
0011 #include "podio/utilities/MaybeSharedPtr.h"
0012 
0013 #include <cstdint>
0014 
0015 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0016 #include "nlohmann/json_fwd.hpp"
0017 #endif
0018 
0019 // forward declarations
0020 class TimesliceInfoCollection;
0021 
0022 
0023 
0024 
0025 /** @class MutableTimesliceInfo
0026  *  Timeslice info
0027  *  @author: N. Brei
0028  */
0029 class MutableTimesliceInfo {
0030 
0031   friend class TimesliceInfoCollection;
0032   friend class TimesliceInfoMutableCollectionIterator;
0033   friend class TimesliceInfo;
0034 
0035 public:
0036   using object_type = TimesliceInfo;
0037   using collection_type = TimesliceInfoCollection;
0038 
0039   /// default constructor
0040   MutableTimesliceInfo();
0041 
0042   /// Constructor initializing all members
0043   MutableTimesliceInfo(const int TimesliceNumber, const int RunNumber);
0044 
0045   /// copy constructor
0046   MutableTimesliceInfo(const MutableTimesliceInfo& other) = default;
0047 
0048   /// copy-assignment operator
0049   MutableTimesliceInfo& operator=(MutableTimesliceInfo other) &; // Rebind this to other's internal object
0050   MutableTimesliceInfo& operator=(MutableTimesliceInfo other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
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   MutableTimesliceInfo clone(bool cloneRelations=true) const;
0055 
0056   /// destructor
0057   ~MutableTimesliceInfo() = default;
0058 
0059 
0060 public:
0061 
0062   /// Access the timeslice number
0063   int TimesliceNumber() const;
0064 
0065   /// Access the run number
0066   int RunNumber() const;
0067 
0068 
0069 
0070   /// Set the timeslice number
0071   void TimesliceNumber(const int TimesliceNumber);
0072   /// Get mutable reference to timeslice number
0073   int& TimesliceNumber();
0074 
0075   /// Set the run number
0076   void RunNumber(const int RunNumber);
0077   /// Get mutable reference to run number
0078   int& RunNumber();
0079 
0080 
0081 
0082 
0083 
0084 
0085   /// check whether the object is actually available
0086   bool isAvailable() const;
0087   /// disconnect from TimesliceInfoObj instance
0088   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TimesliceInfoObj>{nullptr}; }
0089 
0090   bool operator==(const MutableTimesliceInfo& other) const { return m_obj == other.m_obj; }
0091   bool operator==(const TimesliceInfo& other) const;
0092 
0093   bool operator!=(const MutableTimesliceInfo& other) const { return !(*this == other); }
0094   bool operator!=(const TimesliceInfo& other) const { return !(*this == other); }
0095 
0096   // less comparison operator, so that objects can be e.g. stored in sets.
0097   bool operator<(const MutableTimesliceInfo& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0098 
0099   podio::ObjectID id() const { return getObjectID(); }
0100 
0101   const podio::ObjectID getObjectID() const;
0102 
0103   friend std::hash<MutableTimesliceInfo>;
0104 
0105   friend void swap(MutableTimesliceInfo& a, MutableTimesliceInfo& b) {
0106     using std::swap;
0107     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0108   }
0109 
0110 private:
0111   /// constructor from existing TimesliceInfoObj
0112   explicit MutableTimesliceInfo(podio::utils::MaybeSharedPtr<TimesliceInfoObj> obj);
0113 
0114   podio::utils::MaybeSharedPtr<TimesliceInfoObj> m_obj{nullptr};
0115 };
0116 
0117 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0118 void to_json(nlohmann::json& j, const MutableTimesliceInfo& value);
0119 #endif
0120 
0121 
0122 
0123 
0124 
0125 template<>
0126 struct std::hash<MutableTimesliceInfo> {
0127   std::size_t operator()(const MutableTimesliceInfo& obj) const {
0128     return std::hash<TimesliceInfoObj*>{}(obj.m_obj.get());
0129   }
0130 };
0131 
0132 
0133 #endif