Back to home page

EIC code displayed by LXR

 
 

    


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

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