Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 08:41:10

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(int TimesliceNumber, int RunNumber);
0044 
0045   /// copy constructor
0046   MutableTimesliceInfo(const MutableTimesliceInfo& other) = default;
0047 
0048   /// copy-assignment operator
0049   MutableTimesliceInfo& operator=(MutableTimesliceInfo other);
0050 
0051   /// create a mutable deep-copy of the object with identical relations
0052   /// if cloneRelations=false, the relations are not cloned and will be empty
0053   MutableTimesliceInfo clone(bool cloneRelations=true) const;
0054 
0055   /// destructor
0056   ~MutableTimesliceInfo() = default;
0057 
0058 
0059 public:
0060 
0061   /// Access the timeslice number
0062   int TimesliceNumber() const;
0063 
0064   /// Access the run number
0065   int RunNumber() const;
0066 
0067 
0068 
0069   /// Set the timeslice number
0070   void TimesliceNumber(int value);
0071   /// Get mutable reference to timeslice number
0072   int& TimesliceNumber();
0073 
0074   /// Set the run number
0075   void RunNumber(int value);
0076   /// Get mutable reference to run number
0077   int& RunNumber();
0078 
0079 
0080 
0081 
0082 
0083 
0084   /// check whether the object is actually available
0085   bool isAvailable() const;
0086   /// disconnect from TimesliceInfoObj instance
0087   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TimesliceInfoObj>{nullptr}; }
0088 
0089   bool operator==(const MutableTimesliceInfo& other) const { return m_obj == other.m_obj; }
0090   bool operator==(const TimesliceInfo& other) const;
0091 
0092   bool operator!=(const MutableTimesliceInfo& other) const { return !(*this == other); }
0093   bool operator!=(const TimesliceInfo& other) const { return !(*this == other); }
0094 
0095   // less comparison operator, so that objects can be e.g. stored in sets.
0096   bool operator<(const MutableTimesliceInfo& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0097 
0098   podio::ObjectID id() const { return getObjectID(); }
0099 
0100   const podio::ObjectID getObjectID() const;
0101 
0102   friend void swap(MutableTimesliceInfo& a, MutableTimesliceInfo& b) {
0103     using std::swap;
0104     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0105   }
0106 
0107 private:
0108   /// constructor from existing TimesliceInfoObj
0109   explicit MutableTimesliceInfo(podio::utils::MaybeSharedPtr<TimesliceInfoObj> obj);
0110 
0111   podio::utils::MaybeSharedPtr<TimesliceInfoObj> m_obj{nullptr};
0112 };
0113 
0114 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0115 void to_json(nlohmann::json& j, const MutableTimesliceInfo& value);
0116 #endif
0117 
0118 
0119 
0120 
0121 #endif