1 #ifndef DataFormats_Common_RefToBase_h 2 #define DataFormats_Common_RefToBase_h 47 #include <type_traits> 60 template <
typename C,
typename T,
typename F>
79 template <
typename C1,
typename T1,
typename F1>
85 template <
typename T1>
88 RefToBase(std::shared_ptr<reftobase::RefHolderBase>
p);
104 requires std::is_same_v<T, typename REF::value_type>
or std::is_base_of_v<T, typename REF::value_type>
or 105 std::is_base_of_v<typename REF::value_type, T>;
118 std::unique_ptr<reftobase::RefHolderBase>
holder()
const;
153 other.holder_ =
nullptr;
159 holder_ =
other.holder_;
160 other.holder_ =
nullptr;
165 template <
typename C1,
typename T1,
typename F1>
167 : holder_(new reftobase::Holder<
T,
Ref<C1, T1, F1>>(iRef)) {}
170 template <
typename C>
174 template <
typename T1>
177 new reftobase::IndirectHolder<
T>(
std::shared_ptr<
edm::reftobase::RefHolderBase>(iRef.holder().
release()))) {
191 : holder_(new reftobase::IndirectHolder<
T>(
p)) {}
207 return *getPtrImpl();
222 return holder_ ? holder_->id() :
ProductID();
227 if (holder_ ==
nullptr) {
229 "attempting get key from null RefToBase;\n" 230 "You should check for nullity before calling key().");
233 return holder_->key();
240 requires std::is_same_v<T, typename REF::value_type>
or std::is_base_of_v<T, typename REF::value_type>
or 241 std::is_base_of_v<typename REF::value_type, T>;
246 "attempting to cast a null RefToBase;\n" 247 "You should check for nullity before casting.");
256 return REF(
id(),
key(), getter);
260 if (
value ==
nullptr) {
264 if constexpr (std::is_same_v<T, typename REF::value_type>
or std::is_base_of_v<typename REF::value_type, T>) {
270 return REF(
id(), newValue,
key(), isTransient());
274 "RefToBase<T>::castTo Error attempting to cast mismatched types\n" 275 "casting from RefToBase with T: ",
285 return !
id().isValid();
302 return holder_ ? holder_->isEqualTo(*rhs.
holder_) : holder_ == rhs.
holder_;
307 return !(*
this == rhs);
317 return holder_ ? holder_->productGetter() :
nullptr;
322 return holder_ ? holder_->getPtr() :
nullptr;
327 return holder_ ? holder_->
holder() : std::unique_ptr<reftobase::RefHolderBase>();
346 template <
typename T>
RefToBase & operator=(RefToBase &&other) noexcept
Basic3DVector & operator=(const Basic3DVector &)=default
Assignment operator.
edm::Ref< Container > Ref
std::unique_ptr< reftobase::RefHolderBase > holder() const
void swap(RefToBase< T > &a, RefToBase< T > &b)
virtual bool isTransient() const =0
bool isNonnull() const
Checks for non-null.
virtual bool isAvailable() const =0
#define CMS_CLASS_VERSION(_version_)
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
void swap(RefToBase &other)
Container::value_type value_type
bool operator!=(RefToBase const &rhs) const
reftobase::BaseHolder< value_type > * holder_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
EDProductGetter const * productGetter() const
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
value_type const * getPtrImpl() const
key
prepare the HTCondor submission files and eventually submit them
def template(fileName, svg, replaceme="REPLACEME")
bool isNull() const
Checks for null.
bool operator!=(DTCELinkId const &lhs, DTCELinkId const &rhs)
bool operator==(RefToBase const &rhs) const
edm::RefProd< Container > RefProd
T castTo(const char *arg)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
bool operator!() const
Checks for null.
EDProductGetter const * productGetter(std::atomic< void const *> const &iCache)
MatrixMeschach operator*(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
value_type const * get() const