Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:18:42

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 #include "podio/detail/OrderKey.h"
0011 
0012 #include <ostream>
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 EventInfoCollection;
0021 
0022 
0023 namespace podio::detail {
0024 // Internal function used in less comparison operators of the datatypes and interface types
0025 OrderKey getOrderKey(const ::EventInfo& obj);
0026 };
0027 
0028 
0029 class MutableEventInfo;
0030 class EventInfoCollection;
0031 class EventInfoCollectionData;
0032 
0033 /** @class EventInfo
0034  *  Event info
0035  *  @author: N. Brei
0036  */
0037 class EventInfo {
0038 
0039   friend class MutableEventInfo;
0040   friend class EventInfoCollection;
0041   friend class EventInfoCollectionData;
0042   friend class EventInfoCollectionIterator;
0043   friend podio::detail::OrderKey podio::detail::getOrderKey(const EventInfo & obj);
0044 
0045 public:
0046   using mutable_type = MutableEventInfo;
0047   using collection_type = EventInfoCollection;
0048 
0049   /// default constructor
0050   EventInfo();
0051 
0052   /// Constructor initializing all members
0053   EventInfo(const int EventNumber, const int TimesliceNumber, const int RunNumber);
0054 
0055   /// copy constructor
0056   EventInfo(const EventInfo& other) = default;
0057 
0058   /// copy-assignment operator
0059   EventInfo& operator=(EventInfo other) &; // Rebind this to other's internal object
0060   EventInfo& operator=(EventInfo other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0061 
0062   /// create a mutable deep-copy of the object with identical relations
0063   /// if cloneRelations=false, the relations are not cloned and will be empty
0064   MutableEventInfo clone(bool cloneRelations=true) const;
0065 
0066   /// destructor
0067   ~EventInfo() = default;
0068 
0069   /// converting constructor from mutable object
0070   EventInfo(const MutableEventInfo& other);
0071 
0072   static EventInfo makeEmpty();
0073 
0074 public:
0075 
0076   static constexpr std::string_view typeName = "EventInfo";
0077 
0078   /// Access the event number
0079   int EventNumber() const;
0080 
0081   /// Access the timeslice number
0082   int TimesliceNumber() const;
0083 
0084   /// Access the run number
0085   int RunNumber() const;
0086 
0087 
0088 
0089 
0090 
0091   /// check whether the object is actually available
0092   bool isAvailable() const;
0093   /// disconnect from EventInfoObj instance
0094   void unlink() { m_obj = podio::utils::MaybeSharedPtr<EventInfoObj>{nullptr}; }
0095 
0096   bool operator==(const EventInfo& other) const { return m_obj == other.m_obj; }
0097   bool operator==(const MutableEventInfo& other) const;
0098 
0099   bool operator!=(const EventInfo& other) const { return !(*this == other); }
0100   bool operator!=(const MutableEventInfo& other) const { return !(*this == other); }
0101 
0102   // less comparison operator, so that objects can be e.g. stored in sets.
0103   bool operator<(const EventInfo& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0104 
0105   podio::ObjectID id() const { return getObjectID(); }
0106 
0107   const podio::ObjectID getObjectID() const;
0108 
0109   friend std::hash<EventInfo>;
0110 
0111   friend void swap(EventInfo& a, EventInfo& b) {
0112     using std::swap;
0113     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0114   }
0115 
0116 private:
0117   /// constructor from existing EventInfoObj
0118   explicit EventInfo(podio::utils::MaybeSharedPtr<EventInfoObj> obj);
0119   EventInfo(EventInfoObj* obj);
0120 
0121   podio::utils::MaybeSharedPtr<EventInfoObj> m_obj{nullptr};
0122 };
0123 
0124 std::ostream& operator<<(std::ostream& o, const EventInfo& value);
0125 
0126 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0127 void to_json(nlohmann::json& j, const EventInfo& value);
0128 #endif
0129 
0130 
0131 
0132 
0133 
0134 template<>
0135 struct std::hash<EventInfo> {
0136   std::size_t operator()(const EventInfo& obj) const {
0137     return std::hash<EventInfoObj*>{}(obj.m_obj.get());
0138   }
0139 };
0140 
0141 
0142 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0143 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0144 // and https://github.com/AIDASoft/podio/issues/770
0145 #if defined(__clang__)
0146 #pragma clang diagnostic push
0147 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0148 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0149 #pragma clang diagnostic ignored "-Wdeprecated"
0150 constexpr std::string_view EventInfo::typeName;
0151 #pragma clang diagnostic pop
0152 #elif defined(__GNUC__)
0153 #pragma GCC diagnostic push
0154 #pragma GCC diagnostic ignored "-Wdeprecated"
0155 constexpr std::string_view EventInfo::typeName;
0156 #pragma GCC diagnostic pop
0157 #endif
0158 
0159 #endif