Ignore:
Timestamp:
10/18/19 15:40:35 (5 years ago)
Author:
ymipsl
Message:

implementing first guess for service functionnalities.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_SERVICES/src/node/context.hpp

    r1639 r1761  
    1212#include "registry.hpp" 
    1313#include "mpi.hpp" 
     14#include "services_manager.hpp" 
     15#include "server_context.hpp" 
    1416 
    1517 
     
    8991         // Initialize server or client 
    9092         void initClient(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtServer = 0); 
     93         void init(CServerContext* parentServerContext, MPI_Comm intraComm, int serviceType); 
     94         void initClient(MPI_Comm intraComm, int serviceType); 
     95          
    9196         void initServer(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtClient = 0); 
     97         void initServer(MPI_Comm intraComm, int serviceType ); 
     98         void createClientInterComm(MPI_Comm interCommClient, MPI_Comm interCommServer)  ; 
     99         void createServerInterComm(void)  ; 
     100 
    92101         bool isInitialized(void); 
    93102 
     
    96105         // Put sever or client into loop state 
    97106         bool checkBuffersAndListen(bool enableEventsProcessing=true); 
     107         bool eventLoop(bool enableEventsProcessing=true); 
    98108 
    99109         // Finalize a context 
    100110         void finalize(void); 
     111         void finalize_old(void); 
    101112         bool isFinalized(void); 
    102113 
     
    161172 
    162173         const StdString& getIdServer(); 
     174         void setIdServer(const StdString& idServer); 
    163175         const StdString& getIdServer(const int srvPoolNb); 
     176         std::string getContextId() {return contextId_;} 
    164177 
    165178         // Client side: Receive and process messages 
     
    208221        static void ShowTree(StdOStream & out = std::clog); 
    209222        static void CleanTree(void); 
     223        int getServiceType(void) {return serviceType_;} 
    210224 
    211225      public : 
     
    223237         virtual bool hasChild(void) const; 
    224238 
     239         bool isProcessingEvent(void) {return isProcessingEvent_;} 
     240         bool setProcessingEvent(void) {isProcessingEvent_=true ;} 
     241         bool unsetProcessingEvent(void) {isProcessingEvent_=false ;} 
    225242 
    226243      public : 
     
    252269         std::vector<CContextServer*> serverPrimServer; 
    253270         std::vector<CContextClient*> clientPrimServer; 
     271         std::vector<std::string> primServerId_; 
    254272 
    255273         CRegistry* registryIn ;    //!< input registry which is read from file 
    256274         CRegistry* registryOut ;   //!< output registry which will be written into file at the finalize 
     275 
     276 
     277        MPI_Comm intraComm_ ; //! context intra communicator 
    257278 
    258279      private: 
     
    265286         std::list<MPI_Comm> comms; //!< Communicators allocated internally 
    266287 
     288         int serviceType_;  //!< service associated to the context 
     289         string contextId_ ; //!< context client id for the servers. For clients this is same as getId()  
     290         bool isProcessingEvent_ ; 
     291         CServerContext* parentServerContext_ ; 
     292 
    267293      public: // Some function maybe removed in the near future 
    268294        // virtual void toBinary  (StdOStream & os) const; 
Note: See TracChangeset for help on using the changeset viewer.