Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/JANA/examples/PodioDatamodel/TimesliceInfo.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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