CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Signals | Public Member Functions | List of all members
ctkCmdLineModuleDirectoryWatcher Class Reference

Provides directory scanning and file watching via QFileSystemWatcher to automatically load new modules into a ctkCmdLineModuleManager. More...

#include <Libs/CommandLineModules/Core/ctkCmdLineModuleDirectoryWatcher.h>

Inheritance diagram for ctkCmdLineModuleDirectoryWatcher:
Inheritance graph
[legend]
Collaboration diagram for ctkCmdLineModuleDirectoryWatcher:
Collaboration graph
[legend]

Signals

void errorDetected (const QString &)
 Signals that an error was detected, and the caller should raise an error to the user. More...
 

Public Member Functions

QStringList additionalModules () const
 Gets the list of additional command line executable, where "additional" means "in addition to those directories we are watching". More...
 
QStringList commandLineModules () const
 Returns the complete list of files (command line executables) currently being watched. More...
 
 ctkCmdLineModuleDirectoryWatcher (ctkCmdLineModuleManager *moduleManager)
 
QStringList directories () const
 Returns the list of directories currently being watched. More...
 
void emitErrorDectectedSignal (const QString &)
 public method to emit the errorDetected signal. More...
 
void setAdditionalModules (const QStringList &files)
 Sets an additional list of command line executables to watch. More...
 
void setDebug (bool debug)
 Set the watcher into debug mode, for more output. More...
 
void setDirectories (const QStringList &directories)
 Set the directories to be watched. More...
 
virtual ~ctkCmdLineModuleDirectoryWatcher ()
 

Detailed Description

Provides directory scanning and file watching via QFileSystemWatcher to automatically load new modules into a ctkCmdLineModuleManager.

Author
m.cla.nosp@m.rkso.nosp@m.n@ucl.nosp@m..ac..nosp@m.uk

This class can be used in 3 ways.

  1. The user can provide a set of directories by calling setDirectories(). These directories are scanned for valid command line executables, which are registered with the ctkCmdLineModuleManager. The QFileSystemWatcher then watches for any changes in these directories and files.

OR

  1. The user can directly provide a list of files, which should be valid command line executables, which are registered with the ctkCmdLineModuleManager and the QFileSystemWatcher then watches for changes in these files.

OR

  1. Both of the above. In this case, the set of files specified must not be contained within the set of directories specified. For this reason, we have "setDirectories", and then "setAdditionalModules", as the list of files should be considered as being "in addition" to any directories we are watching.

If either directories or files are invalid (not existing, not executable etc), they are filtered out and ignored.

Definition at line 63 of file ctkCmdLineModuleDirectoryWatcher.h.

Constructor & Destructor Documentation

◆ ctkCmdLineModuleDirectoryWatcher()

ctkCmdLineModuleDirectoryWatcher::ctkCmdLineModuleDirectoryWatcher ( ctkCmdLineModuleManager moduleManager)

◆ ~ctkCmdLineModuleDirectoryWatcher()

virtual ctkCmdLineModuleDirectoryWatcher::~ctkCmdLineModuleDirectoryWatcher ( )
virtual

Member Function Documentation

◆ additionalModules()

QStringList ctkCmdLineModuleDirectoryWatcher::additionalModules ( ) const

Gets the list of additional command line executable, where "additional" means "in addition to those directories we are watching".

◆ commandLineModules()

QStringList ctkCmdLineModuleDirectoryWatcher::commandLineModules ( ) const

Returns the complete list of files (command line executables) currently being watched.

◆ directories()

QStringList ctkCmdLineModuleDirectoryWatcher::directories ( ) const

Returns the list of directories currently being watched.

◆ emitErrorDectectedSignal()

void ctkCmdLineModuleDirectoryWatcher::emitErrorDectectedSignal ( const QString &  )

public method to emit the errorDetected signal.

◆ errorDetected

void ctkCmdLineModuleDirectoryWatcher::errorDetected ( const QString &  )
signal

Signals that an error was detected, and the caller should raise an error to the user.

◆ setAdditionalModules()

void ctkCmdLineModuleDirectoryWatcher::setAdditionalModules ( const QStringList &  files)

Sets an additional list of command line executables to watch.

Parameters
filesa list of file names. If any of these file names are not valid command line executables, they will be filtered out and ignored.

◆ setDebug()

void ctkCmdLineModuleDirectoryWatcher::setDebug ( bool  debug)

Set the watcher into debug mode, for more output.

Parameters
debugif true, you get more output on the console, otherwise, less output.

◆ setDirectories()

void ctkCmdLineModuleDirectoryWatcher::setDirectories ( const QStringList &  directories)

Set the directories to be watched.

Parameters
directoriesa list of directory names. If any of these are invalid, they will be filtered out and ignored.

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