Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:51:49

0001 #ifndef PARTONS_H
0002 #define PARTONS_H
0003 
0004 /**
0005  * @file Partons.h
0006  * @author Bryan BERTHOU (SPhN / CEA Saclay)
0007  * @date April 21, 2015
0008  * @version 1.0
0009  */
0010 
0011 #include <string>
0012 
0013 namespace ElemUtils {
0014 class LoggerManager;
0015 } /* namespace ElemUtils */
0016 
0017 namespace PARTONS {
0018 
0019 class BaseObjectFactory;
0020 class BaseObjectRegistry;
0021 class ModuleObjectFactory;
0022 class ServiceObjectRegistry;
0023 
0024 /**
0025  * @class Partons
0026  *
0027  * @brief
0028  */
0029 class Partons {
0030 public:
0031     static const std::string PROPERTIES_FILE_NAME;
0032 
0033     /**
0034      * Share a unique pointer of this class
0035      */
0036     static Partons* getInstance();
0037 
0038     /**
0039      * Default destructor
0040      */
0041     virtual ~Partons();
0042 
0043     /**
0044      * Must be called before any other thing.
0045      * It initializes each mandatory bloc in right order.
0046      *
0047      * @param argc
0048      * @param argv
0049      */
0050     void init(int argc, char** argv);
0051 
0052     /**
0053      * Called at the very end of the code.
0054      * Send close order to the LoggerManager and wait to the end of the job (flush of the logger buffer) before free memory.
0055      */
0056     void close();
0057 
0058     std::string getCurrentWorkingDirectory();
0059 
0060     BaseObjectRegistry* getBaseObjectRegistry() const;
0061     ServiceObjectRegistry* getServiceObjectRegistry() const;
0062     BaseObjectFactory* getBaseObjectFactory() const;
0063     ModuleObjectFactory* getModuleObjectFactory() const;
0064     ElemUtils::LoggerManager* getLoggerManager() const;
0065 
0066     //TODO vérifier tous les ElemUtils::CustomException des fois il manque la directive throw.
0067 
0068 private:
0069     /**
0070      * Private pointer of this class for a unique instance
0071      */
0072     static Partons* m_pInstance;
0073 
0074     /**
0075      * Default constructor
0076      */
0077     Partons();
0078 
0079     BaseObjectRegistry* m_pBaseObjectRegistry;
0080     ServiceObjectRegistry* m_pServiceObjectRegistry;
0081     BaseObjectFactory* m_pBaseObjectFactory;
0082     ModuleObjectFactory* m_pModuleObjectFactory;
0083     ElemUtils::LoggerManager* m_pLoggerManager;
0084 
0085     std::string m_currentWorkingDirectoryPath;
0086 
0087     /**
0088      * Check if "partons.properties" file path is readable. Throw exception else.
0089      */
0090     void checkMandatoryFiles();
0091 
0092     /**
0093      * Prints information about the version to Logger.
0094      */
0095     void printVersion() const;
0096 };
0097 
0098 } /* namespace PARTONS */
0099 
0100 #endif /* PARTONS_H */