#include <object.h>
Public Member Functions | |
virtual cUPnPClassObject * | createObject (const char *Title, bool Restricted) |
virtual cUPnPClassObject * | getObject (cUPnPObjectID ID) |
virtual int | saveObject (cUPnPClassObject *Object) |
virtual int | deleteObject (cUPnPClassObject *Object) |
virtual int | clearObject (cUPnPClassObject *Object) |
Protected Member Functions | |
cUPnPObjectMediator (cMediaDatabase *MediaDatabase) | |
virtual int | initializeObject (cUPnPClassObject *Object, const char *Class, const char *Title, bool Restricted) |
virtual int | objectToDatabase (cUPnPClassObject *Object) |
virtual int | databaseToObject (cUPnPClassObject *Object, cUPnPObjectID ID) |
Protected Attributes | |
cSQLiteDatabase * | mDatabase |
the SQLite 3 database wrapper | |
cMediaDatabase * | mMediaDatabase |
the media database |
This is the interface between the objects and the database. It is possible to create new objects, stores objects in the database as well as removing them from it.
cUPnPObjectMediator::cUPnPObjectMediator | ( | cMediaDatabase * | MediaDatabase | ) | [protected] |
Constructor of object mediator
This constructs a new object mediator. This is actually not allowed because it is prohibited to create instances of the UPnP class Object
MediaDatabase | the media database |
int cUPnPObjectMediator::clearObject | ( | cUPnPClassObject * | Object | ) | [virtual] |
Clears the object
This clears the object, i.e. all its children will be removed and deleted from the database
<0
, in case of an error0
, otherwise Object | the object to be cleared |
Implements cMediatorInterface.
cUPnPClassObject * cUPnPObjectMediator::createObject | ( | const char * | Title, | |
bool | Restricted | |||
) | [virtual] |
Creates an object
This creates a new UPnP object with the specific title and the restriction.
Title | the title of that object | |
Restricted | the restriction of the object |
Implements cMediatorInterface.
Reimplemented in cUPnPItemMediator, cUPnPVideoItemMediator, cUPnPVideoBroadcastMediator, cUPnPMovieMediator, and cUPnPContainerMediator.
int cUPnPObjectMediator::databaseToObject | ( | cUPnPClassObject * | Object, | |
cUPnPObjectID | ID | |||
) | [protected, virtual] |
Loads an object from database
This loads an object from the database
<0
, in case of an error0
, otherwise Object | the object to be loaded | |
ID | the object ID of that object |
Reimplemented in cUPnPItemMediator, cUPnPVideoItemMediator, cUPnPVideoBroadcastMediator, cUPnPMovieMediator, and cUPnPContainerMediator.
int cUPnPObjectMediator::deleteObject | ( | cUPnPClassObject * | Object | ) | [virtual] |
Deletes the object
This deletes the object in the database by removing all its children and then deleting the contents from the database
<0
, in case of an error0
, otherwise Object | the object to be deleted |
Implements cMediatorInterface.
cUPnPClassObject * cUPnPObjectMediator::getObject | ( | cUPnPObjectID | ID | ) | [virtual] |
Get an object
Retrieves a UPnP object from the database and stores its information in the object. The object is obtained via its object ID.
ID | the object ID |
Implements cMediatorInterface.
Reimplemented in cUPnPItemMediator, cUPnPVideoItemMediator, cUPnPVideoBroadcastMediator, cUPnPMovieMediator, and cUPnPContainerMediator.
int cUPnPObjectMediator::initializeObject | ( | cUPnPClassObject * | Object, | |
const char * | Class, | |||
const char * | Title, | |||
bool | Restricted | |||
) | [protected, virtual] |
Initializes an object
This initializes an object, which means, that it will be created in the database with the required details.
<0
, in case of an error0
, otherwise Object | the object to be initialized | |
Class | the class of the object | |
Title | the title of the object | |
Restricted | restriction of the object |
int cUPnPObjectMediator::objectToDatabase | ( | cUPnPClassObject * | Object | ) | [protected, virtual] |
Store the object in the database
This stores the information of an object in the database
<0
, in case of an error0
, otherwise Object | the object to be saved |
Reimplemented in cUPnPItemMediator, cUPnPVideoItemMediator, cUPnPVideoBroadcastMediator, cUPnPMovieMediator, and cUPnPContainerMediator.
int cUPnPObjectMediator::saveObject | ( | cUPnPClassObject * | Object | ) | [virtual] |
Saves the object
This saves the object in the database by updating the values in the database with those in the object.
<0
, in case of an error0
, otherwise Object | the object to be saved |
Implements cMediatorInterface.