31 #ifndef SOUTPUTMANAGER_HH
32 #define SOUTPUTMANAGER_HH 1
52 #define QUOTES(value) #value
53 #define TOSTRING(macro) QUOTES(macro)
56 #define CASTOR_CONFIG_STRING TOSTRING(CASTOR_CONFIG)
64 #define Cout(MESSAGE) \
67 int mpi_rank; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \
70 std::cout << MESSAGE; \
71 sOutputManager* instance = sOutputManager::GetInstance(); \
74 ofstream& logMac = instance->GetLogFile(); \
75 if (logMac) logMac << MESSAGE; \
80 #define Cerr(MESSAGE) \
83 int mpi_rank; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \
84 std::cerr << "***** The following error message was issued" \
85 << " by MPI instance " << mpi_rank << endl; \
86 std::cerr << MESSAGE; \
87 sOutputManager* instance = sOutputManager::GetInstance(); \
90 ofstream& logMac = instance->GetLogFile(); \
93 logMac << "***** The following error message was issued"\
94 << " by MPI instance " << mpi_rank << endl; \
101 #define Cout(MESSAGE) \
104 std::cout << MESSAGE; \
105 sOutputManager* instance = sOutputManager::GetInstance(); \
106 if (instance!=NULL) \
108 ofstream& logMac = instance->GetLogFile(); \
109 if (logMac) logMac << MESSAGE; \
113 #define Cerr(MESSAGE) \
116 std::cerr << MESSAGE; \
117 sOutputManager* instance = sOutputManager::GetInstance(); \
118 if (instance!=NULL) \
120 ofstream& logMac = instance->GetLogFile(); \
121 if (logMac) logMac << MESSAGE; \
130 #define VERBOSE_LIGHT 1
131 #define VERBOSE_NORMAL 2
132 #define VERBOSE_DETAIL 3
133 #define VERBOSE_DEBUG_LIGHT 4
134 #define VERBOSE_DEBUG_NORMAL 5
135 #define VERBOSE_DEBUG_EVENT 6
136 #define VERBOSE_DEBUG_MAX 7
143 #ifndef CASTOR_VERBOSE
145 #define DEBUG_VERBOSE(IGNORED1,IGNORED2) ;
150 #if defined(_WIN32) && !defined(CASTOR_USE_MINGW)
151 #define DEBUG_VERBOSE(CURRENT_LEVEL,APPLICABLE_LEVEL) \
154 if (CURRENT_LEVEL >= APPLICABLE_LEVEL) \
156 cout << "+++++ " << __FUNCSIG__ \
157 << " -> Entering this function" << endl; \
162 #define DEBUG_VERBOSE(CURRENT_LEVEL,APPLICABLE_LEVEL) \
165 if (CURRENT_LEVEL >= APPLICABLE_LEVEL) \
167 cout << "+++++ " << __PRETTY_FUNCTION__ \
168 << " -> Entering this function" << endl; \
This header file is mainly used to declare some macro definitions and all includes needed from the st...
void operator=(sOutputManager const &)
void SetVerbose(int a_verbose)
set verbosity
vector< string > mp_dataFileName
sOutputManager()
sOutputManager constructor.
bool m_mergeOutputDynImgFlag
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
int SetOutNbPrec(string a_format)
Set the output format and precision used for numeric display.
int LogCommandLine(int argc, char **argv)
Write log file header with the provided command line options and different informations.
int CheckConfigDir(const string &a_path)
Set the path to the CASTOR config directory from the given path if not empty or through the existence...
const string & GetPathName()
Singleton class that manages output writing on disk (images, sinograms, etc). It also manages loggi...
const string & GetPathToConfigDir()
Return the path to the CASTOR config directory.
sOutputManager(sOutputManager const &)
void SetMergeDynImagesFlag(bool a_flag)
Set to on the flag indicating that a dynamic serie of 3D images should be written on disk in one file...
void SetMPIRank(int a_mpiRank)
Initialize the machine index for MPI.
static sOutputManager * mp_Instance
const string & GetBaseName()
bool MergeDynImages()
Indicate if a dynamic serie of 3D images should be merged in one file (true) or written on disk as on...
vector< string > GetDataFileName()
int InitOutputDirectory(const string &a_pathFout, const string &a_pathDout)
Create the output directory if any, extract the base name and create the log file.
This class is designed to manage all dimensions and quantification related stuff. ...
~sOutputManager()
sOutputManager destructor.
void SetDataFileName(vector< string > ap_dataFileName)