cMediaDatabase Class Reference

#include <metadata.h>

Collaboration diagram for cMediaDatabase:

Collaboration graph
[legend]

List of all members.

Public Member Functions

unsigned int getSystemUpdateID ()
const char * getContainerUpdateIDs ()
 cMediaDatabase ()
int addFastFind (cUPnPClassObject *Object, const char *FastFind)
cUPnPClassObjectgetObjectByFastFind (const char *FastFind)
cUPnPClassObjectgetObjectByID (cUPnPObjectID ID)
int browse (OUT cUPnPResultSet **Results, IN const char *ID, IN bool BrowseMetadata, IN const char *Filter="*", IN unsigned int Offset=0, IN unsigned int Count=0, IN const char *SortCriteria="")
int search (OUT cUPnPResultSet **Results, IN const char *ID, IN const char *Search, IN const char *Filter="*", IN unsigned int Offset=0, IN unsigned int Count=0, IN const char *SortCriteria="")

Friends

class cUPnPServer
class cUPnPObjectMediator


Detailed Description

The media database

This class is the global object manager. It holds every object in a local cache. Only this class is allowed to create new objects.

See also:
cUPnPClassObject

Constructor & Destructor Documentation

cMediaDatabase::cMediaDatabase (  ) 

Constructor

This creates an instance of the media database.


Member Function Documentation

int cMediaDatabase::addFastFind ( cUPnPClassObject Object,
const char *  FastFind 
)

Add a Fastfind

This creates a Fastfind entry. It is a string which can be used to relocate a objectID. Usually this is a file name or another ID with which the related object can be found.

Returns:
returns
  • -1, if the creation was successful
  • 0, otherwise
Parameters:
Object the object, which should be registered
FastFind the string with which the object shall be relocated

int cMediaDatabase::browse ( OUT cUPnPResultSet **  Results,
IN const char *  ID,
IN bool  BrowseMetadata,
IN const char *  Filter = "*",
IN unsigned int  Offset = 0,
IN unsigned int  Count = 0,
IN const char *  SortCriteria = "" 
)

Performs a browse on the database

This performs a browse request on the database and returns a structure containing the matching count and DIDL-Lite fragement which is sent to the control point.

Returns:
returns an integer representing one of the following:
  • UPNP_CDS_E_INVALID_SORT_CRITERIA, when the sort criteria is malformed
  • UPNP_CDS_E_CANT_PROCESS_REQUEST, when there is an internal error while processing the request
  • UPNP_CDS_E_NO_SUCH_OBJECT, when the requested ObjectID does not exist
  • UPNP_SOAP_E_ACTION_FAILED, when the action failed due any reasons
  • UPNP_E_SUCCESS, if the request was successful
Parameters:
Results the result of the request
ID the objectID of the request
BrowseMetadata true to browse metadata, false otherwise
Filter the filter applied to the returned metadata
Offset the starting offset
Count maximum count returned
SortCriteria sorts the results before returning them

const char * cMediaDatabase::getContainerUpdateIDs (  ) 

Returns a CSV list with ContainerUpdateIDs

This list contains an unordered list of ordered pairs of ContainerID and its ContainerUpdateID. It contains only recent changes which are not yet beeing evented. This means that evented updates will be removed from list.

Returns:
CSV list of ContainerUpdateIDs

cUPnPClassObject * cMediaDatabase::getObjectByFastFind ( const char *  FastFind  ) 

Finds a object by Fastfind

This returns the object via the Fastfind string. The object must be previosly registered via cMediaDatabase::addFastFind().

It tries to find the object in the internal object cache. If this fails, the object will be loaded from the database.

See also:
cMediaDatabase::addFastFind
Returns:
The object associated with FastFind
Parameters:
FastFind the string with which the object shall be relocated

cUPnPClassObject * cMediaDatabase::getObjectByID ( cUPnPObjectID  ID  ) 

Finds a object by its ObjectID

This returns the object via its ObjectID.

It tries to find the object in the internal object cache. If this fails, the object will be loaded from the database.

Returns:
The object associated with FastFind
Parameters:
ID The ObjectID of the requested object

unsigned int cMediaDatabase::getSystemUpdateID (  ) 

Returns the SystemUpdateID

This returns the SystemUpdateID. This changes whenever anything changed within the content directory. This value will be sent through the UPnP network every 2 seconds.

Returns:
the SystemUpdateID

int cMediaDatabase::search ( OUT cUPnPResultSet **  Results,
IN const char *  ID,
IN const char *  Search,
IN const char *  Filter = "*",
IN unsigned int  Offset = 0,
IN unsigned int  Count = 0,
IN const char *  SortCriteria = "" 
)

Performs a search on the database

This performs a search request on the database and returns a structure containing the matching count and DIDL-Lite fragement which is sent to the control point.

Note:
The submitted ID must be a ContainerID. Searches are performed only in this container.
Returns:
returns an integer representing one of the following:
  • UPNP_CDS_E_INVALID_SORT_CRITERIA, when the sort criteria is malformed
  • UPNP_CDS_E_CANT_PROCESS_REQUEST, when there is an internal error while processing the request
  • UPNP_CDS_E_NO_SUCH_OBJECT, when the requested ObjectID does not exist
  • UPNP_SOAP_E_ACTION_FAILED, when the action failed due any reasons
  • UPNP_E_SUCCESS, if the request was successful
Parameters:
Results the result of the request
ID the ContainerID
Search the search string
Filter the filter applied to the returned metadata
Offset the starting offset
Count maximum count returned
SortCriteria sorts the results before returning them


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

Generated on Sun Nov 8 15:44:09 2009 for UPnP/DLNA plugin for VDR by  doxygen 1.5.8