yat  0.21pre
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
theplu::yat::utility::detail::BasicQueue< Derived, T, Container > Class Template Reference

#include <yat/utility/BasicQueue.h>

Public Types

typedef Container::value_type value_type
 Type of object stored.
 
typedef Container::size_type size_type
 

Public Member Functions

 BasicQueue (void)
 
 BasicQueue (const BasicQueue &other)
 
 BasicQueue (const Container &container)
 
size_t capacity (void)
 
void capacity (size_t c)
 change maximal number of element stored in container More...
 
void clear (void)
 clear queue More...
 
bool empty (void) const
 
void pop (T &value)
 access next element in queue More...
 
void push (const T &t)
 insert an element into container More...
 
void push (T &&t)
 insert an element into container More...
 
size_type size (void) const
 
bool try_pop (T &value)
 
bool try_push (T &value)
 
bool try_push (T &&value)
 

Protected Member Functions

void assign (const BasicQueue &other)
 

Protected Attributes

Container q_
 data
 

Detailed Description

template<class Derived, typename T, class Container>
class theplu::yat::utility::detail::BasicQueue< Derived, T, Container >

Base class for Queue and PriorityQueue

Member Typedef Documentation

◆ size_type

template<class Derived, typename T, class Container>
typedef Container::size_type theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::size_type

An unsigned integral type.

See also
size(void)

Constructor & Destructor Documentation

◆ BasicQueue() [1/3]

template<class Derived, typename T, class Container>
theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::BasicQueue ( void  )
inline

Default constructor

◆ BasicQueue() [2/3]

template<class Derived, typename T, class Container>
theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::BasicQueue ( const BasicQueue< Derived, T, Container > &  other)
inline

Copy constructor

◆ BasicQueue() [3/3]

template<class Derived, typename T, class Container>
theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::BasicQueue ( const Container &  container)
inlineexplicit

Construct queue from underlying Container

Member Function Documentation

◆ assign()

template<class Derived, typename T, class Container>
void theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::assign ( const BasicQueue< Derived, T, Container > &  other)
inlineprotected

assign other to this

◆ capacity() [1/2]

template<class Derived, typename T, class Container>
size_t theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::capacity ( void  )
inline
Returns
maximal number of element stored in container
Since
New in yat 0.19

◆ capacity() [2/2]

template<class Derived, typename T, class Container>
void theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::capacity ( size_t  c)
inline

change maximal number of element stored in container

Since
New in yat 0.19

◆ clear()

template<class Derived, typename T, class Container>
void theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::clear ( void  )
inline

clear queue

Since
new in yat 0.15

◆ empty()

template<class Derived, typename T, class Container>
bool theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::empty ( void  ) const
inline
Returns
true if container's size is zero

◆ pop()

template<class Derived, typename T, class Container>
void theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::pop ( T &  value)
inline

access next element in queue

Access the next element is queue. If container is empty, process is waiting until other process is inserting element into container.

◆ push() [1/2]

template<class Derived, typename T, class Container>
void theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::push ( const T &  t)
inline

insert an element into container

If size of queue is equal (or greater) to its capacity, the function is waiting until this is not the case.

◆ push() [2/2]

template<class Derived, typename T, class Container>
void theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::push ( T &&  t)
inline

insert an element into container

Since
New in yat 0.15

◆ size()

template<class Derived, typename T, class Container>
size_type theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::size ( void  ) const
inline
Returns
Number of elements stored in container

◆ try_pop()

template<class Derived, typename T, class Container>
bool theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::try_pop ( T &  value)
inline

If Queue is empty() do nothing and return false, else pop the element into value and return true

◆ try_push() [1/2]

template<class Derived, typename T, class Container>
bool theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::try_push ( T &  value)
inline

If Queue size is less than capacity push value and return true; otherwise return false

Since
New in yat 0.19

◆ try_push() [2/2]

template<class Derived, typename T, class Container>
bool theplu::yat::utility::detail::BasicQueue< Derived, T, Container >::try_push ( T &&  value)
inline

If Queue size is less than capacity push value and return true; otherwise return false

Since
New in yat 0.19

The documentation for this class was generated from the following file:

Generated on Wed Jan 25 2023 03:34:30 for yat by  doxygen 1.8.14