#include <storage.h>
Data Structures | |
| class | ChangedContainers |
Public Member Functions | |
| virtual void | init ()=0 |
| virtual void | addObject (zmm::Ref< CdsObject > object, int *changedContainer)=0 |
| virtual void | addContainerChain (zmm::String path, zmm::String lastClass, int lastRefID, int *containerID, int *updateID)=0 |
| Adds a virtual container chain specified by path. | |
| virtual zmm::String | buildContainerPath (int parentID, zmm::String title)=0 |
| Builds the container path. Fetches the path of the parent and adds the title. | |
| virtual void | updateObject (zmm::Ref< CdsObject > object, int *changedContainer)=0 |
| virtual zmm::Ref< zmm::Array < CdsObject > > | browse (zmm::Ref< BrowseParam > param)=0 |
| virtual zmm::Ref< zmm::Array < zmm::StringBase > > | getMimeTypes ()=0 |
| virtual zmm::Ref< CdsObject > | findObjectByPath (zmm::String path)=0 |
| Loads a given (pc directory) object, identified by the given path from the database. | |
| virtual int | findObjectIDByPath (zmm::String fullpath)=0 |
| checks for a given (pc directory) object, identified by the given path from the database | |
| virtual zmm::String | incrementUpdateIDs (int *ids, int size)=0 |
| increments the updateIDs for the given objectIDs | |
| virtual zmm::Ref< CdsObject > | loadObject (int objectID)=0 |
| virtual int | getChildCount (int contId, bool containers=true, bool items=true, bool hideFsRoot=false)=0 |
| virtual zmm::Ref < ChangedContainers > | removeObject (int objectID, bool all)=0 |
| Removes the object identified by the objectID from the database. all references will be automatically removed. If the object is a container, all children will be also removed automatically. If the object is a reference to another object, the "all" flag determines, if the main object will be removed too. | |
| virtual zmm::Ref< DBRHash< int > > | getObjects (int parentID, bool withoutContainer)=0 |
| Get all objects under the given parentID. | |
| virtual zmm::Ref < ChangedContainers > | removeObjects (zmm::Ref< DBRHash< int > > list, bool all=false)=0 |
| Remove all objects found in list. | |
| virtual zmm::Ref< CdsObject > | loadObjectByServiceID (zmm::String serviceID)=0 |
| Loads an object given by the online service ID. | |
| virtual zmm::Ref< zmm::IntArray > | getServiceObjectIDs (char servicePrefix)=0 |
| Return an array of object ID's for a particular service. | |
| virtual int | getTotalFiles ()=0 |
| virtual zmm::String | getInternalSetting (zmm::String key)=0 |
| virtual void | storeInternalSetting (zmm::String key, zmm::String value)=0 |
| virtual void | updateAutoscanPersistentList (scan_mode_t scanmode, zmm::Ref< AutoscanList > list)=0 |
| virtual zmm::Ref< AutoscanList > | getAutoscanList (scan_mode_t scanmode)=0 |
| virtual void | addAutoscanDirectory (zmm::Ref< AutoscanDirectory > adir)=0 |
| virtual void | updateAutoscanDirectory (zmm::Ref< AutoscanDirectory > adir)=0 |
| virtual void | removeAutoscanDirectoryByObjectID (int objectID)=0 |
| virtual void | removeAutoscanDirectory (int autoscanID)=0 |
| virtual int | isAutoscanChild (int objectID)=0 |
| checks if the given object is a direct or indirect child of a recursive autoscan start point | |
| virtual int | getAutoscanDirectoryType (int objectId)=0 |
| returns wheather the given id is an autoscan start point and if yes, if it is persistent | |
| virtual int | isAutoscanDirectoryRecursive (int objectId)=0 |
| returns wheather the given id is an autoscan start point and if yes, if it is recursive | |
| virtual zmm::Ref < AutoscanDirectory > | getAutoscanDirectory (int objectID)=0 |
| returns the AutoscanDirectory for the given objectID or nil if it's not an autoscan start point - scan id will be invalid | |
| virtual void | autoscanUpdateLM (zmm::Ref< AutoscanDirectory > adir)=0 |
| updates the last modified info for the given AutoscanDirectory in the database | |
| virtual void | checkOverlappingAutoscans (zmm::Ref< AutoscanDirectory > adir)=0 |
| virtual zmm::Ref< zmm::IntArray > | getPathIDs (int objectID)=0 |
| virtual void | shutdown ()=0 |
| shutdown the Storage with its possible threads | |
| virtual int | ensurePathExistence (zmm::String path, int *changedContainer)=0 |
| Ensures that a container given by it's location on disk is present in the database. If it does not exist it will be created, but it's content will not be added. | |
| virtual void | clearFlagInDB (int flag)=0 |
| clears the given flag in all objects in the DB | |
| virtual zmm::String | getFsRootName ()=0 |
| virtual void | threadCleanup ()=0 |
| virtual bool | threadCleanupRequired ()=0 |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static zmm::Ref< Storage > | getInstance () |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Protected Member Functions | |
| virtual void | registerSingleton () |
Static Protected Member Functions | |
| static void | stripAndUnescapeVirtualContainerFromPath (zmm::String path, zmm::String &first, zmm::String &last) |
| static zmm::Ref< Storage > | createInstance () |
Protected Attributes | |
| mt_atomic_t | _ref_count |
Static Protected Attributes | |
| static zmm::Ref< Mutex > | mutex |
| static zmm::Ref< Storage > | instance |
| static bool | singletonActive |
Definition at line 101 of file storage.h.
| virtual void Storage::addAutoscanDirectory | ( | zmm::Ref< AutoscanDirectory > | adir | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual void Storage::addContainerChain | ( | zmm::String | path, | |
| zmm::String | lastClass, | |||
| int | lastRefID, | |||
| int * | containerID, | |||
| int * | updateID | |||
| ) | [pure virtual] |
Adds a virtual container chain specified by path.
| path | container path separated by '/'. Slashes in container titles must be escaped. | |
| lastClass | upnp:class of the last container in the chain, it is only set when the container is created for the first time. | |
| lastRefID | reference id of the last container in the chain, INVALID_OBJECT_ID indicates that the id will not be set. | |
| containerID | will be filled in by the function | |
| updateID | will be filled in by the function only if it is set to INVALID_OBJECT_ID and it is necessary to update a container. Otherwise it will be left unchanged. |
The function gets a path (i.e. "/Audio/All Music/") and will create the container path if needed. The container ID will be filled in with the object ID of the container that is last in the path. The updateID will hold the objectID of the container that was changed, in case new containers were created during the operation.
Implemented in SQLStorage.
| virtual void Storage::addObject | ( | zmm::Ref< CdsObject > | object, | |
| int * | changedContainer | |||
| ) | [pure virtual] |
Implemented in SQLStorage.
| virtual void Storage::autoscanUpdateLM | ( | zmm::Ref< AutoscanDirectory > | adir | ) | [pure virtual] |
updates the last modified info for the given AutoscanDirectory in the database
| adir | the AutoscanDirectory to be updated |
Implemented in SQLStorage.
| virtual zmm::Ref<zmm::Array<CdsObject> > Storage::browse | ( | zmm::Ref< BrowseParam > | param | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual zmm::String Storage::buildContainerPath | ( | int | parentID, | |
| zmm::String | title | |||
| ) | [pure virtual] |
Builds the container path. Fetches the path of the parent and adds the title.
| parentID | the parent id of the parent container | |
| title | the title of the container to add to the path. It will be escaped. |
Implemented in SQLStorage.
| virtual void Storage::checkOverlappingAutoscans | ( | zmm::Ref< AutoscanDirectory > | adir | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual void Storage::clearFlagInDB | ( | int | flag | ) | [pure virtual] |
clears the given flag in all objects in the DB
Implemented in SQLStorage.
Definition at line 72 of file storage.cc.
References _, _Exception, CFG_SERVER_STORAGE_DRIVER, and getInstance().
Referenced by getInstance().
| virtual int Storage::ensurePathExistence | ( | zmm::String | path, | |
| int * | changedContainer | |||
| ) | [pure virtual] |
Ensures that a container given by it's location on disk is present in the database. If it does not exist it will be created, but it's content will not be added.
| *changedContainer | returns the ID for the UpdateManager |
Implemented in SQLStorage.
| virtual zmm::Ref<CdsObject> Storage::findObjectByPath | ( | zmm::String | path | ) | [pure virtual] |
Loads a given (pc directory) object, identified by the given path from the database.
| path | the path of the object; object is interpreted as directory if the path ends with DIR_SEPERATOR, as file otherwise multiple DIR_SEPERATOR are irgnored |
Implemented in SQLStorage.
| virtual int Storage::findObjectIDByPath | ( | zmm::String | fullpath | ) | [pure virtual] |
checks for a given (pc directory) object, identified by the given path from the database
| path | the path of the object; object is interpreted as directory if the path ends with DIR_SEPERATOR, as file otherwise multiple DIR_SEPERATOR are irgnored |
Implemented in SQLStorage.
| virtual zmm::Ref<AutoscanDirectory> Storage::getAutoscanDirectory | ( | int | objectID | ) | [pure virtual] |
returns the AutoscanDirectory for the given objectID or nil if it's not an autoscan start point - scan id will be invalid
| objectID | the object id to get the AutoscanDirectory for |
Implemented in SQLStorage.
| virtual int Storage::getAutoscanDirectoryType | ( | int | objectId | ) | [pure virtual] |
returns wheather the given id is an autoscan start point and if yes, if it is persistent
| objectId | the object id to check |
Implemented in SQLStorage.
| virtual zmm::Ref<AutoscanList> Storage::getAutoscanList | ( | scan_mode_t | scanmode | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual int Storage::getChildCount | ( | int | contId, | |
| bool | containers = true, |
|||
| bool | items = true, |
|||
| bool | hideFsRoot = false | |||
| ) | [pure virtual] |
Implemented in SQLStorage.
| virtual zmm::String Storage::getFsRootName | ( | ) | [pure virtual] |
Implemented in SQLStorage.
Reimplemented from Singleton< Storage >.
Definition at line 51 of file storage.cc.
References _, _Exception, AUTOLOCK, createInstance(), Singleton< Storage >::instance, Singleton< Storage >::mutex, and nil.
Referenced by createInstance(), FileRequestHandler::get_info(), CdsItem::getVirtualPath(), CdsContainer::getVirtualPath(), FileRequestHandler::open(), web::autoscan::process(), web::items::process(), web::edit_load::process(), web::containers::process(), and AutoscanList::updateLMinDB().
| virtual zmm::String Storage::getInternalSetting | ( | zmm::String | key | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual zmm::Ref<zmm::Array<zmm::StringBase> > Storage::getMimeTypes | ( | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual zmm::Ref<DBRHash<int> > Storage::getObjects | ( | int | parentID, | |
| bool | withoutContainer | |||
| ) | [pure virtual] |
Get all objects under the given parentID.
| parentID | parent container | |
| withoutContainer | if false: all children are returned; if true: only items are returned |
Implemented in SQLStorage.
| virtual zmm::Ref<zmm::IntArray> Storage::getPathIDs | ( | int | objectID | ) | [pure virtual] |
Implemented in SQLStorage.
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| virtual zmm::Ref<zmm::IntArray> Storage::getServiceObjectIDs | ( | char | servicePrefix | ) | [pure virtual] |
Return an array of object ID's for a particular service.
In the database, the service is identified by a service id prefix.
Implemented in SQLStorage.
| virtual int Storage::getTotalFiles | ( | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual zmm::String Storage::incrementUpdateIDs | ( | int * | ids, | |
| int | size | |||
| ) | [pure virtual] |
increments the updateIDs for the given objectIDs
| ids | pointer to the array of ids | |
| size | number of entries in the given array |
Implemented in SQLStorage.
| virtual void Storage::init | ( | ) | [pure virtual] |
Reimplemented from Singleton< Storage >.
Implemented in SQLStorage.
| virtual int Storage::isAutoscanChild | ( | int | objectID | ) | [pure virtual] |
checks if the given object is a direct or indirect child of a recursive autoscan start point
| objectID | the object id of the object to check |
Implemented in SQLStorage.
| virtual int Storage::isAutoscanDirectoryRecursive | ( | int | objectId | ) | [pure virtual] |
returns wheather the given id is an autoscan start point and if yes, if it is recursive
| objectId | the object id to check |
Implemented in SQLStorage.
Implemented in SQLStorage.
| virtual zmm::Ref<CdsObject> Storage::loadObjectByServiceID | ( | zmm::String | serviceID | ) | [pure virtual] |
Loads an object given by the online service ID.
Implemented in SQLStorage.
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
Definition at line 94 of file singleton.h.
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| virtual void Storage::removeAutoscanDirectory | ( | int | autoscanID | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual void Storage::removeAutoscanDirectoryByObjectID | ( | int | objectID | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual zmm::Ref<ChangedContainers> Storage::removeObject | ( | int | objectID, | |
| bool | all | |||
| ) | [pure virtual] |
Removes the object identified by the objectID from the database. all references will be automatically removed. If the object is a container, all children will be also removed automatically. If the object is a reference to another object, the "all" flag determines, if the main object will be removed too.
| objectID | the object id of the object to remove | |
| all | if true and the object to be removed is a reference | |
| objectType | pointer to an int; will be filled with the objectType of the removed object, if not NULL |
Implemented in SQLStorage.
| virtual zmm::Ref<ChangedContainers> Storage::removeObjects | ( | zmm::Ref< DBRHash< int > > | list, | |
| bool | all = false | |||
| ) | [pure virtual] |
Remove all objects found in list.
| list | a DBHash containing objectIDs that have to be removed | |
| all | if true and the object to be removed is a reference |
Implemented in SQLStorage.
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| virtual void Storage::shutdown | ( | ) | [pure virtual] |
shutdown the Storage with its possible threads
Reimplemented from Singleton< Storage >.
Implemented in SQLStorage.
| virtual void Storage::storeInternalSetting | ( | zmm::String | key, | |
| zmm::String | value | |||
| ) | [pure virtual] |
Implemented in SQLStorage.
| void Storage::stripAndUnescapeVirtualContainerFromPath | ( | zmm::String | path, | |
| zmm::String & | first, | |||
| zmm::String & | last | |||
| ) | [static, protected] |
Definition at line 105 of file storage.cc.
References _, _Exception, zmm::String::charAt(), zmm::String::rindex(), zmm::String::substring(), unescape(), VIRTUAL_CONTAINER_ESCAPE, and VIRTUAL_CONTAINER_SEPARATOR.
Referenced by SQLStorage::addContainerChain().
| virtual void Storage::threadCleanup | ( | ) | [pure virtual] |
| virtual bool Storage::threadCleanupRequired | ( | ) | [pure virtual] |
| virtual void Storage::updateAutoscanDirectory | ( | zmm::Ref< AutoscanDirectory > | adir | ) | [pure virtual] |
Implemented in SQLStorage.
| virtual void Storage::updateAutoscanPersistentList | ( | scan_mode_t | scanmode, | |
| zmm::Ref< AutoscanList > | list | |||
| ) | [pure virtual] |
Implemented in SQLStorage.
| virtual void Storage::updateObject | ( | zmm::Ref< CdsObject > | object, | |
| int * | changedContainer | |||
| ) | [pure virtual] |
Implemented in SQLStorage.
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
Definition at line 91 of file singleton.h.
Referenced by getInstance().
Reimplemented from zmm::Object.
Definition at line 90 of file singleton.h.
Referenced by SQLStorage::addToInsertBuffer(), SQLStorage::flushInsertBuffer(), and getInstance().
bool Singleton< Storage >::singletonActive [static, protected, inherited] |
Definition at line 92 of file singleton.h.
1.6.1