1 | #ifndef __XMLIO_CXMLIOManager__ |
---|
2 | #define __XMLIO_CXMLIOManager__ |
---|
3 | |
---|
4 | /// xmlioserver headers /// |
---|
5 | #include "xmlioserver_spl.hpp" |
---|
6 | #include "exception.hpp" |
---|
7 | #include "mpi_manager.hpp" |
---|
8 | |
---|
9 | namespace xmlioserver |
---|
10 | { |
---|
11 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
12 | class CXIOSManager |
---|
13 | { |
---|
14 | public : |
---|
15 | |
---|
16 | /// Définition de type /// |
---|
17 | typedef enum _xios_type |
---|
18 | { CLIENT_SERVER = 0 , CLIENT, SERVER } XIOSType; |
---|
19 | |
---|
20 | typedef struct |
---|
21 | { |
---|
22 | StdSize nbClient; |
---|
23 | StdSize nbClientPServer; |
---|
24 | void (*entry)(comm::MPIComm, comm::MPIComm, comm::MPIComm) ; |
---|
25 | } XIOSClient; |
---|
26 | |
---|
27 | public: |
---|
28 | |
---|
29 | /// Initialisation et finalisation de la bibliothÚque /// |
---|
30 | static void Initialise(XIOSType type = CLIENT, |
---|
31 | int * argc = NULL , |
---|
32 | char *** argv = NULL ); |
---|
33 | static void Finalize(void); |
---|
34 | |
---|
35 | /// Ajout de client en mode CLIENT_SERVER et CLIENT/// |
---|
36 | static void AddClient(StdString clientName, StdSize nbClient, StdSize nbClientPServer, |
---|
37 | void (*entry_point)(comm::MPIComm, comm::MPIComm, comm::MPIComm)); |
---|
38 | |
---|
39 | /// Lancement des serveurs et/ou des clients /// |
---|
40 | static void RunServer(StdString clientName, |
---|
41 | comm::MPIComm comm_client_server, comm::MPIComm comm_server); |
---|
42 | static void RunClient(comm::MPIComm comm_client = |
---|
43 | comm::CMPIManager::GetCommWorld()); |
---|
44 | static void RunClientServer(comm::MPIComm comm_client_server = |
---|
45 | comm::CMPIManager::GetCommWorld()); |
---|
46 | |
---|
47 | protected : |
---|
48 | |
---|
49 | /// Accesseurs statiques /// |
---|
50 | static StdSize GetNbClient(void); |
---|
51 | static StdSize GetNbLocClient(const StdString & clientName = CXIOSManager::ClientName); |
---|
52 | |
---|
53 | static StdSize GetNbServer(void); |
---|
54 | static StdSize GetNbLocServer(const StdString & clientName = CXIOSManager::ClientName); |
---|
55 | |
---|
56 | private : |
---|
57 | |
---|
58 | /// variables privées /// |
---|
59 | static StdString ExeName; |
---|
60 | static std::vector<StdString> ExeOptions; |
---|
61 | |
---|
62 | static XIOSType Type; |
---|
63 | static StdString ClientName; |
---|
64 | static comm::MPIComm Comm_Client_Server; |
---|
65 | static comm::MPIComm Comm_Server; |
---|
66 | static xios_map<StdString, XIOSClient> Clients; |
---|
67 | |
---|
68 | }; // class CXIOSManager |
---|
69 | } // namespace xmlioserver |
---|
70 | |
---|
71 | #endif //__XMLIO_CXMLIOManager__ |
---|