vdr 2.7.3
cList< T > Class Template Reference

#include <tools.h>

Public Member Functions

 cList (const char *NeedsLocking=NULL)
 
const T * Get (int Index) const
 
const T * First (void) const
 
const T * Last (void) const
 
const T * Prev (const T *Object) const
 
const T * Next (const T *Object) const
 
T * Get (int Index)
 
T * First (void)
 
T * Last (void)
 
T * Prev (const T *Object)
 
T * Next (const T *Object)
 
- Public Member Functions inherited from cListBase
virtual ~cListBase ()
 
bool Lock (cStateKey &StateKey, bool Write=false, int TimeoutMs=0) const
 
void SetSyncStateKey (cStateKey &StateKey)
 
void SetUseGarbageCollector (void)
 
void SetExplicitModify (void)
 
void SetModified (void)
 
void Add (cListObject *Object, cListObject *After=NULL)
 
void Ins (cListObject *Object, cListObject *Before=NULL)
 
void Del (cListObject *Object, bool DeleteObject=true)
 
virtual void Move (int From, int To)
 
void Move (cListObject *From, cListObject *To)
 
virtual void Clear (void)
 
bool Contains (const cListObject *Object) const
 
const cListObjectGet (int Index) const
 
cListObjectGet (int Index)
 
int Count (void) const
 
void Sort (void)
 

Additional Inherited Members

- Protected Member Functions inherited from cListBase
 cListBase (const char *NeedsLocking=NULL)
 
- Protected Attributes inherited from cListBase
cListObjectobjects
 
cListObjectlastObject
 
int count
 
cStateLock stateLock
 
const char * needsLocking
 
bool useGarbageCollector
 

Detailed Description

template<class T>
class cList< T >

Definition at line 631 of file tools.h.

Constructor & Destructor Documentation

◆ cList()

template<class T>
cList< T >::cList ( const char * NeedsLocking = NULL)
inline

Sets up a new cList of the given type T.

If NeedsLocking is given, the list and any of its elements may only be accessed if the caller holds a lock obtained by a call to Lock() (see cListBase::Lock() for details). NeedsLocking is used as both a boolean flag to enable locking, and as a name to identify this list in debug output. It must be a static string and should be no longer than 10 characters. The string will not be copied!

Definition at line 633 of file tools.h.

References cListBase::cListBase().

Referenced by cConfig< T >::cConfig(), First(), Get(), Last(), Next(), and Prev().

Member Function Documentation

◆ First() [1/2]

template<class T>
T * cList< T >::First ( void )
inline

Non-const version of First().

Definition at line 655 of file tools.h.

References cList().

◆ First() [2/2]

◆ Get() [1/2]

template<class T>
T * cList< T >::Get ( int Index)
inline

< Returns the element immediately following Object in this list, or NULL if Object is the last element in the list.

Object must not be NULL! Non-const version of Get().

Definition at line 653 of file tools.h.

References cList().

◆ Get() [2/2]

template<class T>
const T * cList< T >::Get ( int Index) const
inline

Returns the list element at the given Index, or NULL if no such element exists.

Definition at line 640 of file tools.h.

References cListBase::Get().

Referenced by cMenuChannels::Delete(), and cPictureMenu::SelectItem().

◆ Last() [1/2]

template<class T>
T * cList< T >::Last ( void )
inline

Non-const version of Last().

Definition at line 657 of file tools.h.

References cList().

◆ Last() [2/2]

template<class T>
const T * cList< T >::Last ( void ) const
inline

Returns the last element in this list, or NULL if the list is empty.

Definition at line 645 of file tools.h.

References cListBase::lastObject.

◆ Next() [1/2]

template<class T>
T * cList< T >::Next ( const T * Object)
inline

Non-const version of Next().

Definition at line 661 of file tools.h.

References cList().

◆ Next() [2/2]

◆ Prev() [1/2]

template<class T>
T * cList< T >::Prev ( const T * Object)
inline

Non-const version of Prev().

Definition at line 659 of file tools.h.

References cList().

◆ Prev() [2/2]

template<class T>
const T * cList< T >::Prev ( const T * Object) const
inline

Definition at line 647 of file tools.h.


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