pianod2
multisource multiuser scriptable networked music player
Classes | Public Types | Public Member Functions | Private Types | List of all members
RetainedList< ActualType, ValueType > Class Template Reference

Container class for storing reference-counted music thingies. More...

#include <retainedlist.h>

Inheritance diagram for RetainedList< ActualType, ValueType >:
Inheritance graph
[legend]
Collaboration diagram for RetainedList< ActualType, ValueType >:
Collaboration graph
[legend]

Classes

class  const_iterator
 
class  const_reverse_iterator
 
class  iterator
 Iterators: bastardize ThingieList's iterator's dereference operators to return known type. More...
 
class  reverse_iterator
 

Public Types

using music_type = ValueType
 

Public Member Functions

 RetainedList ()=default
 Default constructor. More...
 
 RetainedList (const this_type &list)
 Copy construct from list of same type. More...
 
 RetainedList (this_type &&list)
 Move construct from a list of the same type. More...
 
this_typeoperator= (const this_type &list)
 Copy assign from a list of the same type. More...
 
this_typeoperator= (this_type &&list)
 Move assign from a list of the same type. More...
 
template<typename FromPointerType , class FromValueType = typename std::remove_pointer<FromPointerType>::type, typename = typename std::enable_if<std::is_base_of<ValueType, FromValueType>::value>::type>
 RetainedList (const RetainedList< FromPointerType > &list)
 Copy construct from another RetainedList whose value type is a subclass of our value type. More...
 
template<typename FromPointerType , class FromValueType = typename std::remove_pointer<FromPointerType>::type, typename = typename std::enable_if<std::is_base_of<ValueType, FromValueType>::value>::type>
 RetainedList (RetainedList< FromPointerType > &&list)
 Move construct from another RetainedList whose value type is a subclass of our value type. More...
 
template<typename FromPointerType , class FromValueType = typename std::remove_pointer<FromPointerType>::type, typename = typename std::enable_if<std::is_base_of<ValueType, FromValueType>::value>::type>
ThingieListoperator= (const RetainedList< FromPointerType > &list)
 Copy assign from another RetainedList whose value type is a subclass of our value type. More...
 
template<typename FromPointerType , class FromValueType = typename std::remove_pointer<FromPointerType>::type, typename = typename std::enable_if<std::is_base_of<ValueType, FromValueType>::value>::type>
ThingieListoperator= (const RetainedList< FromPointerType > &&list)
 Move assign from another RetainedList whose value type is a subclass of our value type. More...
 
iterator begin () noexcept
 Iterators: Return our iterators with correct dereference operator instead of the ThingieList ones. More...
 
const_iterator begin () const noexcept
 
const_iterator cbegin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crend () const noexcept
 
ActualType operator[] (size_type item)
 Member accessors: return data as known type, instead of ThingieList. More...
 
ActualType const & operator[] (size_type item) const
 
ActualType & front ()
 
const ActualType & front () const
 
ActualType & back ()
 
const ActualType & back () const
 
iterator erase (const_iterator target)
 
iterator erase (const_iterator first, const_iterator last)
 
void push_back (ActualType add)
 
template<typename InsertionType >
void push_back (const Retainer< InsertionType > &add)
 
void push_front (ActualType add)
 
template<typename InsertionType >
void push_front (const Retainer< InsertionType > &add)
 
iterator insert (const_iterator where, const ActualType add)
 
template<class InputIterator >
iterator insert (const_iterator where, InputIterator first, InputIterator last)
 
void join (const this_type &from)
 
void join (this_type &&from)
 
- Public Member Functions inherited from ThingieList
 ~ThingieList ()
 Release items when being destroyed. More...
 
 ThingieList ()=default
 
 ThingieList (const ThingieList &list)
 Copy-construct items into this list. More...
 
 ThingieList (ThingieList &&list)
 Move-construct items into this list. More...
 
ThingieListoperator= (const ThingieList &list)
 Copy assign into the list. More...
 
ThingieListoperator= (ThingieList &&list)
 Move assign into the list. More...
 
template<class... Args>
iterator emplace (const_iterator pos, Args &&...args)=delete
 
template<class... Args>
void emplace_back (Args &&...args)=delete
 
iterator insert (const_iterator pos, std::initializer_list< MusicThingie * >)=delete
 
void clear (void)
 Replace all the usual methods with ones that manage object retention. More...
 
iterator erase (const_iterator target)
 
iterator erase (const_iterator first, const_iterator last)
 
iterator insert (const_iterator where, MusicThingie *const &add)
 
iterator insert (const_iterator where, MusicThingie *&&add)
 
template<class InputIterator >
iterator insert (const_iterator where, InputIterator first, InputIterator last)
 
void push_back (MusicThingie *add)
 
template<typename InsertionType >
void push_back (const Retainer< InsertionType > &add)
 
void push_front (MusicThingie *add)
 
template<typename InsertionType >
void push_front (const Retainer< InsertionType > &add)
 
void pop_back (void)
 
void pop_front (void)
 
void resize (size_type)=delete
 
void join (const ThingieList &from)
 Append another thingielist to this one. More...
 
void join (ThingieList &&from)
 Append another thingielist to this one. More...
 
void limitTo (MusicThingie::Type type)
 Purge anything that isn't a certain type. More...
 
bool purge (const Media::Source *const source)
 Purge any items from a particular source from the list. More...
 

Private Types

using this_type = RetainedList< ActualType, ValueType >
 

Detailed Description

template<typename ActualType, class ValueType = typename std::remove_pointer<ActualType>::type>
class RetainedList< ActualType, ValueType >

Container class for storing reference-counted music thingies.

This is a thin wrapper around ThingieList that uses that class to do all the work, but can restrict inserted data to a subclass, and automatically cast retrieved data to that subclass, providing type safety.

Member Typedef Documentation

◆ music_type

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
using RetainedList< ActualType, ValueType >::music_type = ValueType

◆ this_type

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
using RetainedList< ActualType, ValueType >::this_type = RetainedList<ActualType, ValueType>
private

Constructor & Destructor Documentation

◆ RetainedList() [1/5]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
RetainedList< ActualType, ValueType >::RetainedList ( )
inlinedefault

Default constructor.

◆ RetainedList() [2/5]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
RetainedList< ActualType, ValueType >::RetainedList ( const this_type list)
inline

Copy construct from list of same type.

◆ RetainedList() [3/5]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
RetainedList< ActualType, ValueType >::RetainedList ( this_type &&  list)
inline

Move construct from a list of the same type.

◆ RetainedList() [4/5]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
template<typename FromPointerType , class FromValueType = typename std::remove_pointer<FromPointerType>::type, typename = typename std::enable_if<std::is_base_of<ValueType, FromValueType>::value>::type>
RetainedList< ActualType, ValueType >::RetainedList ( const RetainedList< FromPointerType > &  list)
inline

Copy construct from another RetainedList whose value type is a subclass of our value type.

◆ RetainedList() [5/5]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
template<typename FromPointerType , class FromValueType = typename std::remove_pointer<FromPointerType>::type, typename = typename std::enable_if<std::is_base_of<ValueType, FromValueType>::value>::type>
RetainedList< ActualType, ValueType >::RetainedList ( RetainedList< FromPointerType > &&  list)
inline

Move construct from another RetainedList whose value type is a subclass of our value type.

Member Function Documentation

◆ back() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
ActualType& RetainedList< ActualType, ValueType >::back ( )
inline

◆ back() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const ActualType& RetainedList< ActualType, ValueType >::back ( ) const
inline

◆ begin() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const_iterator RetainedList< ActualType, ValueType >::begin ( ) const
inlinenoexcept

◆ begin() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
iterator RetainedList< ActualType, ValueType >::begin ( )
inlinenoexcept

Iterators: Return our iterators with correct dereference operator instead of the ThingieList ones.

Here is the caller graph for this function:

◆ cbegin()

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const_iterator RetainedList< ActualType, ValueType >::cbegin ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ cend()

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const_iterator RetainedList< ActualType, ValueType >::cend ( ) const
inlinenoexcept

◆ crbegin()

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const_reverse_iterator RetainedList< ActualType, ValueType >::crbegin ( ) const
inlinenoexcept

◆ crend()

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const_reverse_iterator RetainedList< ActualType, ValueType >::crend ( ) const
inlinenoexcept

◆ end() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const_iterator RetainedList< ActualType, ValueType >::end ( ) const
inlinenoexcept

◆ end() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
iterator RetainedList< ActualType, ValueType >::end ( )
inlinenoexcept
Here is the caller graph for this function:

◆ erase() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
iterator RetainedList< ActualType, ValueType >::erase ( const_iterator  first,
const_iterator  last 
)
inline
Here is the call graph for this function:

◆ erase() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
iterator RetainedList< ActualType, ValueType >::erase ( const_iterator  target)
inline
Here is the call graph for this function:

◆ front() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
ActualType& RetainedList< ActualType, ValueType >::front ( )
inline
Here is the caller graph for this function:

◆ front() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const ActualType& RetainedList< ActualType, ValueType >::front ( ) const
inline

◆ insert() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
iterator RetainedList< ActualType, ValueType >::insert ( const_iterator  where,
const ActualType  add 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
template<class InputIterator >
iterator RetainedList< ActualType, ValueType >::insert ( const_iterator  where,
InputIterator  first,
InputIterator  last 
)
inline
Here is the call graph for this function:

◆ join() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
void RetainedList< ActualType, ValueType >::join ( const this_type from)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ join() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
void RetainedList< ActualType, ValueType >::join ( this_type &&  from)
inline
Here is the call graph for this function:

◆ operator=() [1/4]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
template<typename FromPointerType , class FromValueType = typename std::remove_pointer<FromPointerType>::type, typename = typename std::enable_if<std::is_base_of<ValueType, FromValueType>::value>::type>
ThingieList& RetainedList< ActualType, ValueType >::operator= ( const RetainedList< FromPointerType > &&  list)
inline

Move assign from another RetainedList whose value type is a subclass of our value type.

Here is the call graph for this function:

◆ operator=() [2/4]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
template<typename FromPointerType , class FromValueType = typename std::remove_pointer<FromPointerType>::type, typename = typename std::enable_if<std::is_base_of<ValueType, FromValueType>::value>::type>
ThingieList& RetainedList< ActualType, ValueType >::operator= ( const RetainedList< FromPointerType > &  list)
inline

Copy assign from another RetainedList whose value type is a subclass of our value type.

Here is the call graph for this function:

◆ operator=() [3/4]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
this_type& RetainedList< ActualType, ValueType >::operator= ( const this_type list)
inline

Copy assign from a list of the same type.

Here is the call graph for this function:

◆ operator=() [4/4]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
this_type& RetainedList< ActualType, ValueType >::operator= ( this_type &&  list)
inline

Move assign from a list of the same type.

Here is the call graph for this function:

◆ operator[]() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
ActualType RetainedList< ActualType, ValueType >::operator[] ( size_type  item)
inline

Member accessors: return data as known type, instead of ThingieList.

◆ operator[]() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
ActualType const& RetainedList< ActualType, ValueType >::operator[] ( size_type  item) const
inline

◆ push_back() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
void RetainedList< ActualType, ValueType >::push_back ( ActualType  add)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_back() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
template<typename InsertionType >
void RetainedList< ActualType, ValueType >::push_back ( const Retainer< InsertionType > &  add)
inline
Here is the call graph for this function:

◆ push_front() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
void RetainedList< ActualType, ValueType >::push_front ( ActualType  add)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_front() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
template<typename InsertionType >
void RetainedList< ActualType, ValueType >::push_front ( const Retainer< InsertionType > &  add)
inline
Here is the call graph for this function:

◆ rbegin() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const_reverse_iterator RetainedList< ActualType, ValueType >::rbegin ( ) const
inlinenoexcept

◆ rbegin() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
reverse_iterator RetainedList< ActualType, ValueType >::rbegin ( )
inlinenoexcept

◆ rend() [1/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
const_reverse_iterator RetainedList< ActualType, ValueType >::rend ( ) const
inlinenoexcept

◆ rend() [2/2]

template<typename ActualType , class ValueType = typename std::remove_pointer<ActualType>::type>
reverse_iterator RetainedList< ActualType, ValueType >::rend ( )
inlinenoexcept

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