MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
The class encapsulating input and visualization functions. More...
#include <mdsView.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. | |
CView (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 | getReferencesCount () const |
Returns the number of references. | |
bool | init (int argc, char *argv[]) |
Initializes application 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 called by the processing thread. | |
MDS_SHAREDPTR (CView) | |
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 console shutdown. | |
virtual bool | startup ()=0 |
Virtual method called on startup. | |
virtual void | writeExtendedUsage (std::ostream &Stream)=0 |
Called on writing a usage statement. | |
virtual | ~CView () |
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. | |
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. | |
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. |
The class encapsulating input and visualization functions.
typedef std::vector<CChannelPtr> mds::mod::CView::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::CView::CView | ( | const std::string & | sDescription | ) |
Default constructor.
mds::mod::CView::~CView | ( | ) | [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.
CChannel * mds::mod::CView::getInput | ( | int | i | ) |
Retreives an i-th input channel.
int mds::mod::CView::getNumOfInputs | ( | ) | const |
Returns a number of input channels.
int mds::base::CObject::getReferencesCount | ( | ) | const [inherited] |
Returns the number of references.
bool mds::mod::CView::init | ( | int | argc, |
char * | argv[] | ||
) | [virtual] |
Initializes application 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::CView::main | ( | ) | [pure virtual] |
Virtual method 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::CView::printFullUsage | ( | ) | [virtual] |
Writes a full help.
Reimplemented from mds::mod::CConsole.
void mds::mod::CView::printUsage | ( | ) | [virtual] |
Writes a simple usage to the given stream.
Reimplemented from mds::mod::CConsole.
bool mds::mod::CView::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::CView::shutdown | ( | ) | [pure virtual] |
Called on console shutdown.
Implements mds::mod::CConsole.
virtual bool mds::mod::CView::startup | ( | ) | [pure virtual] |
Virtual method called on 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::CView::writeExtendedUsage | ( | std::ostream & | Stream | ) | [pure virtual] |
Called on writing a usage statement.
Implements mds::mod::CConsole.
CArgv mds::mod::CConsole::m_Arguments [protected, inherited] |
Parsed command line arguments.
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::CView::m_InputChannels [protected] |
Application input channels.
int mds::base::CObject::m_iReferences [mutable, protected, inherited] |
The number of references to the object.
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.