1 #ifndef DataFormats_Common_RefToBase_h 2 #define DataFormats_Common_RefToBase_h 47 #include <type_traits> 59 template<
typename C,
typename T,
typename F>
class Ref;
60 template<
typename C>
class RefProd;
62 template<
typename T>
class View;
75 template <typename C1, typename T1, typename F1>
83 RefToBase(
std::unique_ptr<reftobase::BaseHolder<value_type>>);
91 value_type const*
operator->() const;
92 value_type const*
get() const;
108 std::unique_ptr<reftobase::RefHolderBase>
holder() const;
134 RefToBase<T>::RefToBase() :
157 template <
typename C1,
typename T1,
typename F1>
160 holder_(new reftobase::Holder<
T,
Ref<C1, T1, F1> >(iRef))
164 template <
typename C>
171 template <
typename T1>
174 holder_(new reftobase::IndirectHolder<
T> (
195 holder_(new reftobase::IndirectHolder<
T>(p))
255 "attempting get key from null RefToBase;\n" 256 "You should check for nullity before calling key().");
265 template<
typename T,
typename U>
269 "RefToBase::castTo error element types are not related by inheritance"); }
271 template<
typename T,
typename U>
274 "RefToBase::castTo error non-class element types are not the same"); }
277 template<
typename T,
typename OUT>
279 convertTo(
T const*
t) {
return dynamic_cast<OUT const*
>(
t); }
281 template<
typename T,
typename OUT>
283 convertTo(
T const* t) {
return t;}
293 "attempting to cast a null RefToBase;\n" 294 "You should check for nullity before casting.");
297 checkTypeCompatibility<T, typename REF::value_type>();
305 return REF(
id(),
key(), getter);
309 if(value ==
nullptr) {
318 "RefToBase<T>::castTo Error attempting to cast mismatched types\n" 319 "casting from RefToBase with T: ",
369 return !(*
this == rhs);
value_type const * get() const
edm::Ref< Container > Ref
virtual std::unique_ptr< RefHolderBase > holder() const =0
virtual EDProductGetter const * productGetter() const =0
virtual bool isTransient() const =0
bool isNonnull() const
Checks for non-null.
virtual T const * getPtr() const =0
virtual bool isAvailable() const =0
#define CMS_CLASS_VERSION(_version_)
bool operator==(RefToBase const &rhs) const
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
void swap(RefToBase &other)
virtual ProductID id() const =0
Container::value_type value_type
reftobase::BaseHolder< value_type > * holder_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
value_type const * operator->() const
def template(fileName, svg, replaceme="REPLACEME")
virtual size_t key() const =0
static const std::string B
bool operator!=(RefToBase const &rhs) const
edm::RefProd< Container > RefProd
bool isNull() const
Checks for null.
value_type const * getPtrImpl() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
EDProductGetter const * productGetter() const
bool operator!() const
Checks for null.
RefToBase & operator=(RefToBase &&other)
value_type const & operator*() const
virtual bool isEqualTo(BaseHolder< T > const &rhs) const =0
std::unique_ptr< reftobase::RefHolderBase > holder() const