libpsynth 0.2.1
Public Types | Public Member Functions
psynth::base::hetero_deque< Base > Class Template Reference

A deque of constant size over polymorphic types with a common base. More...

#include <hetero_deque.hpp>

Inheritance diagram for psynth::base::hetero_deque< Base >:
Inheritance graph
[legend]
Collaboration diagram for psynth::base::hetero_deque< Base >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
detail::hetero_iterator< Base > 
iterator
typedef
detail::hetero_iterator< const
Base > 
const_iterator
typedef
boost::reverse_iterator
< iterator
reverse_iterator
typedef
boost::reverse_iterator
< const_iterator
const_reverse_iterator
typedef iterator::value_type value_type
typedef iterator::reference reference
typedef iterator::difference_type difference_type
typedef const_iterator::reference const_reference

Public Member Functions

 hetero_deque (std::size_t size=0)
 hetero_deque (hetero_deque &&)
hetero_dequeoperator= (hetero_deque &&)
 ~hetero_deque ()
Base & back ()
const Base & back () const
template<class Concrete , typename... Args>
bool push_back (Args &&...args)
template<class Concrete >
bool push_back (Concrete &&arg)
bool pop_back ()
Base & front ()
const Base & front () const
template<class Concrete , typename... Args>
bool push_front (Args &&...args)
template<class Concrete >
bool push_front (Concrete &&arg)
bool pop_front ()
void clear ()
void swap (hetero_deque &other)
bool empty () const
iterator begin ()
const_iterator begin () const
const_iterator cbegin () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
iterator end ()
const_iterator end () const
const_iterator cend () const
reverse_iterator rend ()
const_reverse_iterator rend () const

Detailed Description

template<class Base>
class psynth::base::hetero_deque< Base >

A deque of constant size over polymorphic types with a common base.

This provides a way to store polymorphic objects without allocating memory, which allows object oriented programming in many real-time situations.

Base is the common base of all the elements in the collection. Note that, in the general case, Base should define a virtual destructor.

Todo:
Pushing an element invalidates the end iterator. Maybe it is desirable to change this behaviour?
Todo:
Abstract raw memory management into a separate non template class.
Todo:
Parametrize allocator?

Member Typedef Documentation

template<class Base>
typedef detail::hetero_iterator<const Base> psynth::base::hetero_deque< Base >::const_iterator
template<class Base>
typedef const_iterator::reference psynth::base::hetero_deque< Base >::const_reference
template<class Base>
typedef boost::reverse_iterator<const_iterator> psynth::base::hetero_deque< Base >::const_reverse_iterator
template<class Base>
typedef iterator::difference_type psynth::base::hetero_deque< Base >::difference_type
template<class Base>
typedef detail::hetero_iterator<Base> psynth::base::hetero_deque< Base >::iterator
template<class Base>
typedef iterator::reference psynth::base::hetero_deque< Base >::reference
template<class Base>
typedef boost::reverse_iterator<iterator> psynth::base::hetero_deque< Base >::reverse_iterator
template<class Base>
typedef iterator::value_type psynth::base::hetero_deque< Base >::value_type

Constructor & Destructor Documentation

template<class Base>
psynth::base::hetero_deque< Base >::hetero_deque ( std::size_t  size = 0) [explicit]
template<class Base>
psynth::base::hetero_deque< Base >::hetero_deque ( hetero_deque< Base > &&  )
template<class Base>
psynth::base::hetero_deque< Base >::~hetero_deque ( )

Member Function Documentation

template<class Base>
Base& psynth::base::hetero_deque< Base >::back ( )
template<class Base>
const Base& psynth::base::hetero_deque< Base >::back ( ) const
template<class Base>
const_iterator psynth::base::hetero_deque< Base >::begin ( ) const [inline]
template<class Base>
iterator psynth::base::hetero_deque< Base >::begin ( ) [inline]
template<class Base>
const_iterator psynth::base::hetero_deque< Base >::cbegin ( ) const [inline]
template<class Base>
const_iterator psynth::base::hetero_deque< Base >::cend ( ) const [inline]
template<class Base>
void psynth::base::hetero_deque< Base >::clear ( )
template<class Base>
bool psynth::base::hetero_deque< Base >::empty ( ) const [inline]
template<class Base>
const_iterator psynth::base::hetero_deque< Base >::end ( ) const [inline]
template<class Base>
iterator psynth::base::hetero_deque< Base >::end ( ) [inline]
template<class Base>
const Base& psynth::base::hetero_deque< Base >::front ( ) const
template<class Base>
Base& psynth::base::hetero_deque< Base >::front ( )
template<class Base>
hetero_deque& psynth::base::hetero_deque< Base >::operator= ( hetero_deque< Base > &&  )
template<class Base>
bool psynth::base::hetero_deque< Base >::pop_back ( )
template<class Base>
bool psynth::base::hetero_deque< Base >::pop_front ( )
template<class Base>
template<class Concrete , typename... Args>
bool psynth::base::hetero_deque< Base >::push_back ( Args &&...  args)
template<class Base>
template<class Concrete >
bool psynth::base::hetero_deque< Base >::push_back ( Concrete &&  arg) [inline]
template<class Base>
template<class Concrete , typename... Args>
bool psynth::base::hetero_deque< Base >::push_front ( Args &&...  args)
template<class Base>
template<class Concrete >
bool psynth::base::hetero_deque< Base >::push_front ( Concrete &&  arg) [inline]
template<class Base>
reverse_iterator psynth::base::hetero_deque< Base >::rbegin ( ) [inline]
template<class Base>
const_reverse_iterator psynth::base::hetero_deque< Base >::rbegin ( ) const [inline]
template<class Base>
reverse_iterator psynth::base::hetero_deque< Base >::rend ( ) [inline]
template<class Base>
const_reverse_iterator psynth::base::hetero_deque< Base >::rend ( ) const [inline]
template<class Base>
void psynth::base::hetero_deque< Base >::swap ( hetero_deque< Base > &  other)

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