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_EventInfo_H
0004 #define PODIODATAMODEL_EventInfo_H
0005 
0006 #include "PodioDatamodel/EventInfoObj.h"
0007 
0008 
0009 #include "podio/utilities/MaybeSharedPtr.h"
0010 
0011 #include <ostream>
0012 #include <cstdint>
0013 
0014 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0015 #include "nlohmann/json_fwd.hpp"
0016 #endif
0017 
0018 
0019 
0020 
0021 class MutableEventInfo;
0022 class EventInfoCollection;
0023 class EventInfoCollectionData;
0024 
0025 /** @class EventInfo
0026  *  Event info
0027  *  @author: N. Brei
0028  */
0029 class EventInfo {
0030 
0031   friend class MutableEventInfo;
0032   friend class EventInfoCollection;
0033   friend class EventInfoCollectionData;
0034   friend class EventInfoCollectionIterator;
0035 
0036 public:
0037   using mutable_type = MutableEventInfo;
0038   using collection_type = EventInfoCollection;
0039 
0040   /// default constructor
0041   EventInfo();
0042 
0043   /// Constructor initializing all members
0044   EventInfo(int EventNumber, int TimesliceNumber, int RunNumber);
0045 
0046   /// copy constructor
0047   EventInfo(const EventInfo& other) = default;
0048 
0049   /// copy-assignment operator
0050   EventInfo& operator=(EventInfo other);
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   MutableEventInfo clone(bool cloneRelations=true) const;
0055 
0056   /// destructor
0057   ~EventInfo() = default;
0058 
0059   /// converting constructor from mutable object
0060   EventInfo(const MutableEventInfo& other);
0061 
0062   static EventInfo makeEmpty();
0063 
0064 public:
0065 
0066   /// Access the event number
0067   int EventNumber() const;
0068 
0069   /// Access the timeslice number
0070   int TimesliceNumber() const;
0071 
0072   /// Access the run number
0073   int RunNumber() const;
0074 
0075 
0076 
0077 
0078 
0079   /// check whether the object is actually available
0080   bool isAvailable() const;
0081   /// disconnect from EventInfoObj instance
0082   void unlink() { m_obj = podio::utils::MaybeSharedPtr<EventInfoObj>{nullptr}; }
0083 
0084   bool operator==(const EventInfo& other) const { return m_obj == other.m_obj; }
0085   bool operator==(const MutableEventInfo& other) const;
0086 
0087   bool operator!=(const EventInfo& other) const { return !(*this == other); }
0088   bool operator!=(const MutableEventInfo& other) const { return !(*this == other); }
0089 
0090   // less comparison operator, so that objects can be e.g. stored in sets.
0091   bool operator<(const EventInfo& other) const { return m_obj < other.m_obj; }
0092 
0093   podio::ObjectID id() const { return getObjectID(); }
0094 
0095   const podio::ObjectID getObjectID() const;
0096 
0097   friend void swap(EventInfo& a, EventInfo& b) {
0098     using std::swap;
0099     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0100   }
0101 
0102 private:
0103   /// constructor from existing EventInfoObj
0104   explicit EventInfo(podio::utils::MaybeSharedPtr<EventInfoObj> obj);
0105   EventInfo(EventInfoObj* obj);
0106 
0107   podio::utils::MaybeSharedPtr<EventInfoObj> m_obj{nullptr};
0108 };
0109 
0110 std::ostream& operator<<(std::ostream& o, const EventInfo& value);
0111 
0112 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0113 void to_json(nlohmann::json& j, const EventInfo& value);
0114 #endif
0115 
0116 
0117 
0118 
0119 #endif