1 #ifndef DataFormats_Common_RefVectorHolderBase_h 2 #define DataFormats_Common_RefVectorHolderBase_h 18 virtual bool empty()
const = 0;
19 virtual size_type
size()
const = 0;
20 virtual void clear() = 0;
21 virtual void reserve(size_type
n) = 0;
37 virtual void increase(difference_type
d) = 0;
38 virtual void decrease(difference_type d) = 0;
42 virtual std::shared_ptr<RefHolderBase>
deref()
const = 0;
46 struct const_iterator :
public std::iterator <std::random_access_iterator_tag, void*>{
54 if(isInvalid())
i = it.
i;
61 "Trying to increment an inavlid RefToBaseVector<T>::const_iterator\n");
68 "Trying to postincrement an inavlid RefToBaseVector<T>::const_iterator\n");
76 "Trying to decrement an inavlid RefToBaseVector<T>::const_iterator\n");
83 "Trying to postdecrement an inavlid RefToBaseVector<T>::const_iterator\n");
89 if(isInvalid() && o.
isInvalid())
return 0;
92 "Trying to compute difference with an inavlid RefToBaseVector<T>::const_iterator\n");
93 return i->difference(o.
i);
98 "Trying to compute sum with an inavlid RefToBaseVector<T>::const_iterator\n");
106 "Trying to compute difference with an inavlid RefToBaseVector<T>::const_iterator\n");
112 if(isInvalid() && o.
isInvalid())
return false;
115 "Trying to compute < operator with an inavlid RefToBaseVector<T>::const_iterator\n");
116 return i->less_than(o.
i);
119 if(isInvalid() && ci.
isInvalid())
return true;
120 if(isInvalid() || ci.
isInvalid())
return false;
121 return i->equal_to(ci.
i);
124 if(isInvalid() && ci.
isInvalid())
return false;
125 if(isInvalid() || ci.
isInvalid())
return true;
126 return !
i->equal_to(ci.
i);
131 "Trying to dereference an inavlid RefToBaseVector<T>::const_iterator\n");
137 "Trying to decrement an inavlid RefToBaseVector<T>::const_iterator\n");
144 "Trying to increment an inavlid RefToBaseVector<T>::const_iterator\n");
165 virtual std::shared_ptr<reftobase::RefHolderBase>
refBase(
size_t idx)
const = 0;
170 std::shared_ptr<reftobase::RefHolderBase> rb =
refBase(idx);
virtual ProductID id() const =0
bool operator==(const const_iterator &ci) const
virtual std::shared_ptr< reftobase::RefHolderBase > refBase(size_t idx) const =0
const_iterator(const_iterator_imp *it)
void swap(RefVectorHolderBase &)
ptrdiff_t difference_type
const_iterator & operator++()
const_iterator operator--(int)
const_iterator operator++(int)
virtual size_t keyForIndex(size_t idx) const =0
virtual const_iterator begin() const =0
const_iterator operator-(difference_type n) const
virtual size_type size() const =0
virtual bool equal_to(const_iterator_imp const *) const =0
bool operator!=(const const_iterator &ci) const
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
virtual bool empty() const =0
virtual bool isAvailable() const =0
std::shared_ptr< RefHolderBase > value_type
bool operator<(const_iterator const &o) const
virtual void assign(const_iterator_imp const *)=0
virtual EDProductGetter const * productGetter() const =0
const_iterator operator+(difference_type n) const
virtual ~const_iterator_imp()
virtual void decrease()=0
virtual difference_type difference(const_iterator_imp const *) const =0
const_iterator & operator-=(difference_type d)
const_iterator & operator--()
virtual const_iterator end() const =0
virtual void reserve(size_type n)=0
const_iterator & operator=(const_iterator const &it)
const_iterator(const_iterator const &it)
virtual ~RefVectorHolderBase()
virtual RefVectorHolderBase * cloneEmpty() const =0
virtual const_iterator_imp * clone() const =0
virtual void push_back(RefHolderBase const *r)=0
virtual std::shared_ptr< RefHolderBase > deref() const =0
std::ptrdiff_t difference_type
RefToBase< T > getRef(size_t idx) const
value_type operator*() const
virtual void increase()=0
difference_type operator-(const_iterator const &o) const
const_iterator & operator+=(difference_type d)
virtual bool less_than(const_iterator_imp const *) const =0
virtual RefVectorHolderBase * clone() const =0