CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
sOutputManager Class Reference

Singleton class that manages output writing on disk (images, sinograms, etc).
It also manages logging and printing on screen. More...

#include <sOutputManager.hh>

Collaboration diagram for sOutputManager:
Collaboration graph

Public Member Functions

void SetVerbose (int a_verbose)
 
void SetDataFileName (vector< string > ap_dataFileName)
 
ofstream & GetLogFile ()
 
const string & GetBaseName ()
 
const string & GetPathName ()
 
vector< string > GetDataFileName ()
 
void SetMPIRank (int a_mpiRank)
 
void SetMergeDynImagesFlag (bool a_flag)
 
bool MergeDynImages ()
 Indicate if a dynamic serie of 3D images should be merged in one file (true) or written on disk as one file for each 3D image, associated with an Interfile metaheader. More...
 
int SetOutNbPrec (string a_format)
 
int CheckConfigDir (const string &a_path)
 
const string & GetPathToConfigDir ()
 Return the path to the CASTOR config directory. More...
 
int InitOutputDirectory (const string &a_pathFout, const string &a_pathDout)
 
int LogCommandLine (int argc, char **argv)
 
void SetVerbose (int a_verbose)
 
void SetDataFileName (vector< string > ap_dataFileName)
 
ofstream & GetLogFile ()
 
const string & GetBaseName ()
 
const string & GetPathName ()
 
vector< string > GetDataFileName ()
 
void SetMPIRank (int a_mpiRank)
 
void SetMergeDynImagesFlag (bool a_flag)
 
bool MergeDynImages ()
 
int SetOutNbPrec (string a_format)
 
int CheckConfigDir (const string &a_path)
 
const string & GetPathToConfigDir ()
 
int InitOutputDirectory (const string &a_pathFout, const string &a_pathDout)
 
int LogCommandLine (int argc, char **argv)
 

Static Public Member Functions

static sOutputManagerGetInstance ()
 Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise. More...
 
static sOutputManagerGetInstance ()
 

Private Member Functions

 sOutputManager ()
 sOutputManager constructor. More...
 
 ~sOutputManager ()
 sOutputManager destructor. More...
 
 sOutputManager (sOutputManager const &)
 
void operator= (sOutputManager const &)
 
 sOutputManager ()
 sOutputManager constructor. More...
 
 ~sOutputManager ()
 sOutputManager destructor. More...
 
 sOutputManager (sOutputManager const &)
 
void operator= (sOutputManager const &)
 

Private Attributes

int m_verbose
 
int m_mpiRank
 
string m_baseName
 
string m_pathName
 
string m_pathToConfigDir
 
vector< string > mp_dataFileName
 
ofstream m_logFile
 
bool m_mergeOutputDynImgFlag
 

Static Private Attributes

static sOutputManagermp_Instance = NULL
 

Detailed Description

Singleton class that manages output writing on disk (images, sinograms, etc).
It also manages logging and printing on screen.

Definition at line 171 of file code/include/management/sOutputManager.hh.

Constructor & Destructor Documentation

◆ sOutputManager() [1/4]

sOutputManager::sOutputManager ( )
private

sOutputManager constructor.

It is private at this class is singleton. It should be instanciated using the GetInstance() function Initialize the member variables to their default values.

Definition at line 46 of file code/src/management/sOutputManager.cc.

Here is the caller graph for this function:

◆ ~sOutputManager() [1/2]

sOutputManager::~sOutputManager ( )
private

sOutputManager destructor.

Definition at line 71 of file code/src/management/sOutputManager.cc.

Here is the caller graph for this function:

◆ sOutputManager() [2/4]

sOutputManager::sOutputManager ( sOutputManager const &  )
inlineprivate

Definition at line 317 of file code/include/management/sOutputManager.hh.

◆ sOutputManager() [3/4]

sOutputManager::sOutputManager ( )
private

sOutputManager constructor.

It is private at this class is singleton. It should be instanciated using the GetInstance() function Initialize the member variables to their default values.

◆ ~sOutputManager() [2/2]

sOutputManager::~sOutputManager ( )
private

sOutputManager destructor.

◆ sOutputManager() [4/4]

sOutputManager::sOutputManager ( sOutputManager const &  )
inlineprivate

Definition at line 317 of file include/management/sOutputManager.hh.

Member Function Documentation

◆ CheckConfigDir() [1/2]

int sOutputManager::CheckConfigDir ( const string &  a_path)

Definition at line 91 of file code/src/management/sOutputManager.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckConfigDir() [2/2]

int sOutputManager::CheckConfigDir ( const string &  a_path)

◆ GetBaseName() [1/2]

const string& sOutputManager::GetBaseName ( )
inline

Definition at line 215 of file include/management/sOutputManager.hh.

◆ GetBaseName() [2/2]

const string & sOutputManager::GetBaseName ( )
inline
Returns
the string containing the output image base name

Definition at line 215 of file code/include/management/sOutputManager.hh.

Here is the caller graph for this function:

◆ GetDataFileName() [1/2]

vector<string> sOutputManager::GetDataFileName ( )
inline

Definition at line 227 of file include/management/sOutputManager.hh.

◆ GetDataFileName() [2/2]

vector< string > sOutputManager::GetDataFileName ( )
inline
Returns
recover datafile names

Definition at line 227 of file code/include/management/sOutputManager.hh.

Here is the caller graph for this function:

◆ GetInstance() [1/2]

static sOutputManager* sOutputManager::GetInstance ( )
inlinestatic

Definition at line 182 of file include/management/sOutputManager.hh.

Here is the call graph for this function:

◆ GetInstance() [2/2]

static sOutputManager * sOutputManager::GetInstance ( )
inlinestatic

Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.

Returns
instance of the sOutputManager singleton

Definition at line 182 of file code/include/management/sOutputManager.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLogFile() [1/2]

ofstream & sOutputManager::GetLogFile ( )
inline
Returns
the ofstream object for the log file

Definition at line 209 of file code/include/management/sOutputManager.hh.

◆ GetLogFile() [2/2]

ofstream& sOutputManager::GetLogFile ( )
inline

Definition at line 209 of file include/management/sOutputManager.hh.

◆ GetPathName() [1/2]

const string& sOutputManager::GetPathName ( )
inline

Definition at line 221 of file include/management/sOutputManager.hh.

◆ GetPathName() [2/2]

const string & sOutputManager::GetPathName ( )
inline
Returns
the string containing the path to the output directory

Definition at line 221 of file code/include/management/sOutputManager.hh.

Here is the caller graph for this function:

◆ GetPathToConfigDir() [1/2]

const string & sOutputManager::GetPathToConfigDir ( )

Return the path to the CASTOR config directory.

Just return the path if it has already been initialized Otherwise, the function recovers the path from environnement variables If any error, the working directory is returned instead

Returns
astring containing path to the CASToR configuration directory

Definition at line 145 of file code/src/management/sOutputManager.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPathToConfigDir() [2/2]

const string& sOutputManager::GetPathToConfigDir ( )

◆ InitOutputDirectory() [1/2]

int sOutputManager::InitOutputDirectory ( const string &  a_pathFout,
const string &  a_pathDout 
)

Definition at line 200 of file code/src/management/sOutputManager.cc.

Here is the caller graph for this function:

◆ InitOutputDirectory() [2/2]

int sOutputManager::InitOutputDirectory ( const string &  a_pathFout,
const string &  a_pathDout 
)

◆ LogCommandLine() [1/2]

int sOutputManager::LogCommandLine ( int  argc,
char **  argv 
)

◆ LogCommandLine() [2/2]

int sOutputManager::LogCommandLine ( int  argc,
char **  argv 
)

Definition at line 318 of file code/src/management/sOutputManager.cc.

Here is the caller graph for this function:

◆ MergeDynImages() [1/2]

bool sOutputManager::MergeDynImages ( )
inline

Definition at line 251 of file include/management/sOutputManager.hh.

Here is the call graph for this function:

◆ MergeDynImages() [2/2]

bool sOutputManager::MergeDynImages ( )
inline

Indicate if a dynamic serie of 3D images should be merged in one file (true) or written on disk as one file for each 3D image, associated with an Interfile metaheader.

Returns
true if images should be merged in one file, false otherwise.

Definition at line 251 of file code/include/management/sOutputManager.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

void sOutputManager::operator= ( sOutputManager const &  )
inlineprivate

Definition at line 318 of file code/include/management/sOutputManager.hh.

◆ operator=() [2/2]

void sOutputManager::operator= ( sOutputManager const &  )
inlineprivate

Definition at line 318 of file include/management/sOutputManager.hh.

◆ SetDataFileName() [1/2]

void sOutputManager::SetDataFileName ( vector< string >  ap_dataFileName)
inline

Definition at line 203 of file include/management/sOutputManager.hh.

◆ SetDataFileName() [2/2]

void sOutputManager::SetDataFileName ( vector< string >  ap_dataFileName)
inline

Definition at line 203 of file code/include/management/sOutputManager.hh.

Here is the caller graph for this function:

◆ SetMergeDynImagesFlag() [1/2]

void sOutputManager::SetMergeDynImagesFlag ( bool  a_flag)
inline

Definition at line 243 of file include/management/sOutputManager.hh.

◆ SetMergeDynImagesFlag() [2/2]

void sOutputManager::SetMergeDynImagesFlag ( bool  a_flag)
inline

Definition at line 243 of file code/include/management/sOutputManager.hh.

Here is the caller graph for this function:

◆ SetMPIRank() [1/2]

void sOutputManager::SetMPIRank ( int  a_mpiRank)
inline

Definition at line 234 of file code/include/management/sOutputManager.hh.

Here is the caller graph for this function:

◆ SetMPIRank() [2/2]

void sOutputManager::SetMPIRank ( int  a_mpiRank)
inline

Definition at line 234 of file include/management/sOutputManager.hh.

◆ SetOutNbPrec() [1/2]

int sOutputManager::SetOutNbPrec ( string  a_format)

◆ SetOutNbPrec() [2/2]

int sOutputManager::SetOutNbPrec ( string  a_format)

Definition at line 370 of file code/src/management/sOutputManager.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVerbose() [1/2]

void sOutputManager::SetVerbose ( int  a_verbose)
inline

Definition at line 197 of file include/management/sOutputManager.hh.

◆ SetVerbose() [2/2]

void sOutputManager::SetVerbose ( int  a_verbose)
inline

Definition at line 197 of file code/include/management/sOutputManager.hh.

Here is the caller graph for this function:

Member Data Documentation

◆ m_baseName

string sOutputManager::m_baseName
private

String containing the image base name

Definition at line 327 of file code/include/management/sOutputManager.hh.

◆ m_logFile

ofstream sOutputManager::m_logFile
private

File object for the output log file

Definition at line 331 of file code/include/management/sOutputManager.hh.

◆ m_mergeOutputDynImgFlag

bool sOutputManager::m_mergeOutputDynImgFlag
private

Flag indicating if dynamic image should be written on disk as one file (true), or a serie of 3D image associated with a metaheader (false). Default: false

Definition at line 332 of file code/include/management/sOutputManager.hh.

◆ m_mpiRank

int sOutputManager::m_mpiRank
private

Machine index for MPI

Definition at line 326 of file code/include/management/sOutputManager.hh.

◆ m_pathName

string sOutputManager::m_pathName
private

String containing the path to the output directory

Definition at line 328 of file code/include/management/sOutputManager.hh.

◆ m_pathToConfigDir

string sOutputManager::m_pathToConfigDir
private

String containing the path to the CASToR configuration directory

Definition at line 329 of file code/include/management/sOutputManager.hh.

◆ m_verbose

int sOutputManager::m_verbose
private

Verbosity

Definition at line 325 of file code/include/management/sOutputManager.hh.

◆ mp_dataFileName

vector< string > sOutputManager::mp_dataFileName
private

String containing the datafile name(s)

Definition at line 330 of file code/include/management/sOutputManager.hh.

◆ mp_Instance

sOutputManager * sOutputManager::mp_Instance = NULL
staticprivate

Pointer to this singleton object

Definition at line 318 of file code/include/management/sOutputManager.hh.


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