MythTV  master
Public Member Functions | List of all members
RefCountedList< T > Class Template Reference

General purpose reference counted list. More...

#include <referencecounterlist.h>

Inheritance diagram for RefCountedList< T >:
Inheritance graph
[legend]
Collaboration diagram for RefCountedList< T >:
Collaboration graph
[legend]

Public Member Functions

T * takeAt (int i)
 Removes the item at index position i and returns it. More...
 
T * takeFirst (void)
 Removes the first item in the list and returns it. More...
 
T * takeLast (void)
 Removes the last item in the list and returns it. More...
 
RefCountHandler< T > takeAtAndDecr (int i)
 Removes the item at index position i and returns it. More...
 
RefCountHandler< T > takeFirstAndDecr (void)
 Removes the first item in the list and returns it. More...
 
RefCountHandler< T > takeLastAndDecr (void)
 Removes the last item in the list and returns it. More...
 
RefCountedList< T > mid (int pos, int length=-1) const
 
RefCountedList< T > operator+ (const RefCountedList< T > &other) const
 
RefCountedList< T > & operator+= (const RefCountedList< T > &other)
 
RefCountedList< T > & operator+= (const RefCountHandler< T > &value)
 
RefCountedList< T > & operator<< (const RefCountedList< T > &other)
 
RefCountedList< T > & operator<< (const RefCountHandler< T > &value)
 
RefCountedList< T > & operator= (const RefCountedList< T > &other)
 
 RefCountedList ()=default
 
 RefCountedList (const RefCountedList &)=default
 

Detailed Description

template<class T>
class RefCountedList< T >

General purpose reference counted list.

T typename must be a ReferenceCounter inheriting object provide the same access methods as a QList

Definition at line 55 of file referencecounterlist.h.

Constructor & Destructor Documentation

◆ RefCountedList() [1/2]

template<class T >
RefCountedList< T >::RefCountedList ( )
default

◆ RefCountedList() [2/2]

template<class T >
RefCountedList< T >::RefCountedList ( const RefCountedList< T > &  )
default

Member Function Documentation

◆ takeAt()

template<class T >
T* RefCountedList< T >::takeAt ( int  i)
inline

Removes the item at index position i and returns it.

i must be a valid index position in the list (i.e., 0 <= i < size()). takeAt takes ownership of the object from the list. (e.g if the object only exists in the list, it won't be deleted)

Definition at line 64 of file referencecounterlist.h.

Referenced by RefCountedList< MetadataLookup >::takeAt(), and RefCountedList< MetadataLookup >::takeAtAndDecr().

◆ takeFirst()

template<class T >
T* RefCountedList< T >::takeFirst ( void  )
inline

Removes the first item in the list and returns it.

This is the same as takeAt(0). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function. takeFirst takes ownership of the object from the list. (e.g if the object only exists in the list, it won't be deleted)

Definition at line 78 of file referencecounterlist.h.

Referenced by MetadataResultsDialog::Create(), MetadataDownload::run(), RefCountedList< MetadataLookup >::takeFirst(), and RefCountedList< MetadataLookup >::takeFirstAndDecr().

◆ takeLast()

template<class T >
T* RefCountedList< T >::takeLast ( void  )
inline

Removes the last item in the list and returns it.

This is the same as takeAt(size() - 1). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function. takeFirst takes ownership of the object from the list. (e.g if the object only exists in the list, it won't be deleted)

Definition at line 92 of file referencecounterlist.h.

Referenced by RefCountedList< MetadataLookup >::takeLast(), and RefCountedList< MetadataLookup >::takeLastAndDecr().

◆ takeAtAndDecr()

template<class T >
RefCountHandler<T> RefCountedList< T >::takeAtAndDecr ( int  i)
inline

Removes the item at index position i and returns it.

i must be a valid index position in the list (i.e., 0 <= i < size()).

Definition at line 102 of file referencecounterlist.h.

Referenced by MetadataResultsDialog::sendResult().

◆ takeFirstAndDecr()

template<class T >
RefCountHandler<T> RefCountedList< T >::takeFirstAndDecr ( void  )
inline

Removes the first item in the list and returns it.

This is the same as takeAtAndDecr(0). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function.

Definition at line 112 of file referencecounterlist.h.

Referenced by MetadataDownload::run(), and MetadataImageDownload::run().

◆ takeLastAndDecr()

template<class T >
RefCountHandler<T> RefCountedList< T >::takeLastAndDecr ( void  )
inline

Removes the last item in the list and returns it.

This is the same as takeAtAndDecr(size() - 1). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function.

Definition at line 122 of file referencecounterlist.h.

◆ mid()

template<class T >
RefCountedList<T> RefCountedList< T >::mid ( int  pos,
int  length = -1 
) const
inline

Definition at line 126 of file referencecounterlist.h.

◆ operator+()

template<class T >
RefCountedList<T> RefCountedList< T >::operator+ ( const RefCountedList< T > &  other) const
inline

Definition at line 147 of file referencecounterlist.h.

◆ operator+=() [1/2]

template<class T >
RefCountedList<T>& RefCountedList< T >::operator+= ( const RefCountedList< T > &  other)
inline

Definition at line 153 of file referencecounterlist.h.

◆ operator+=() [2/2]

template<class T >
RefCountedList<T>& RefCountedList< T >::operator+= ( const RefCountHandler< T > &  value)
inline

Definition at line 158 of file referencecounterlist.h.

◆ operator<<() [1/2]

template<class T >
RefCountedList<T>& RefCountedList< T >::operator<< ( const RefCountedList< T > &  other)
inline

Definition at line 163 of file referencecounterlist.h.

◆ operator<<() [2/2]

template<class T >
RefCountedList<T>& RefCountedList< T >::operator<< ( const RefCountHandler< T > &  value)
inline

Definition at line 168 of file referencecounterlist.h.

◆ operator=()

template<class T >
RefCountedList<T>& RefCountedList< T >::operator= ( const RefCountedList< T > &  other)
inline

Definition at line 179 of file referencecounterlist.h.


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