MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Class encapsulating a single MDSTk module. More...
#include <mdsModule.h>
Public Types | |
enum | { CLASS_OBJECT } |
Templates that require members of the CObject class can use this enum to check the existence. More... | |
enum | { HEAP_OBJECT = 0x70616568 } |
Signature used to recognize objects on the heap. More... | |
Public Member Functions | |
void | allowArguments (const std::string &sArgs) |
Additinal command line arguments should be specified. | |
CModule (const std::string &sDescription) | |
Default constructor. | |
void | exit () |
Exits the application. | |
CArgv * | getArguments () |
Returns pointer to the parsed command line arguments. | |
const std::string & | getDescription () const |
Returns the application description. | |
const std::string & | getFilename () const |
Returns real name of the executed binary application. | |
CChannel * | getInput (int i) |
Retreives an i-th input channel. | |
int | getNumOfInputs () const |
Returns a number of input channels. | |
int | getNumOfOutputs () const |
Number of output channels. | |
CChannel * | getOutput (int i) |
Retreives an i-th output channel. | |
int | getReferencesCount () const |
Returns the number of references. | |
bool | init (int argc, char *argv[]) |
Initializes module and parses a given command line. | |
bool | isActive () |
Returns true whenever the processing thread is running. | |
bool | isOnHeap () const |
Returns true if the object is allocated on the heap. | |
virtual bool | main ()=0 |
Virtual method repeatedly called by the processing thread. | |
MDS_SHAREDPTR (CModule) | |
Smart pointer type. | |
MDS_SHAREDPTR (CConsole) | |
Smart pointer type. | |
void | printFullUsage () |
Writes a full help. | |
void | printUsage () |
Writes a simple usage to the given stream. | |
template<typename T > | |
bool | readInput (CChannel *pChannel, T *pObject) |
Reads a data entity from the input channel. | |
bool | run () |
Executes processing thread and console I/O. | |
virtual void | shutdown ()=0 |
Called on module shutdown. | |
virtual bool | startup ()=0 |
Virtual method called on module startup. | |
virtual void | writeExtendedUsage (std::ostream &Stream)=0 |
Called on writing a full usage statement. | |
template<typename T > | |
bool | writeOutput (CChannel *pChannel, T *pObject) |
Writes a given data entity to the channel. | |
virtual | ~CModule () |
Virtual destructor. | |
Static Public Member Functions | |
static void * | operator new (std::size_t Size) |
Allocates a new object on the heap. | |
Protected Types | |
typedef std::vector< CChannelPtr > | tChannels |
Vector of i/o channels. | |
Protected Member Functions | |
void | addReference () const |
Increase the reference counter. | |
bool | delReference () const |
Decrease the reference counter. | |
Static Protected Member Functions | |
static int | threadRoutine (mds::sys::CThread *pThread) |
The main thread routine. | |
Protected Attributes | |
CArgv | m_Arguments |
Parsed command line arguments. | |
bool | m_bRawData |
Write raw data. | |
bool | m_bXMLData |
Experimental XML output. | |
mds::sys::CExitHandler | m_ExitHandler |
Exit handler. | |
int | m_iHeapObject |
Flag initialized if the object is on the heap. | |
tChannels | m_InputChannels |
Application input channels. | |
int | m_iReferences |
The number of references to the object. | |
tChannels | m_OutputChannels |
Output channels. | |
std::string | m_sAllowedArguments |
Allowed command line arguments. | |
std::string | m_sDescription |
Application description. | |
std::string | m_sFilename |
Application filename. | |
mds::sys::CThread | m_Thread |
Processing thread. |
Class encapsulating a single MDSTk module.
typedef std::vector<CChannelPtr> mds::mod::CModule::tChannels [protected] |
Vector of i/o channels.
anonymous enum [inherited] |
Templates that require members of the CObject class can use this enum to check the existence.
mds::mod::CModule::CModule | ( | const std::string & | sDescription | ) |
Default constructor.
mds::mod::CModule::~CModule | ( | ) | [virtual] |
Virtual destructor.
void mds::base::CObject::addReference | ( | ) | const [protected, inherited] |
Increase the reference counter.
void mds::mod::CConsole::allowArguments | ( | const std::string & | sArgs | ) | [inherited] |
Additinal command line arguments should be specified.
bool mds::base::CObject::delReference | ( | ) | const [protected, inherited] |
Decrease the reference counter.
void mds::mod::CConsole::exit | ( | ) | [inherited] |
Exits the application.
CArgv* mds::mod::CConsole::getArguments | ( | ) | [inherited] |
Returns pointer to the parsed command line arguments.
const std::string& mds::mod::CConsole::getDescription | ( | ) | const [inherited] |
Returns the application description.
const std::string& mds::mod::CConsole::getFilename | ( | ) | const [inherited] |
Returns real name of the executed binary application.
Retreives an i-th input channel.
int mds::mod::CModule::getNumOfInputs | ( | ) | const |
Returns a number of input channels.
int mds::mod::CModule::getNumOfOutputs | ( | ) | const |
Number of output channels.
Retreives an i-th output channel.
int mds::base::CObject::getReferencesCount | ( | ) | const [inherited] |
Returns the number of references.
bool mds::mod::CModule::init | ( | int | argc, |
char * | argv[] | ||
) | [virtual] |
Initializes module and parses a given command line.
Reimplemented from mds::mod::CConsole.
bool mds::mod::CConsole::isActive | ( | ) | [inherited] |
Returns true whenever the processing thread is running.
bool mds::base::CObject::isOnHeap | ( | ) | const [inherited] |
Returns true if the object is allocated on the heap.
virtual bool mds::mod::CModule::main | ( | ) | [pure virtual] |
Virtual method repeatedly called by the processing thread.
Implements mds::mod::CConsole.
Smart pointer type.
mds::mod::CConsole::MDS_SHAREDPTR | ( | CConsole | ) | [inherited] |
Smart pointer type.
static void* mds::base::CObject::operator new | ( | std::size_t | Size | ) | [static, inherited] |
Allocates a new object on the heap.
void mds::mod::CModule::printFullUsage | ( | ) | [virtual] |
Writes a full help.
Reimplemented from mds::mod::CConsole.
void mds::mod::CModule::printUsage | ( | ) | [virtual] |
Writes a simple usage to the given stream.
Reimplemented from mds::mod::CConsole.
bool mds::mod::CModule::readInput | ( | CChannel * | pChannel, |
T * | pObject | ||
) |
Reads a data entity from the input channel.
bool mds::mod::CConsole::run | ( | ) | [inherited] |
Executes processing thread and console I/O.
virtual void mds::mod::CModule::shutdown | ( | ) | [pure virtual] |
Called on module shutdown.
Implements mds::mod::CConsole.
virtual bool mds::mod::CModule::startup | ( | ) | [pure virtual] |
Virtual method called on module startup.
Implements mds::mod::CConsole.
static int mds::mod::CConsole::threadRoutine | ( | mds::sys::CThread * | pThread | ) | [static, protected, inherited] |
The main thread routine.
virtual void mds::mod::CModule::writeExtendedUsage | ( | std::ostream & | Stream | ) | [pure virtual] |
Called on writing a full usage statement.
Implements mds::mod::CConsole.
bool mds::mod::CModule::writeOutput | ( | CChannel * | pChannel, |
T * | pObject | ||
) |
Writes a given data entity to the channel.
CArgv mds::mod::CConsole::m_Arguments [protected, inherited] |
Parsed command line arguments.
bool mds::mod::CModule::m_bRawData [protected] |
Write raw data.
bool mds::mod::CModule::m_bXMLData [protected] |
Experimental XML output.
mds::sys::CExitHandler mds::mod::CConsole::m_ExitHandler [protected, inherited] |
Exit handler.
int mds::base::CObject::m_iHeapObject [mutable, protected, inherited] |
Flag initialized if the object is on the heap.
tChannels mds::mod::CModule::m_InputChannels [protected] |
Application input channels.
int mds::base::CObject::m_iReferences [mutable, protected, inherited] |
The number of references to the object.
tChannels mds::mod::CModule::m_OutputChannels [protected] |
Output channels.
std::string mds::mod::CConsole::m_sAllowedArguments [protected, inherited] |
Allowed command line arguments.
std::string mds::mod::CConsole::m_sDescription [protected, inherited] |
Application description.
std::string mds::mod::CConsole::m_sFilename [protected, inherited] |
Application filename.
mds::sys::CThread mds::mod::CConsole::m_Thread [protected, inherited] |
Processing thread.