itunesdb::TrackPtrList Class Reference

#include <track.h>

List of all members.

Public Member Functions

 TrackPtrList ()
void setComparator (const TrackComparatorPtr &comparator)
const TrackComparatorPtr & getComparator () const
void setComparator (TrackComparator *comparator)
virtual int compareItems (QPtrCollection::Item s1, QPtrCollection::Item s2)
bool hasDirtyTracks ()
bool hasRecentlyPlayedTracks ()
bool removeAllRefs (itunesdb::Track *track)
TrackPtrListgetTracksBy (TrackPredicate &predicate, itunesdb::TrackPtrList &buffer) const
TrackfindFirstTrackBy (TrackPredicate &predicate) const
template<class JavaLikeTrackIterator>
void addAll (JavaLikeTrackIterator trackIter)


Detailed Description

A List implementation for Track pointers.


Constructor & Destructor Documentation

itunesdb::TrackPtrList::TrackPtrList (  ) 

Default constructor.


Member Function Documentation

void itunesdb::TrackPtrList::setComparator ( const TrackComparatorPtr &  comparator  ) 

This method sets the comparator that compares two tracks for sorting. TrackPtrList owns the given pointer so it may be deallocated at any time.

Parameters:
comparator the comparator to set. If NULL is given the DefaultComparator will be used.

const TrackComparatorPtr & itunesdb::TrackPtrList::getComparator (  )  const

Returns the currently used comparator for sorting.

void itunesdb::TrackPtrList::setComparator ( TrackComparator comparator  ) 

This method sets the comparator that compares two tracks for sorting. TrackPtrList owns the given pointer so it may be deallocated at any time.

Parameters:
comparator the comparator to set. If NULL is given the DefaultComparator will be used.

int itunesdb::TrackPtrList::compareItems ( QPtrCollection::Item  s1,
QPtrCollection::Item  s2 
) [virtual]

Compares two tracks by the comparator set by setComparator().

bool itunesdb::TrackPtrList::hasDirtyTracks (  ) 

Returns true if this list contains tracks not in sync with the database.

bool itunesdb::TrackPtrList::hasRecentlyPlayedTracks (  ) 

Returns true if this list contains tracks being played after the last sync.

bool itunesdb::TrackPtrList::removeAllRefs ( itunesdb::Track track  ) 

removes all references to the given track.

TrackPtrList * itunesdb::TrackPtrList::getTracksBy ( TrackPredicate predicate,
itunesdb::TrackPtrList buffer 
) const

Returns all the Tracks where the given predicate returned true

itunesdb::Track * itunesdb::TrackPtrList::findFirstTrackBy ( TrackPredicate predicate  )  const

Returns the first Track where the given predicate returned true The given trackpredicate needs to contain a method that gets a track, and returns a bool if it's the desired track

Returns:
the first Track where the given predicate returned true
See also:
class TrackPredicate

template<class JavaLikeTrackIterator>
void itunesdb::TrackPtrList::addAll ( JavaLikeTrackIterator  trackIter  )  [inline]

Adds all tracks delivered by the given Iterator.


The documentation for this class was generated from the following files:
Generated on Tue Dec 12 16:39:28 2006 for libqtpod.kdevelop by  doxygen 1.5.1