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< T > &)=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 47 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 56 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 70 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 84 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 94 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 104 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 114 of file referencecounterlist.h.

◆ mid()

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

Definition at line 118 of file referencecounterlist.h.

◆ operator+()

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

Definition at line 139 of file referencecounterlist.h.

◆ operator+=() [1/2]

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

Definition at line 145 of file referencecounterlist.h.

◆ operator+=() [2/2]

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

Definition at line 150 of file referencecounterlist.h.

◆ operator<<() [1/2]

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

Definition at line 155 of file referencecounterlist.h.

◆ operator<<() [2/2]

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

Definition at line 160 of file referencecounterlist.h.

◆ operator=()

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

Definition at line 165 of file referencecounterlist.h.


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