1 #ifndef DataFormats_Common_View_h 2 #define DataFormats_Common_View_h 22 #include "boost/iterator/indirect_iterator.hpp" 46 std::unique_ptr<ViewBase>
clone()
const;
52 virtual std::unique_ptr<ViewBase>
doClone()
const = 0;
75 typedef std::vector<T const*>
seq_t;
86 typedef boost::indirect_iterator<typename seq_t::const_iterator>
const_iterator;
110 size_type capacity()
const;
115 const_iterator
begin()
const;
116 const_iterator
end()
const;
118 const_reverse_iterator rbegin()
const;
119 const_reverse_iterator rend()
const;
121 size_type
size()
const;
122 size_type max_size()
const;
124 const_reference at(size_type
pos)
const;
128 std::vector<Ptr<value_type>>
const& ptrs()
const;
130 const_reference front()
const;
131 const_reference back()
const;
142 std::unique_ptr<ViewBase>
doClone()
const override;
146 template <
typename T>
148 template <
typename T>
150 template <
typename T>
151 bool operator<(View<T>
const&,
View<T> const&);
152 template <
typename T>
153 bool operator<=(View<T>
const&,
View<T> const&);
154 template <
typename T>
156 template <
typename T>
163 template <
typename T>
166 template <
typename T>
170 : items_(), vPtrs_() {
176 assert(numElements == helpers.size());
178 items_.reserve(numElements);
179 vPtrs_.reserve(numElements);
181 void const*
p = pointers[
i];
182 auto const&
h = helpers[
i];
183 items_.push_back(static_cast<pointer>(p));
185 vPtrs_.push_back(
Ptr<T>(
h.first, static_cast<T const*>(p),
h.second));
186 }
else if (getter !=
nullptr) {
187 vPtrs_.push_back(
Ptr<T>(
h.first,
h.second, getter));
189 vPtrs_.push_back(
Ptr<T>(
h.first,
nullptr,
h.second));
194 template <
typename T>
197 template <
typename T>
200 items_.swap(other.
items_);
201 vPtrs_.swap(other.
vPtrs_);
204 template <
typename T>
209 template <
typename T>
211 return items_.begin();
214 template <
typename T>
219 template <
typename T>
224 template <
typename T>
226 return items_.
rend();
229 template <
typename T>
231 return items_.size();
234 template <
typename T>
239 template <
typename T>
241 return items_.empty();
244 template <
typename T>
246 return *items_.
at(pos);
249 template <
typename T>
254 template <
typename T>
264 template <
typename T>
269 template <
typename T>
274 template <
typename T>
276 return *items_.
front();
279 template <
typename T>
281 return *items_.
back();
285 template <
typename T>
292 template <
typename T>
294 return std::unique_ptr<ViewBase>{
new View(*
this)};
297 template <
typename T>
304 template <
typename T>
306 return lhs.size() == rhs.size() &&
std::equal(lhs.begin(), lhs.end(), rhs.begin());
309 template <
typename T>
311 return !(lhs == rhs);
314 template <
typename T>
315 inline bool operator<(View<T>
const& lhs,
View<T> const& rhs) {
316 return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
319 template <
typename T>
320 inline bool operator<=(View<T>
const& lhs,
View<T> const& rhs) {
324 template <
typename T>
329 template <
typename T>
335 template <
typename T>
const_reverse_iterator rbegin() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const_reference back() const
void swap(View< T > &lhs, View< T > &rhs)
std::vector< T const * > seq_t
size_type max_size() const
seq_t::difference_type difference_type
virtual std::unique_ptr< ViewBase > doClone() const =0
bool equal(const T &first, const T &second)
bool operator>=(View< T > const &, View< T > const &)
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
std::vector< Ptr< value_type > > vPtrs_
std::unique_ptr< ViewBase > clone() const
bool operator>(View< T > const &, View< T > const &)
T operator[](int i) const
const_reverse_iterator rend() const
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
size_type capacity() const
ViewBase & operator=(ViewBase const &)
bool operator!=(View< T > const &, View< T > const &)
boost::indirect_iterator< typename seq_t::const_reverse_iterator > const_reverse_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
bool operator==(View< T > const &, View< T > const &)
const_reference at(size_type pos) const
const_reference front() const
T first(std::pair< T, U > const &p)
T const & const_reference
std::vector< std::pair< edm::ProductID, unsigned long > > FillViewHelperVector