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_MutableEventInfo_H
0004 #define PODIODATAMODEL_MutableEventInfo_H
0005 
0006 #include "PodioDatamodel/EventInfoObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "PodioDatamodel/EventInfo.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 MutableEventInfo
0024  *  Event info
0025  *  @author: N. Brei
0026  */
0027 class MutableEventInfo {
0028 
0029   friend class EventInfoCollection;
0030   friend class EventInfoMutableCollectionIterator;
0031   friend class EventInfo;
0032 
0033 public:
0034   using object_type = EventInfo;
0035   using collection_type = EventInfoCollection;
0036 
0037   /// default constructor
0038   MutableEventInfo();
0039 
0040   /// Constructor initializing all members
0041   MutableEventInfo(int EventNumber, int TimesliceNumber, int RunNumber);
0042 
0043   /// copy constructor
0044   MutableEventInfo(const MutableEventInfo& other) = default;
0045 
0046   /// copy-assignment operator
0047   MutableEventInfo& operator=(MutableEventInfo 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   MutableEventInfo clone(bool cloneRelations=true) const;
0052 
0053   /// destructor
0054   ~MutableEventInfo() = default;
0055 
0056 
0057 public:
0058 
0059   /// Access the event number
0060   int EventNumber() const;
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 event number
0071   void EventNumber(int value);
0072   /// Get mutable reference to event number
0073   int& EventNumber();
0074 
0075   /// Set the timeslice number
0076   void TimesliceNumber(int value);
0077   /// Get mutable reference to timeslice number
0078   int& TimesliceNumber();
0079 
0080   /// Set the run number
0081   void RunNumber(int value);
0082   /// Get mutable reference to run number
0083   int& RunNumber();
0084 
0085 
0086 
0087 
0088 
0089 
0090   /// check whether the object is actually available
0091   bool isAvailable() const;
0092   /// disconnect from EventInfoObj instance
0093   void unlink() { m_obj = podio::utils::MaybeSharedPtr<EventInfoObj>{nullptr}; }
0094 
0095   bool operator==(const MutableEventInfo& other) const { return m_obj == other.m_obj; }
0096   bool operator==(const EventInfo& other) const;
0097 
0098   bool operator!=(const MutableEventInfo& other) const { return !(*this == other); }
0099   bool operator!=(const EventInfo& other) const { return !(*this == other); }
0100 
0101   // less comparison operator, so that objects can be e.g. stored in sets.
0102   bool operator<(const MutableEventInfo& other) const { return m_obj < other.m_obj; }
0103 
0104   podio::ObjectID id() const { return getObjectID(); }
0105 
0106   const podio::ObjectID getObjectID() const;
0107 
0108   friend void swap(MutableEventInfo& a, MutableEventInfo& b) {
0109     using std::swap;
0110     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0111   }
0112 
0113 private:
0114   /// constructor from existing EventInfoObj
0115   explicit MutableEventInfo(podio::utils::MaybeSharedPtr<EventInfoObj> obj);
0116 
0117   podio::utils::MaybeSharedPtr<EventInfoObj> m_obj{nullptr};
0118 };
0119 
0120 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0121 void to_json(nlohmann::json& j, const MutableEventInfo& value);
0122 #endif
0123 
0124 
0125 
0126 
0127 #endif