From ad5ba8efcdedd8b74d6eb15ad4a2b0c36a982312 Mon Sep 17 00:00:00 2001 From: prascle Date: Mon, 15 Mar 2004 09:39:25 +0000 Subject: [PATCH] PR: mergefrom_KLOSS_br1_13Mar04 --- idl/SALOME_Component.idl | 8 ++++++++ src/Container/Container_i.cxx | 14 ++++++++++++++ src/Container/SALOME_Container_i.hxx | 3 +++ 3 files changed, 25 insertions(+) diff --git a/idl/SALOME_Component.idl b/idl/SALOME_Component.idl index ad9be3b06..a18580fe7 100644 --- a/idl/SALOME_Component.idl +++ b/idl/SALOME_Component.idl @@ -83,6 +83,14 @@ module Engines Returns True if the %container has been killed */ boolean Kill_impl() ; +/*! + Returns the hostname of the container +*/ + string getHostName(); +/*! + Returns the PID of the container +*/ + long getPID(); }; /*! \brief Interface of the %component diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 05f7c84f8..ecff86fdd 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -58,6 +58,7 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, int argc , char* argv[] ) : _numInstance(0) { + _pid = (long)getpid(); ActSigIntHandler() ; @@ -124,6 +125,7 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, int flag ) : _numInstance(0) { + _pid = (long)getpid(); string hostname = GetHostname(); SCRUTE(hostname); @@ -461,3 +463,15 @@ void SigIntHandler(int what , siginfo_t * siginfo , return ; } } + +// Get the PID of the Container + +long Engines_Container_i::getPID() { + return(_pid); +} + +// Get the hostName of the Container + +char* Engines_Container_i::getHostName() { + return((char*)(GetHostname().c_str())); +} diff --git a/src/Container/SALOME_Container_i.hxx b/src/Container/SALOME_Container_i.hxx index ee6e460d5..61ce9d308 100644 --- a/src/Container/SALOME_Container_i.hxx +++ b/src/Container/SALOME_Container_i.hxx @@ -70,6 +70,8 @@ public: char* machineName(); void ping(); bool Kill_impl() ; + char* getHostName(); + long getPID(); protected: @@ -88,6 +90,7 @@ private: int _argc ; char** _argv ; + long _pid; }; -- 2.39.2