30 #ifndef SOUTPUTMANAGER_HH 31 #define SOUTPUTMANAGER_HH 1 51 #define QUOTES(value) #value 52 #define TOSTRING(macro) QUOTES(macro) 55 #define CASTOR_CONFIG_STRING TOSTRING(CASTOR_CONFIG) 63 #define Cout(MESSAGE) \ 66 int mpi_rank; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ 69 std::cout << MESSAGE; \ 70 sOutputManager* instance = sOutputManager::GetInstance(); \ 73 ofstream& logMac = instance->GetLogFile(); \ 74 if (logMac) logMac << MESSAGE; \ 79 #define Cerr(MESSAGE) \ 82 int mpi_rank; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ 83 std::cerr << "***** The following error message was issued" \ 84 << " by MPI instance " << mpi_rank << endl; \ 85 std::cerr << MESSAGE; \ 86 sOutputManager* instance = sOutputManager::GetInstance(); \ 89 ofstream& logMac = instance->GetLogFile(); \ 92 logMac << "***** The following error message was issued"\ 93 << " by MPI instance " << mpi_rank << endl; \ 100 #define Cout(MESSAGE) \ 103 std::cout << MESSAGE; \ 104 sOutputManager* instance = sOutputManager::GetInstance(); \ 105 if (instance!=NULL) \ 107 ofstream& logMac = instance->GetLogFile(); \ 108 if (logMac) logMac << MESSAGE; \ 112 #define Cerr(MESSAGE) \ 115 std::cerr << MESSAGE; \ 116 sOutputManager* instance = sOutputManager::GetInstance(); \ 117 if (instance!=NULL) \ 119 ofstream& logMac = instance->GetLogFile(); \ 120 if (logMac) logMac << MESSAGE; \ 129 #define VERBOSE_LIGHT 1 130 #define VERBOSE_NORMAL 2 131 #define VERBOSE_DETAIL 3 132 #define VERBOSE_DEBUG_LIGHT 4 133 #define VERBOSE_DEBUG_NORMAL 5 134 #define VERBOSE_DEBUG_EVENT 6 135 #define VERBOSE_DEBUG_MAX 7 142 #ifndef CASTOR_VERBOSE 144 #define DEBUG_VERBOSE(IGNORED1,IGNORED2) ; 149 #if defined(_WIN32) && !defined(CASTOR_USE_MINGW) 150 #define DEBUG_VERBOSE(CURRENT_LEVEL,APPLICABLE_LEVEL) \ 153 if (CURRENT_LEVEL >= APPLICABLE_LEVEL) \ 155 cout << "+++++ " << __FUNCSIG__ \ 156 << " -> Entering this function" << endl; \ 161 #define DEBUG_VERBOSE(CURRENT_LEVEL,APPLICABLE_LEVEL) \ 164 if (CURRENT_LEVEL >= APPLICABLE_LEVEL) \ 166 cout << "+++++ " << __PRETTY_FUNCTION__ \ 167 << " -> 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)