AutoscanList Class Reference

#include <autoscan.h>

Inheritance diagram for AutoscanList:
zmm::Object

Public Member Functions

 AutoscanList ()
int add (zmm::Ref< AutoscanDirectory > dir)
 Adds a new AutoscanDirectory to the list.
void addList (zmm::Ref< AutoscanList > list)
zmm::Ref< AutoscanDirectoryget (int id)
zmm::Ref< AutoscanDirectoryget (zmm::String location)
zmm::Ref< AutoscanDirectorygetByObjectID (int objectID)
int size ()
void remove (int id)
 removes the AutoscanDirectory given by its scan ID
int removeByObjectID (int objectID)
int remove (zmm::String location)
 removes the AutoscanDirectory with the given location
zmm::Ref< AutoscanListremoveIfSubdir (zmm::String parent, bool persistent=false)
 removes the AutoscanDirectory if it is a subdirectory of a given location.
void notifyAll (zmm::Ref< TimerSubscriberSingleton< Object > > obj)
 Send notification for each directory that is stored in the list.
void updateLMinDB ()
 updates the last_modified data for all AutoscanDirectories.
zmm::Ref< zmm::Array
< AutoscanDirectory > > 
getArrayCopy ()
 returns a copy of the autoscan list in the form of an array
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Member Functions

int _add (zmm::Ref< AutoscanDirectory > dir)

Protected Attributes

zmm::Ref< Mutexmutex
zmm::Ref< zmm::Array
< AutoscanDirectory > > 
list
mt_atomic_t _ref_count

Detailed Description

Definition at line 58 of file autoscan.h.


Constructor & Destructor Documentation

AutoscanList::AutoscanList (  ) 

Definition at line 78 of file autoscan.cc.

References list, and mutex.

Referenced by removeIfSubdir().


Member Function Documentation

int AutoscanList::_add ( zmm::Ref< AutoscanDirectory dir  )  [protected]

Definition at line 102 of file autoscan.cc.

References _, _Exception, list, and nil.

Referenced by add(), and addList().

int AutoscanList::add ( zmm::Ref< AutoscanDirectory dir  ) 

Adds a new AutoscanDirectory to the list.

The scanID of the directory is invalidated and set to the index in the AutoscanList.

Parameters:
dir AutoscanDirectory to add to the list.
Returns:
scanID of the newly added AutoscanDirectory

Definition at line 96 of file autoscan.cc.

References _add(), AUTOLOCK, and mutex.

void AutoscanList::addList ( zmm::Ref< AutoscanList list  ) 

Definition at line 136 of file autoscan.cc.

References _add(), AUTOLOCK, mutex, and nil.

Ref< AutoscanDirectory > AutoscanList::get ( zmm::String  location  ) 

Definition at line 181 of file autoscan.cc.

References AUTOLOCK, list, mutex, and nil.

Ref< AutoscanDirectory > AutoscanList::get ( int  id  ) 

Definition at line 159 of file autoscan.cc.

References AUTOLOCK, list, mutex, and nil.

Ref< Array< AutoscanDirectory > > AutoscanList::getArrayCopy (  ) 

returns a copy of the autoscan list in the form of an array

Definition at line 149 of file autoscan.cc.

References AUTOLOCK, list, and mutex.

Ref< AutoscanDirectory > AutoscanList::getByObjectID ( int  objectID  ) 

Definition at line 169 of file autoscan.cc.

References AUTOLOCK, list, mutex, and nil.

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

void AutoscanList::notifyAll ( zmm::Ref< TimerSubscriberSingleton< Object > >  obj  ) 

Send notification for each directory that is stored in the list.

Parameters:
obj instance of the class that will receive the notifications.
void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

void Object::release (  )  [inherited]
int AutoscanList::remove ( zmm::String  location  ) 

removes the AutoscanDirectory with the given location

Parameters:
location the location to remove
Returns:
the scanID, that was removed; if nothing removed: INVALID_SCAN_ID

Definition at line 242 of file autoscan.cc.

References AUTOLOCK, INVALID_SCAN_ID, list, mutex, and nil.

void AutoscanList::remove ( int  id  ) 

removes the AutoscanDirectory given by its scan ID

Definition at line 193 of file autoscan.cc.

References AUTOLOCK, INVALID_SCAN_ID, list, log_debug, mutex, and nil.

int AutoscanList::removeByObjectID ( int  objectID  ) 

Definition at line 218 of file autoscan.cc.

References AUTOLOCK, INVALID_SCAN_ID, list, mutex, and nil.

Ref< AutoscanList > AutoscanList::removeIfSubdir ( zmm::String  parent,
bool  persistent = false 
)

removes the AutoscanDirectory if it is a subdirectory of a given location.

Parameters:
parent parent directory.
persistent also remove persistent directories.
Returns:
AutoscanList of removed directories, where each directory object in the list is a copy and not the original reference.

Definition at line 266 of file autoscan.cc.

References AUTOLOCK, AutoscanList(), INVALID_SCAN_ID, list, mutex, and nil.

void Object::retain (  )  [inherited]
int AutoscanList::size (  )  [inline]

Definition at line 80 of file autoscan.h.

void AutoscanList::updateLMinDB (  ) 

updates the last_modified data for all AutoscanDirectories.

Definition at line 84 of file autoscan.cc.

References AUTOLOCK, Storage::getInstance(), list, log_debug, mutex, and nil.


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]

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

Generated on Fri Mar 26 20:16:55 2010 for MediaTomb by  doxygen 1.6.1