The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fib::cFibDatabase Class Reference

#include <cFibDatabase.h>

Collaboration diagram for fib::cFibDatabase:

List of all members.

Public Member Functions

virtual ~cFibDatabase ()
std::list< longFibgetAllDatabaseObjectIdentifiers () const
cRootgetFibObject (const longFib lIdentifer)
void loadFibObject (const longFib lIdentifer)
void freeFibObject (const longFib lIdentifer)
std::map< longFib, cRoot * > getLoadedDatabaseObjects ()
bool reloadDatabase ()

Static Public Member Functions

static cFibDatabasegetInstance ()
static std::string getDatabasePath ()
static bool setDatabasePath (const char *szInDatabasePath)
static bool setDatabasePath (const std::string szInDatabasePath)
static bool searchForDatabasePath ()

Static Protected Attributes

static cFibDatabaseDeleter fibDatabaseDeleter

Private Member Functions

 cFibDatabase ()

Static Private Member Functions

static bool loadListContainedDbObjects (cFolder &folder)

Static Private Attributes

static cFibDatabasepFibDbInstance
static std::string szDatabasePath
static std::map< longFib, cRoot * > mapLoadedDatabaseObjects
static std::map< longFib,
std::string > 
mapDatabaseIdentifiers
static std::list< longFibliDatabaseIdentifiers

Friends

class cFibDatabaseDeleter

Detailed Description

Definition at line 58 of file cFibDatabase.h.


Constructor & Destructor Documentation

fib::cFibDatabase::cFibDatabase ( )
private

constructor

virtual fib::cFibDatabase::~cFibDatabase ( )
virtual

destructor


Member Function Documentation

void fib::cFibDatabase::freeFibObject ( const longFib  lIdentifer)

This method frees the Fib object for the identifier. You could free some memory in this way.

See also:
getFibObject()
loadFibObject()
reloadDatabase()
mapLoadedDatabaseObjects
setDatabaseIdentifiers
Parameters:
lIdentiferthe identifer of the Fib object to load
std::list< longFib > fib::cFibDatabase::getAllDatabaseObjectIdentifiers ( ) const

This method returns the identifiers of all database objects, in the actual database.

Returns:
the identifiers of all database objects
static std::string fib::cFibDatabase::getDatabasePath ( )
static
See also:
szDatabasePath
Returns:
a string to the actual set database path, the string is empty if no database path is set
cRoot* fib::cFibDatabase::getFibObject ( const longFib  lIdentifer)

This method returns the database Fib object for the identifer, if it exists.

See also:
loadFibObject()
mapLoadedDatabaseObjects
setDatabaseIdentifiers
Parameters:
lIdentiferthe identifer of the Fib object to return
Returns:
the Fib object for the identifer lIdentifer or NULL if non such exists
static cFibDatabase* fib::cFibDatabase::getInstance ( )
static
Returns:
a instance of the database object
std::map< longFib, cRoot * > fib::cFibDatabase::getLoadedDatabaseObjects ( )
Returns:
A map with the loaded Fib database objects. map entries: key: the identifer of the database object value: the loaded database object for the identifier
See also:
mapLoadedDatabaseObjects
void fib::cFibDatabase::loadFibObject ( const longFib  lIdentifer)

This method loads the Fib object for the identifier. If you load Fib objects some time befor you want it (call getFibObject() for them) this could speed up the process. This method won't load Fib objects that are allready loaded.

See also:
getFibObject()
reloadDatabase()
mapLoadedDatabaseObjects
setDatabaseIdentifiers
Parameters:
lIdentiferthe identifer of the Fib object to load
static bool fib::cFibDatabase::loadListContainedDbObjects ( cFolder folder)
staticprivate

This method loads the database folder data. (Attention: No mutex variables are used in this method.)

See also:
liDatabaseIdentifiers
mapDatabaseIdentifiers
Parameters:
folderthe database folder from which to load the data
Returns:
true if the data was loaded, else false
bool fib::cFibDatabase::reloadDatabase ( )

This method reloads all Fib database objects identifiers from the set database path. No database objects will be loaded after the reload.

See also:
szDatabasePath
mapLoadedDatabaseObjects
Returns:
true if the database objects identifiers could be reloded (the database path exists), else false
static bool fib::cFibDatabase::searchForDatabasePath ( )
static

This function search standard Fib database paths to find a valid Fib database and sets the first found Fib database path if one was found.

See also:
szDatabasePath
szStandardDatabaseFolder
Returns:
true if a Fib database (path) was found and was set, else false and the database path is not changed
static bool fib::cFibDatabase::setDatabasePath ( const char *  szInDatabasePath)
static

This function sets the Fib database path to the given path if possible.

See also:
szDatabasePath
Parameters:
szInDatabasePaththe path to the folder with the Fib database objects
Returns:
true if the given Fib database path exists and was set, else false and the database path is not changed
static bool fib::cFibDatabase::setDatabasePath ( const std::string  szInDatabasePath)
static

This function sets the Fib database path to the given path if posible.

See also:
szDatabasePath
Parameters:
szInDatabasePaththe path to the folder with the Fib database objects
Returns:
true if the given Fib database path exists and was set, else false and the database path is not changed

Friends And Related Function Documentation

friend class cFibDatabaseDeleter
friend

Definition at line 60 of file cFibDatabase.h.


Member Data Documentation

cFibDatabaseDeleter fib::cFibDatabase::fibDatabaseDeleter
staticprotected

This class is for deleting the database when the programm ends.

Definition at line 107 of file cFibDatabase.h.

std::list< longFib > fib::cFibDatabase::liDatabaseIdentifiers
staticprivate

The list with the identifiers for all database objects. This data structure is yust for the faster evaluation of:

See also:
cRoot::getAllDatabaseObjectIdentifiers()

Definition at line 95 of file cFibDatabase.h.

std::map< longFib, std::string > fib::cFibDatabase::mapDatabaseIdentifiers
staticprivate

The set with the identifiers for all database objects. map entries: key: the identifer of the database object value: the name of the file for the object in the database folder

Definition at line 88 of file cFibDatabase.h.

std::map< longFib, cRoot * > fib::cFibDatabase::mapLoadedDatabaseObjects
staticprivate

A map with the loaded Fib database objects. map entries: key: the identifer of the database object value: the loaded database object for the identifier

Definition at line 80 of file cFibDatabase.h.

cFibDatabase* fib::cFibDatabase::pFibDbInstance
staticprivate

The instance for the Fib database

Definition at line 67 of file cFibDatabase.h.

std::string fib::cFibDatabase::szDatabasePath
staticprivate

The path to the actual loaded database.

Definition at line 72 of file cFibDatabase.h.


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