cUPnPObjectMediator Class Reference

#include <object.h>

Inheritance diagram for cUPnPObjectMediator:

Inheritance graph
[legend]
Collaboration diagram for cUPnPObjectMediator:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual cUPnPClassObjectcreateObject (const char *Title, bool Restricted)
virtual cUPnPClassObjectgetObject (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

cSQLiteDatabasemDatabase
 the SQLite 3 database wrapper
cMediaDatabasemMediaDatabase
 the media database


Detailed Description

Object Mediator

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.


Constructor & Destructor Documentation

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

Parameters:
MediaDatabase the media database


Member Function Documentation

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

Returns:
returns
  • <0, in case of an error
  • 0, otherwise
Parameters:
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.

Returns:
the newly created object
Parameters:
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

Returns:
returns
  • <0, in case of an error
  • 0, otherwise
Parameters:
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

Returns:
returns
  • <0, in case of an error
  • 0, otherwise
Parameters:
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.

Returns:
the object, found in the database
Parameters:
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.

Returns:
returns
  • <0, in case of an error
  • 0, otherwise
Parameters:
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

Returns:
returns
  • <0, in case of an error
  • 0, otherwise
Parameters:
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.

Returns:
returns
  • <0, in case of an error
  • 0, otherwise
Parameters:
Object the object to be saved

Implements cMediatorInterface.


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