1 #ifndef DataFormats_Common_Wrapper_h
2 #define DataFormats_Common_Wrapper_h
20 #include "boost/mpl/if.hpp"
29 class Wrapper :
public WrapperBase {
35 explicit Wrapper(std::unique_ptr<T> ptr);
66 std::vector<void const*>& pointers,
68 virtual void do_setPtr(std::type_info
const& iToType,
72 std::vector<unsigned long>
const& iIndices,
96 std::vector<void const*>& pointers,
100 template <
typename T>
104 std::vector<void const*>&,
109 "\ndoes not support Views\n");
113 template <
typename T>
116 std::vector<void const*>& pointers,
121 maybe_filler(
obj,
id, pointers, helpers);
125 template <
typename T>
128 std::type_info
const& iToType,
129 unsigned long iIndex,
130 void const*& oPtr)
const;
132 std::type_info
const& iToType,
133 std::vector<unsigned long>
const& iIndex,
134 std::vector<void const*>& oPtr)
const;
137 template <
typename T>
140 std::type_info
const& ,
142 void const*& )
const {
146 "\ndoes not support edm::Ptr\n");
149 std::type_info
const& ,
150 std::vector<unsigned long>
const& ,
151 std::vector<void const*>& )
const {
155 "\ndoes not support edm::PtrVector\n");
159 template <
typename T>
162 unsigned long iIndex,
163 void const*& oPtr)
const {
167 maybe_filler(this->
obj, iToType, iIndex, oPtr);
170 template <
typename T>
172 std::vector<unsigned long>
const& iIndices,
173 std::vector<void const*>& oPtr)
const {
177 maybe_filler(this->
obj, iToType, iIndices, oPtr);
185 template <
typename T>
190 template <
typename T>
196 template <
typename T>
201 template <
typename T>
206 template <
typename T>
211 template <
typename T>
216 template <
typename T>
221 template <
typename T>
226 template <
typename T>
231 template <
typename T>
255 sizeof(has_swap_helper<T>(0)) ==
sizeof(
yes_tag);
263 static const bool value =
sizeof(has_value_type<T>(
nullptr)) ==
sizeof(
yes_tag);
280 static const bool value =
sizeof(has_member_type<T>(
nullptr)) ==
sizeof(
yes_tag);
285 return typeid(
typename T::member_type);
301 sizeof(has_mergeProduct_helper<T>(0)) ==
sizeof(
yes_tag);
311 sizeof(has_isProductEqual_helper<T>(0)) ==
sizeof(
yes_tag);
317 template <
typename T>
320 present(ptr.
get() != 0),
328 swap_or_assign(
obj, *ptr);
332 template <
typename T>
337 std::unique_ptr<T>
temp(ptr);
344 swap_or_assign(
obj, *ptr);
351 template <
typename T>
356 template <
typename T>
363 template <
typename T>
368 return is_mergeable(
obj);
371 template <
typename T>
374 assert(wrappedNewProduct !=
nullptr);
378 return merge_product(
obj, wrappedNewProduct->obj);
381 template <
typename T>
386 return has_is_equal(
obj);
389 template <
typename T>
392 assert(wrappedNewProduct !=
nullptr);
396 return is_equal(
obj, wrappedNewProduct->obj);
410 std::vector<void const*>& pointers,
420 fillView(obj,
id, pointers, * helpers);
421 assert(pointers.size() == helpers->size());
429 std::vector<void const*>& pointers,
433 pointers.reserve(h->size());
445 std::vector<void const*>& pointers,
449 pointers.reserve(obj.
size());
460 std::type_info
const& iToType,
461 unsigned long iIndex,
467 setPtr(obj, iToType, iIndex, oPtr);
471 std::type_info
const& iToType,
472 std::vector<unsigned long>
const& iIndex,
473 std::vector<void const*>& oPtr) {
484 template <
typename T>
487 std::vector<void const*>& pointers,
493 template <
typename T>
495 std::type_info
const& iToType,
496 unsigned long iIndex,
497 void const*& oPtr)
const {
501 template <
typename T>
503 std::type_info
const& iToType,
504 std::vector<unsigned long>
const& iIndices,
505 std::vector<void const*>& oPtr)
const {
void operator()(T &a, T &b)
virtual std::type_info const & valueTypeInfo_() const
static void fill(PtrVector< T > const &obj, ProductID const &, std::vector< void const * > &pointers, helper_vector_ptr &helpers)
T const * operator->() const
size_type size() const
Size of the RefVector.
void fillView(AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper > const &obj, ProductID const &id, std::vector< void const * > &pointers, helper_vector &helpers)
static void set(T const &obj, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr)
std::type_info const & operator()()
void fillPtrVector(std::vector< T, A > const &obj, std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr)
virtual std::type_info const & memberTypeInfo_() const
virtual bool isProductEqual_(WrapperBase const *newProduct) const
virtual bool isMergeable_() const
static std::type_info const & productTypeInfo()
#define CMS_CLASS_VERSION(_version_)
virtual bool mergeProduct_(WrapperBase const *newProduct)
virtual bool hasIsProductEqual_() const
void operator()(T const &, ProductID const &, std::vector< void const * > &, helper_vector_ptr &) const
void setPtr(std::vector< T, A > const &obj, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr)
bool operator()(T const &) const
std::type_info const & operator()()
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
static void fill(T const &obj, std::type_info const &iToType, std::vector< unsigned long > const &iIndex, std::vector< void const * > &oPtr)
virtual std::type_info const & dynamicTypeInfo_() const
no_tag has_isProductEqual_helper(...)
void operator()(T &a, T &b)
virtual bool isPresent_() const
virtual void do_fillView(ProductID const &id, std::vector< void const * > &pointers, helper_vector_ptr &helpers) const
bool operator()(T const &) const
static void fill(RefToBaseVector< T > const &obj, ProductID const &, std::vector< void const * > &pointers, helper_vector_ptr &helpers)
std::auto_ptr< reftobase::RefVectorHolderBase > vectorHolder() const
std::type_info const & operator()()
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static void fill(T const &obj, ProductID const &id, std::vector< void const * > &pointers, helper_vector_ptr &helpers)
no_tag has_swap_helper(...)
bool operator()(T const &) const
Container::value_type value_type
std::shared_ptr< reftobase::RefVectorHolderBase > helper_vector_ptr
T const * product() const
bool operator()(T &a, T const &b)
virtual std::type_info const & wrappedTypeInfo_() const
virtual void do_fillPtrVector(std::type_info const &iToType, std::vector< unsigned long > const &iIndices, std::vector< void const * > &oPtr) const
static yes_tag & has_member_type(typename T::member_type *)
void operator()(T const &obj, ProductID const &id, std::vector< void const * > &pointers, helper_vector_ptr &helpers) const
void operator()(T const &, std::type_info const &, std::vector< unsigned long > const &, std::vector< void const * > &) const
void operator()(T const &, std::type_info const &, unsigned long, void const *&) const
void operator()(T const &obj, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const
std::type_info const & operator()()
static yes_tag & has_value_type(typename T::value_type *)
volatile std::atomic< bool > shutdown_flag false
bool operator()(T const &) const
bool operator()(T const &, T const &) const
virtual void do_setPtr(std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const
Wrapper< T > & operator=(Wrapper< T > const &)
T get(const Candidate &c)
no_tag has_mergeProduct_helper(...)
bool operator()(T const &a, T const &b) const
static std::type_info const & typeInfo()
bool operator()(T &, T const &)