1 #ifndef DataFormats_Common_BaseVectorHolder_h 2 #define DataFormats_Common_BaseVectorHolder_h 14 class BaseVectorHolder {
23 virtual base_ref_type
const at(size_type
idx)
const = 0;
24 virtual bool empty()
const = 0;
26 virtual size_type
size()
const = 0;
29 virtual void clear() = 0;
44 virtual void increase(difference_type
d) = 0;
45 virtual void decrease(difference_type d) = 0;
49 virtual base_ref_type
deref()
const = 0;
53 struct const_iterator :
public std::iterator <std::random_access_iterator_tag, RefToBase<T> >{
55 typedef std::unique_ptr<value_type>
pointer;
66 if (isInvalid())
i = it.
i;
71 throwInvalidReference(isInvalid(),
"increment");
76 throwInvalidReference(isInvalid(),
"postincrement");
82 throwInvalidReference(isInvalid(),
"decrement");
87 throwInvalidReference(isInvalid(),
"postdecrement");
93 if (isInvalid() && o.
isInvalid())
return 0;
94 throwInvalidReference(isInvalid() || o.
isInvalid(),
"compute difference with");
95 return i->difference(o.
i);
98 throwInvalidReference(isInvalid(),
"compute sum with");
104 throwInvalidReference(isInvalid(),
"compute difference with");
110 if (isInvalid() && o.
isInvalid())
return false;
111 throwInvalidReference(isInvalid() || o.
isInvalid(),
"compute < operator with");
112 return i->less_than(o.
i);
115 if (isInvalid() && ci.
isInvalid())
return true;
116 if (isInvalid() || ci.
isInvalid())
return false;
117 return i->equal_to(ci.
i);
120 if (isInvalid() && ci.
isInvalid())
return false;
121 if (isInvalid() || ci.
isInvalid())
return true;
122 return !
i->equal_to(ci.
i);
125 throwInvalidReference(isInvalid(),
"dereference");
132 throwInvalidReference(isInvalid(),
"increment");
137 throwInvalidReference(isInvalid(),
"decrement");
157 virtual std::unique_ptr<RefVectorHolderBase>
vectorHolder()
const = 0;
virtual void push_back(BaseHolder< T > const *)=0
const_iterator operator++(int)
const_iterator & operator--()
virtual ~BaseVectorHolder()
const_iterator & operator+=(difference_type d)
const_iterator operator+(difference_type n) const
virtual base_ref_type deref() const =0
virtual void increase()=0
value_type operator*() const
bool operator<(const_iterator const &o) const
virtual bool less_than(const_iterator_imp const *) const =0
bool operator!=(const_iterator const &ci) const
virtual BaseVectorHolder * cloneEmpty() const =0
const_iterator(const_iterator_imp *it)
#define CMS_CLASS_VERSION(_version_)
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
RefToBase< T > base_ref_type
virtual difference_type difference(const_iterator_imp const *) const =0
std::unique_ptr< value_type > pointer
const_iterator & operator++()
Container::value_type value_type
virtual ~const_iterator_imp()
difference_type operator-(const_iterator const &o) const
const_iterator & operator=(const_iterator const &it)
const_iterator operator--(int)
virtual void decrease()=0
bool operator==(const_iterator const &ci) const
virtual base_ref_type const at(size_type idx) const =0
const_iterator operator-(difference_type n) const
virtual bool equal_to(const_iterator_imp const *) const =0
virtual EDProductGetter const * productGetter() const =0
virtual size_type size() const =0
std::ptrdiff_t difference_type
pointer operator->() const
virtual std::unique_ptr< RefVectorHolderBase > vectorHolder() const =0
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
virtual const_iterator end() const =0
virtual const_iterator begin() const =0
virtual ProductID id() const =0
void swap(BaseVectorHolder &)
const_iterator & operator-=(difference_type d)
ptrdiff_t difference_type
virtual bool isAvailable() const =0
virtual bool empty() const =0
virtual const_iterator_imp * clone() const =0
virtual BaseVectorHolder * clone() const =0
virtual void assign(const_iterator_imp const *)=0
const_iterator(const_iterator const &it)