PaCO++  0.05
PaCO++_src.h
Go to the documentation of this file.
00001 #ifndef PACO_PLUSPLUS_SRC_H_IS_DEFINED
00002 #define PACO_PLUSPLUS_SRC_H_IS_DEFINED
00003 
00004 #include <PaCO++.h>
00005 #include <vector>
00006 #include <string>
00007 #include <iostream>
00008 
00009 #include <FabriqueManager.h>
00010 
00011 using namespace std;
00012 
00013 void* paco_orb_run(void* arg);
00014 
00015 paco_fabrique_manager* paco_getFabriqueManager();
00016 
00017 class InterfaceManager_impl: virtual public POA_PaCO::InterfaceManager
00018 {
00019 public:
00020     // Constructors
00021     InterfaceManager_impl(CORBA::ORB_ptr current_orb);
00022     virtual ~InterfaceManager_impl();
00023 
00024     // Methods of InterfaceManager
00025     virtual void setConnectionInfos();
00026     virtual void setTotalNode(CORBA::Short totalNode); 
00027     virtual void setTopo(const PaCO::PacoTopology_t& topo); 
00028     virtual void setNewNode(const char * node, const CORBA::Short rank);
00029     virtual void setWorkNode(CORBA::Short totalNode);
00030     virtual void setReturn(const char * ref);
00031     virtual char * getReturn();
00032     virtual void return_ok(const CORBA::Short client_id);
00033 
00034     // Permet aux noeuds d'un client d'avoir le meme client_id !
00035     virtual CORBA::Short getClientId() = 0;
00036 
00037     // Methods of ParallelKernel
00038     virtual PaCO::ConnectionInfos* getConnectionInfos();
00039     // Method to generate to update context when the manager is configured
00040     virtual void updateContexts() = 0;
00041 
00042     void setReturn(int rtn);
00043     virtual void finish() = 0;
00044 
00045 protected:
00046     CORBA::ORB_ptr _orb;
00047     PaCO::ConnectionInfos::_nodes_seq _nodes;
00048     CORBA::Short _current_uid;
00049     CORBA::Short _totalNode;
00050     CORBA::Short _totalNodeReceived;
00051     CORBA::Short _workNode;
00052     PaCO::ConnectionInfos _informations;
00053     PaCO::ConnectionInfos _informations_temp;
00054     PaCO::PacoTopology_t serveur_topo;
00055     string return_str;
00056     int _rtn; // To known if the interface manager is a 
00057                 // return interface manager
00058 };
00059 
00060 class InterfaceParallel_impl: virtual public POA_PaCO::InterfaceParallel
00061 {
00062 public:
00063     // Constructors
00064     InterfaceParallel_impl(CORBA::ORB_ptr current_orb, char * ior);
00065     virtual ~InterfaceParallel_impl();
00066 
00067     // Methods of InterfaceParallel
00068     CORBA::Short getMyRank();
00069     CORBA::Short getTotalNode();
00070     CORBA::Short getDeployRank();
00071     void init_InterfaceParallel(CORBA::Short myRank, CORBA::Short totalNode);
00072     void deploy(CORBA::Short rank);
00073     // Methods of ParallelKernel
00074     virtual PaCO::ConnectionInfos* getConnectionInfos();
00075     // Return object
00076     void refReturnObject(const char * ref);
00077 
00078     // EXCEPTION !
00079     virtual void setRef(const PaCO::InterfaceParallel::ref & ref_nodes);
00080     // Actually implemented by the PaCO++ generated layer
00081     virtual void addException(const CORBA::Short except) {}
00082 
00083     PaCO::InterfaceParallel::ref _ref_nodes;
00084 
00085 protected:
00086     CORBA::ORB_ptr _orb;
00087     string return_object;
00088 
00089 private:
00090     CORBA::Short _deployRank;
00091     CORBA::Short _myRank;
00092     CORBA::Short _totalNode;
00093     string _ior;
00094     
00095 
00096 };
00097 
00098 #endif