8 #ifndef SOUTPUTMANAGER_HH 9 #define SOUTPUTMANAGER_HH 1 29 #define QUOTES(value) #value 30 #define TOSTRING(macro) QUOTES(macro) 33 #define CASTOR_CONFIG_STRING TOSTRING(CASTOR_CONFIG) 41 #define Cout(MESSAGE) \ 44 int mpi_rank; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ 47 std::cout << MESSAGE; \ 48 sOutputManager* instance = sOutputManager::GetInstance(); \ 51 ofstream& logMac = instance->GetLogFile(); \ 52 if (logMac) logMac << MESSAGE; \ 57 #define Cerr(MESSAGE) \ 60 int mpi_rank; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ 61 std::cerr << "***** The following error message was issued" \ 62 << " by MPI instance " << mpi_rank << endl; \ 63 std::cerr << MESSAGE; \ 64 sOutputManager* instance = sOutputManager::GetInstance(); \ 67 ofstream& logMac = instance->GetLogFile(); \ 70 logMac << "***** The following error message was issued"\ 71 << " by MPI instance " << mpi_rank << endl; \ 78 #define Cout(MESSAGE) \ 81 std::cout << MESSAGE; \ 82 sOutputManager* instance = sOutputManager::GetInstance(); \ 85 ofstream& logMac = instance->GetLogFile(); \ 86 if (logMac) logMac << MESSAGE; \ 90 #define Cerr(MESSAGE) \ 93 std::cerr << MESSAGE; \ 94 sOutputManager* instance = sOutputManager::GetInstance(); \ 97 ofstream& logMac = instance->GetLogFile(); \ 98 if (logMac) logMac << MESSAGE; \ 107 #define VERBOSE_LIGHT 1 108 #define VERBOSE_NORMAL 2 109 #define VERBOSE_DETAIL 3 110 #define VERBOSE_DEBUG_LIGHT 4 111 #define VERBOSE_DEBUG_NORMAL 5 112 #define VERBOSE_DEBUG_EVENT 6 113 #define VERBOSE_DEBUG_MAX 7 120 #ifndef CASTOR_VERBOSE 122 #define DEBUG_VERBOSE(IGNORED1,IGNORED2) ; 127 #if defined(_WIN32) && !defined(CASTOR_USE_MINGW) 128 #define DEBUG_VERBOSE(CURRENT_LEVEL,APPLICABLE_LEVEL) \ 131 if (CURRENT_LEVEL >= APPLICABLE_LEVEL) \ 133 cout << "+++++ " << __FUNCSIG__ \ 134 << " -> Entering this function" << endl; \ 139 #define DEBUG_VERBOSE(CURRENT_LEVEL,APPLICABLE_LEVEL) \ 142 if (CURRENT_LEVEL >= APPLICABLE_LEVEL) \ 144 cout << "+++++ " << __PRETTY_FUNCTION__ \ 145 << " -> Entering this function" << endl; \ void operator=(sOutputManager const &)
void SetVerbose(int a_verbose)
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)
int LogCommandLine(int argc, char **argv)
This header file is mainly used to declare some macro definitions and all includes needed from the st...
int CheckConfigDir(const string &a_path)
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)
void SetMPIRank(int a_mpiRank)
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)
This class is designed to manage all dimensions and quantification related stuff. ...
~sOutputManager()
sOutputManager destructor.
void SetDataFileName(vector< string > ap_dataFileName)
vector< string > mp_dataFileName