creaImageIO::Gimmick Class Reference
[Controller]

Central controler of the gimmick application. More...

#include <creaImageIOGimmick.h>

Collaboration diagram for creaImageIO::Gimmick:

Collaboration graph
[legend]

List of all members.

Public Types

typedef
TreeHandlerImageAdder::Progress 
AddProgress
typedef
TreeHandlerImageAdder::ProgressCallbackType 
AddProgressCallbackType
typedef std::map
< std::string,
TreeHandler * > 
TreeHandlerMapType
 Type of map from TreeHandler name to TreeHandler*.

Public Member Functions

 Gimmick ()
 Ctor.
 ~Gimmick ()
 Dtor.
void ConnectAddProgressObserver (AddProgressCallbackType callback)
const AddProgressGetAddProgress () const
void Initialize ()
 Initialize (read/creates databases, etc.).
void Finalize ()
 Finalize (closes databases, etc.).
TreeHandlerMapTypeGetTreeHandlerMap ()
 Returns the TreeHandlerMap (ref).
const
TreeHandlerMapType
GetTreeHandlerMap () const
 Returns the TreeHandlerMap (const ref).
void AddFiles (const std::string &handler, const std::vector< std::string > &filenames)
 Add the files to the given TreeHandler.
void AddDir (const std::string &handler, const std::string &path, bool recurse)
 Add a dir to the given TreeHandler.
void RemoveFile (const std::string &d, tree::Node *filename)
 Removes a file from the given TreeHandler.
void DeleteDrive (const std::string &drive)
 Deletes the given drive name from the databases.
void CopyFiles (const std::vector< std::string > &filenames, const std::string &d)
 Copies the files into the local directory.
std::string Synchronize (const std::string &d, bool repair, bool checkAttributes)
void Print (const std::string &handler)
 Prints the tree handled by the handler.
SQLiteTreeHandlercreateDB (const std::string &i_name, const std::string &i_locDesc, const std::string &i_locDB)
 create a DB from a given descriptor file and for a specific location
void addDB (const std::string &i_nameDB, const std::string &i_locationDB)
TreeHandlerGetTreeHandler (const std::string &name) const
 Returns the TreeHandler with a given name.
TimestampDatabaseHandlerGetTimestampDatabase () const
 Returns the TimestampDatabase.
SQLiteTreeHandlerGetLocalDatabase ()
const SQLiteTreeHandlerGetLocalDatabase () const
void GetSetting (const std::string &name, std::string &value)
 Returns the given setting value for the given setting parameter.
void UpdateSetting (const std::string &name, const std::string &value)
 Updates the settings file.
void addDBSettings ()
 add DB from Settings file
void EditField (tree::Node *node, const std::string &d, const std::string &name, const std::string &key, const std::string &val)
 Edits the field described by the name and key provided with the value given.
void GetAttributes (const std::string &d, const std::string &filename, const std::vector< std::string > &params, std::vector< std::string > &results)
 Returns the attributes in results described in params.
const std::string & GetHomeDirectory ()
const std::string & GetUserSettingsDirectory ()
void CreateUserSettingsDirectory ()
const std::string & GetLocalDatabasePath ()
const std::string & GetTimestampDatabasePath ()

Static Public Member Functions

static void SetMessageLevel (int level)
 Sets level for messages "Gimmick!".
static void SetDebugMessageLevel (int level)
 Sets level for debug messages "Gimmick! DEBUG".

Private Attributes

SQLiteTreeHandlermLocalDatabase
TimestampDatabaseHandlermTimestampDatabase
TreeHandlerMapType mTreeHandlerMap
SynchronizermSynchronizer
std::string mCurrentDirectory
std::string mHomeDirectory
std::string mUserSettingsDirectory
std::string mLocalDatabasePath
std::string mTimestampDatabasePath
SettingsmSettings
TreeHandlerImageAdder mImageAdder


Detailed Description

Central controler of the gimmick application.

Definition at line 40 of file creaImageIOGimmick.h.


Member Typedef Documentation

typedef TreeHandlerImageAdder::Progress creaImageIO::Gimmick::AddProgress

Definition at line 49 of file creaImageIOGimmick.h.

typedef TreeHandlerImageAdder::ProgressCallbackType creaImageIO::Gimmick::AddProgressCallbackType

Definition at line 50 of file creaImageIOGimmick.h.

typedef std::map<std::string, TreeHandler*> creaImageIO::Gimmick::TreeHandlerMapType

Type of map from TreeHandler name to TreeHandler*.

Definition at line 78 of file creaImageIOGimmick.h.


Constructor & Destructor Documentation

creaImageIO::Gimmick::Gimmick (  ) 

Ctor.

creaImageIO::Gimmick::~Gimmick (  ) 

Dtor.


Member Function Documentation

void creaImageIO::Gimmick::ConnectAddProgressObserver ( AddProgressCallbackType  callback  )  [inline]

Adds the function f to the list of functions to call when addition operations progres. f is of type AddProgressCallbackType which is: void (*AddProgressCallbackType)(AddProgress&) To pass a member function 'f' of an instance 'c' of a class 'C' as callback you have to 'bind' it, i.e. call: ConnectAddProgressObserver ( boost::bind( &C::f , c, _1 ) );

Definition at line 59 of file creaImageIOGimmick.h.

00060     { mImageAdder.ConnectProgressObserver(callback); }

const AddProgress& creaImageIO::Gimmick::GetAddProgress (  )  const [inline]

Definition at line 64 of file creaImageIOGimmick.h.

00064 { return mImageAdder.GetProgress(); }

void creaImageIO::Gimmick::Initialize (  ) 

Initialize (read/creates databases, etc.).

Referenced by main().

Here is the caller graph for this function:

void creaImageIO::Gimmick::Finalize (  ) 

Finalize (closes databases, etc.).

Referenced by main().

Here is the caller graph for this function:

static void creaImageIO::Gimmick::SetMessageLevel ( int  level  )  [static]

Sets level for messages "Gimmick!".

Referenced by main().

Here is the caller graph for this function:

static void creaImageIO::Gimmick::SetDebugMessageLevel ( int  level  )  [static]

Sets level for debug messages "Gimmick! DEBUG".

Referenced by main().

Here is the caller graph for this function:

TreeHandlerMapType& creaImageIO::Gimmick::GetTreeHandlerMap (  )  [inline]

Returns the TreeHandlerMap (ref).

Definition at line 81 of file creaImageIOGimmick.h.

00081 { return mTreeHandlerMap; }

const TreeHandlerMapType& creaImageIO::Gimmick::GetTreeHandlerMap (  )  const [inline]

Returns the TreeHandlerMap (const ref).

Definition at line 83 of file creaImageIOGimmick.h.

00084     { return mTreeHandlerMap; }

void creaImageIO::Gimmick::AddFiles ( const std::string &  handler,
const std::vector< std::string > &  filenames 
)

Add the files to the given TreeHandler.

Referenced by main().

Here is the caller graph for this function:

void creaImageIO::Gimmick::AddDir ( const std::string &  handler,
const std::string &  path,
bool  recurse 
)

Add a dir to the given TreeHandler.

Referenced by main().

Here is the caller graph for this function:

void creaImageIO::Gimmick::RemoveFile ( const std::string &  d,
tree::Node filename 
)

Removes a file from the given TreeHandler.

void creaImageIO::Gimmick::DeleteDrive ( const std::string &  drive  ) 

Deletes the given drive name from the databases.

void creaImageIO::Gimmick::CopyFiles ( const std::vector< std::string > &  filenames,
const std::string &  d 
)

Copies the files into the local directory.

Referenced by main().

Here is the caller graph for this function:

std::string creaImageIO::Gimmick::Synchronize ( const std::string &  d,
bool  repair,
bool  checkAttributes 
)

Synchronizes the loaded data with the database d. If repair is true the database will be updated, otherwise only a warning sign will be issued

Referenced by main().

Here is the caller graph for this function:

void creaImageIO::Gimmick::Print ( const std::string &  handler  ) 

Prints the tree handled by the handler.

Referenced by main().

Here is the caller graph for this function:

SQLiteTreeHandler* creaImageIO::Gimmick::createDB ( const std::string &  i_name,
const std::string &  i_locDesc,
const std::string &  i_locDB 
)

create a DB from a given descriptor file and for a specific location

void creaImageIO::Gimmick::addDB ( const std::string &  i_nameDB,
const std::string &  i_locationDB 
)

TreeHandler* creaImageIO::Gimmick::GetTreeHandler ( const std::string &  name  )  const

Returns the TreeHandler with a given name.

Referenced by main().

Here is the caller graph for this function:

TimestampDatabaseHandler* creaImageIO::Gimmick::GetTimestampDatabase (  )  const

Returns the TimestampDatabase.

SQLiteTreeHandler* creaImageIO::Gimmick::GetLocalDatabase (  )  [inline]

Definition at line 128 of file creaImageIOGimmick.h.

00128 { return mLocalDatabase; }

const SQLiteTreeHandler* creaImageIO::Gimmick::GetLocalDatabase (  )  const [inline]

Definition at line 130 of file creaImageIOGimmick.h.

00131     { return mLocalDatabase; }

void creaImageIO::Gimmick::GetSetting ( const std::string &  name,
std::string &  value 
)

Returns the given setting value for the given setting parameter.

void creaImageIO::Gimmick::UpdateSetting ( const std::string &  name,
const std::string &  value 
)

Updates the settings file.

void creaImageIO::Gimmick::addDBSettings (  ) 

add DB from Settings file

void creaImageIO::Gimmick::EditField ( tree::Node node,
const std::string &  d,
const std::string &  name,
const std::string &  key,
const std::string &  val 
)

Edits the field described by the name and key provided with the value given.

void creaImageIO::Gimmick::GetAttributes ( const std::string &  d,
const std::string &  filename,
const std::vector< std::string > &  params,
std::vector< std::string > &  results 
)

Returns the attributes in results described in params.

const std::string& creaImageIO::Gimmick::GetHomeDirectory (  ) 

const std::string& creaImageIO::Gimmick::GetUserSettingsDirectory (  ) 

void creaImageIO::Gimmick::CreateUserSettingsDirectory (  ) 

const std::string& creaImageIO::Gimmick::GetLocalDatabasePath (  ) 

const std::string& creaImageIO::Gimmick::GetTimestampDatabasePath (  ) 


Member Data Documentation

SQLiteTreeHandler* creaImageIO::Gimmick::mLocalDatabase [private]

Definition at line 161 of file creaImageIOGimmick.h.

TimestampDatabaseHandler* creaImageIO::Gimmick::mTimestampDatabase [private]

Definition at line 162 of file creaImageIOGimmick.h.

TreeHandlerMapType creaImageIO::Gimmick::mTreeHandlerMap [private]

Definition at line 163 of file creaImageIOGimmick.h.

Synchronizer* creaImageIO::Gimmick::mSynchronizer [private]

Definition at line 164 of file creaImageIOGimmick.h.

std::string creaImageIO::Gimmick::mCurrentDirectory [private]

Definition at line 166 of file creaImageIOGimmick.h.

std::string creaImageIO::Gimmick::mHomeDirectory [private]

Definition at line 167 of file creaImageIOGimmick.h.

std::string creaImageIO::Gimmick::mUserSettingsDirectory [private]

Definition at line 168 of file creaImageIOGimmick.h.

std::string creaImageIO::Gimmick::mLocalDatabasePath [private]

Definition at line 169 of file creaImageIOGimmick.h.

std::string creaImageIO::Gimmick::mTimestampDatabasePath [private]

Definition at line 170 of file creaImageIOGimmick.h.

Settings* creaImageIO::Gimmick::mSettings [private]

Definition at line 171 of file creaImageIOGimmick.h.

TreeHandlerImageAdder creaImageIO::Gimmick::mImageAdder [private]

Definition at line 172 of file creaImageIOGimmick.h.


The documentation for this class was generated from the following file:
Generated on Mon Jun 22 10:49:57 2009 for CreaImageIO by  doxygen 1.5.3