1 #ifndef CMSUTILS_BEUEUE_H 2 #define CMSUTILS_BEUEUE_H 3 #include <boost/intrusive_ptr.hpp> 68 template <
typename... Args>
71 boost::intrusive_ptr<_bqueue_item<T> >
back;
127 typedef boost::intrusive_ptr<_bqueue_item<value_type> >
itemptr;
131 bqueue() : m_size(0), m_head(), m_tail() {}
161 m_tail = itemptr(
new item(this->m_tail, val));
162 if ((++m_size) == 1) {
169 m_tail = itemptr(
new item(this->m_tail, std::forward<T>(
val)));
170 if ((++m_size) == 1) {
176 template <
typename... Args>
178 m_tail = itemptr(
new item(this->m_tail, std::forward<Args>(
args)...));
179 if ((++m_size) == 1) {
187 m_tail = m_tail->back;
193 const T &
front()
const {
return m_head->value; }
195 const T &
back()
const {
return m_tail->value; }
197 const_iterator
rbegin()
const {
return m_tail.get(); }
198 const_iterator
rend()
const {
return nullptr; }
199 const_iterator
begin()
const {
return m_tail.get(); }
200 const_iterator
end()
const {
return nullptr; }
201 size_type
size()
const {
return m_size; }
202 bool empty()
const {
return m_size == 0; }
204 int idx = m_size - i - 1;
205 const_iterator it = rbegin();
215 return (m_size > 0) && (m_head->refCount > 2);
228 other.
m_head->back = this->m_tail;
236 m_head = m_tail =
nullptr;
245 template <
typename T>
const_iterator rend() const
bqueue & operator=(bqueue< T > &&cp) noexcept
_bqueue_itr< value_type > iterator
void swap(bqueue< T > &cp)
bool operator==(const _bqueue_itr< T > &t2) const
_bqueue_item(boost::intrusive_ptr< _bqueue_item< T > > tail, const T &val)
_bqueue_itr< value_type > const_iterator
bqueue(bqueue< T > &&cp) noexcept
unsigned short int size_type
_bqueue_itr< T > & operator++()
void swap(bqueue< T > &rh, bqueue< T > &lh)
void emplace_back(Args &&...args)
friend void intrusive_ptr_release(_bqueue_item< T > *it)
const T * operator->() const
_bqueue_item< T > const * it
_bqueue_itr< T > & operator--()
friend void intrusive_ptr_add_ref(_bqueue_item< T > *it)
_bqueue_item< value_type > item
bqueue(const bqueue< T > &cp)
_bqueue_item(boost::intrusive_ptr< _bqueue_item< T > > tail, T &&val)
_bqueue_item(boost::intrusive_ptr< _bqueue_item< T > > tail, Args &&...args)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
const_iterator begin() const
boost::intrusive_ptr< _bqueue_item< value_type > > itemptr
_bqueue_itr(const _bqueue_item< T > *t)
const _bqueue_itr< T > & operator--() const
void intrusive_ptr_add_ref(_bqueue_item< T > *it)
const_iterator rbegin() const
const T & operator[](size_type i) const
void intrusive_ptr_release(_bqueue_item< T > *it)
boost::intrusive_ptr< _bqueue_item< T > > back
const T & operator*() const
void join(bqueue< T > &other)
bool operator!=(const _bqueue_itr< T > &t2) const
const _bqueue_itr< T > & operator=(const _bqueue_itr< T > &t2)
const_iterator end() const
void push_back(const T &val)