File indexing completed on 2023-03-17 10:49:24
0001 #ifndef DataFormats_Common_OrphanHandle_h
0002 #define DataFormats_Common_OrphanHandle_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "DataFormats/Common/interface/OrphanHandleBase.h"
0023
0024 namespace edm {
0025 template <typename T>
0026 class OrphanHandle : public OrphanHandleBase {
0027 public:
0028 typedef T element_type;
0029
0030
0031 OrphanHandle();
0032
0033 OrphanHandle(T const* prod, ProductID const& id);
0034
0035 ~OrphanHandle();
0036
0037 T const* product() const;
0038 T const* operator->() const;
0039 T const& operator*() const;
0040
0041 private:
0042 };
0043
0044 template <class T>
0045 OrphanHandle<T>::OrphanHandle() : OrphanHandleBase() {}
0046
0047 template <class T>
0048 OrphanHandle<T>::OrphanHandle(T const* prod, ProductID const& theId) : OrphanHandleBase(prod, theId) {}
0049
0050 template <class T>
0051 OrphanHandle<T>::~OrphanHandle() {}
0052
0053 template <class T>
0054 T const* OrphanHandle<T>::product() const {
0055 return static_cast<T const*>(productStorage());
0056 }
0057
0058 template <class T>
0059 T const* OrphanHandle<T>::operator->() const {
0060 return product();
0061 }
0062
0063 template <class T>
0064 T const& OrphanHandle<T>::operator*() const {
0065 return *product();
0066 }
0067
0068 }
0069 #endif