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);
64 std::vector<void const*>& pointers,
66 virtual void do_setPtr(std::type_info
const& iToType,
70 std::vector<unsigned long>
const& iIndices,
94 std::vector<void const*>& pointers,
102 std::vector<void const*>&,
107 "\ndoes not support Views\n");
111 template <
typename T>
114 std::vector<void const*>& pointers,
119 maybe_filler(
obj,
id, pointers, helpers);
123 template <
typename T>
126 std::type_info
const& iToType,
127 unsigned long iIndex,
128 void const*& oPtr)
const;
130 std::type_info
const& iToType,
131 std::vector<unsigned long>
const& iIndex,
132 std::vector<void const*>& oPtr)
const;
135 template <
typename T>
138 std::type_info
const& ,
140 void const*& )
const {
144 "\ndoes not support edm::Ptr\n");
147 std::type_info
const& ,
148 std::vector<unsigned long>
const& ,
149 std::vector<void const*>& )
const {
153 "\ndoes not support edm::PtrVector\n");
157 template <
typename T>
160 unsigned long iIndex,
161 void const*& oPtr)
const {
165 maybe_filler(this->
obj, iToType, iIndex, oPtr);
168 template <
typename T>
170 std::vector<unsigned long>
const& iIndices,
171 std::vector<void const*>& oPtr)
const {
175 maybe_filler(this->
obj, iToType, iIndices, oPtr);
183 template <
typename T>
188 template <
typename T>
194 template <
typename T>
199 template <
typename T>
204 template <
typename T>
209 template <
typename T>
214 template <
typename T>
219 template <
typename T>
224 template <
typename T>
229 template <
typename T>
253 sizeof(has_swap_helper<T>(0)) ==
sizeof(
yes_tag);
264 sizeof(has_mergeProduct_helper<T>(0)) ==
sizeof(
yes_tag);
274 sizeof(has_isProductEqual_helper<T>(0)) ==
sizeof(
yes_tag);
280 template <
typename T>
283 present(ptr.
get() != 0),
291 swap_or_assign(
obj, *ptr);
295 template <
typename T>
300 std::unique_ptr<T>
temp(ptr);
307 swap_or_assign(
obj, *ptr);
314 template <
typename T>
319 return is_mergeable(
obj);
322 template <
typename T>
325 assert(wrappedNewProduct !=
nullptr);
329 return merge_product(
obj, wrappedNewProduct->obj);
332 template <
typename T>
337 return has_is_equal(
obj);
340 template <
typename T>
343 assert(wrappedNewProduct !=
nullptr);
347 return is_equal(
obj, wrappedNewProduct->obj);
361 std::vector<void const*>& pointers,
371 fillView(obj,
id, pointers, * helpers);
372 assert(pointers.size() == helpers->size());
380 std::vector<void const*>& pointers,
384 pointers.reserve(h->size());
396 std::vector<void const*>& pointers,
400 pointers.reserve(obj.
size());
411 std::type_info
const& iToType,
412 unsigned long iIndex,
418 setPtr(obj, iToType, iIndex, oPtr);
422 std::type_info
const& iToType,
423 std::vector<unsigned long>
const& iIndex,
424 std::vector<void const*>& oPtr) {
435 template <
typename T>
438 std::vector<void const*>& pointers,
444 template <
typename T>
446 std::type_info
const& iToType,
447 unsigned long iIndex,
448 void const*& oPtr)
const {
452 template <
typename T>
454 std::type_info
const& iToType,
455 std::vector<unsigned long>
const& iIndices,
456 std::vector<void const*>& oPtr)
const {
void operator()(T &a, T &b)
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)
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 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
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
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
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
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
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 &)