Back to index

salome-kernel  6.5.0
Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes
Engines_ParallelDSC_i Class Reference

#include <ParallelDSC_i.hxx>

Inheritance diagram for Engines_ParallelDSC_i:
Inheritance graph
[legend]
Collaboration diagram for Engines_ParallelDSC_i:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Engines_ParallelDSC_i (CORBA::ORB_ptr orb, char *ior, int rank, PortableServer::POA_ptr poa, PortableServer::ObjectId *contId, const char *instanceName, const char *interfaceName, bool notif=false)
virtual ~Engines_ParallelDSC_i ()
virtual void add_provides_port (Ports::Port_ptr ref, const char *provides_port_name, Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::NilPort, Engines::DSC::BadProperty)
virtual void add_uses_port (const char *repository_id, const char *uses_port_name, Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::BadProperty)
virtual Ports::Port_ptr get_provides_port (const char *provides_port_name, const CORBA::Boolean connection_error) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected)
virtual Engines::DSC::uses_portget_uses_port (const char *uses_port_name) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected)
virtual void connect_provides_port (const char *provides_port_name) throw (Engines::DSC::PortNotDefined)
virtual void connect_uses_port (const char *uses_port_name, Ports::Port_ptr provides_port_ref) throw (Engines::DSC::PortNotDefined, Engines::DSC::BadPortType, Engines::DSC::NilPort)
virtual CORBA::Boolean is_connected (const char *port_name) throw (Engines::DSC::PortNotDefined)
virtual void disconnect_provides_port (const char *provides_port_name, const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected)
virtual void disconnect_uses_port (const char *uses_port_name, Ports::Port_ptr provides_port_ref, const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected, Engines::DSC::BadPortReference)
virtual Ports::PortProperties_ptr get_port_properties (const char *port_name) throw (Engines::DSC::PortNotDefined)
virtual void set_paco_proxy (CORBA::Object_ptr ref, const char *provides_port_name, Ports::PortProperties_ptr port_prop)
 This method is used to register the proxy of the parallel port into all the nodes of the parallel component.
virtual CORBA::Boolean add_parallel_provides_proxy_port (const CORBA::Object_ptr ref, const char *provides_port_name, Ports::PortProperties_ptr port_prop)
 This method is used by the node that want to add the parallel proxy port.
virtual CORBA::Boolean add_parallel_provides_proxy_wait (const char *provides_port_name)
 This method by the nodes that do not add the proxy to wait is reference.
virtual CORBA::Boolean add_parallel_provides_node_port (Ports::Port_PaCO_ptr ref, const char *provides_port_name)
 Permits to add a parallel node of a parallel provides port.
virtual const char * get_proxy (const char *provides_port_name)
 Used to get the proxy of the parallel port.

Static Public Member Functions

static void writeEvent (const char *request, const std::string &containerName, const char *instance_name, const char *port_name, const char *error, const char *message)
 Write a record in the trace file.

Protected Types

enum  port_type { uses, provides, none }
typedef std::map< std::string,
port_t * > 
ports

Protected Attributes

ports my_ports
ports::iterator my_ports_it

Detailed Description

Definition at line 36 of file ParallelDSC_i.hxx.


Member Typedef Documentation

typedef std::map<std::string, port_t *> Engines_DSC_interface::ports [protected, inherited]

Definition at line 176 of file DSC_interface.hxx.


Member Enumeration Documentation

enum Engines_DSC_interface::port_type [protected, inherited]
Enumerator:
uses 
provides 
none 

Definition at line 160 of file DSC_interface.hxx.


Constructor & Destructor Documentation

Engines_ParallelDSC_i::Engines_ParallelDSC_i ( CORBA::ORB_ptr  orb,
char *  ior,
int  rank,
PortableServer::POA_ptr  poa,
PortableServer::ObjectId *  contId,
const char *  instanceName,
const char *  interfaceName,
bool  notif = false 
)

Definition at line 26 of file ParallelDSC_i.cxx.

                                                         :
  Engines_Parallel_Component_i(orb, ior, rank, poa, contId, instanceName, interfaceName, notif),
  Engines::Parallel_DSC_serv(orb, ior, rank),
  Engines::Parallel_DSC_base_serv(orb, ior, rank),
  Engines::DSC_serv(orb, ior, rank),
  Engines::DSC_base_serv(orb, ior, rank),
  Engines::Superv_Component_serv(orb, ior, rank),
  Engines::Superv_Component_base_serv(orb, ior, rank),
  Engines::EngineComponent_serv(orb, ior, rank),
  Engines::EngineComponent_base_serv(orb, ior, rank),
  Engines::Parallel_Component_serv(orb, ior, rank),
  Engines::Parallel_Component_base_serv(orb, ior, rank),
  InterfaceParallel_impl(orb, ior, rank)
{
}

Definition at line 50 of file ParallelDSC_i.cxx.

{}

Member Function Documentation

CORBA::Boolean Engines_ParallelDSC_i::add_parallel_provides_node_port ( Ports::Port_PaCO_ptr  ref,
const char *  provides_port_name 
) [virtual]

Permits to add a parallel node of a parallel provides port.

Parameters:
refCORBA node reference.
provides_port_nameprovides port associated with the node.
Returns:
true if the node is correctly added.

Definition at line 115 of file ParallelDSC_i.cxx.

{
  CORBA::Boolean rtn_bool = false;
  PaCO::InterfaceParallel_var node = PaCO::InterfaceParallel::_narrow(ref);
  node->deploy();
  rtn_bool = true;
  return rtn_bool;
}

Here is the caller graph for this function:

CORBA::Boolean Engines_ParallelDSC_i::add_parallel_provides_proxy_port ( const CORBA::Object_ptr  ref,
const char *  provides_port_name,
Ports::PortProperties_ptr  port_prop 
) [virtual]

This method is used by the node that want to add the parallel proxy port.

Parameters:
refCORBA proxy reference.
provides_port_nameprovides port associated with the proxy.
Returns:
true if the proxy is correctly added.

Definition at line 80 of file ParallelDSC_i.cxx.

{
  assert(provides_port_name);
  CORBA::Boolean rtn_bool = false;
  Engines::Parallel_DSC_var real_comp_proxy = 
    Engines::Parallel_DSC::_narrow(InterfaceParallel_impl::_proxy);
  real_comp_proxy->set_paco_proxy(ref, provides_port_name, port_prop);
  rtn_bool = true;
  return rtn_bool;
}

Here is the caller graph for this function:

CORBA::Boolean Engines_ParallelDSC_i::add_parallel_provides_proxy_wait ( const char *  provides_port_name) [virtual]

This method by the nodes that do not add the proxy to wait is reference.

Parameters:
provides_port_nameprovides port associated with the proxy.
Returns:
true if the proxy is correctly added.

Definition at line 94 of file ParallelDSC_i.cxx.

{
  assert(provides_port_name);
  char * proxy = NULL;
  try {
    proxy = (char *) get_proxy(provides_port_name);
  }
  catch(...) {
    while(proxy == NULL)
    {
      sleep(1);
      try {
        proxy = (char *) get_proxy(provides_port_name);
      }
      catch(...) {}
    }
  }
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Engines_ParallelDSC_i::add_provides_port ( Ports::Port_ptr  ref,
const char *  provides_port_name,
Ports::PortProperties_ptr  port_prop 
) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::NilPort, Engines::DSC::BadProperty) [inline, virtual]
See also:
Engines::DSC::add_provides_port

Reimplemented from Engines_DSC_interface.

Definition at line 57 of file ParallelDSC_i.hxx.

                                  {
      Engines_DSC_interface::add_provides_port(ref, 
                                               provides_port_name,
                                               port_prop);
    }

Here is the caller graph for this function:

virtual void Engines_ParallelDSC_i::add_uses_port ( const char *  repository_id,
const char *  uses_port_name,
Ports::PortProperties_ptr  port_prop 
) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::BadProperty) [inline, virtual]
See also:
Engines::DSC::add_uses_port

Reimplemented from Engines_DSC_interface.

Definition at line 71 of file ParallelDSC_i.hxx.

                                  {
      Engines_DSC_interface::add_uses_port(repository_id, 
                                           uses_port_name,
                                           port_prop);
    }

Here is the caller graph for this function:

virtual void Engines_ParallelDSC_i::connect_provides_port ( const char *  provides_port_name) throw (Engines::DSC::PortNotDefined) [inline, virtual]
See also:
Engines::DSC::connect_provides_port

Reimplemented from Engines_DSC_interface.

Definition at line 104 of file ParallelDSC_i.hxx.

virtual void Engines_ParallelDSC_i::connect_uses_port ( const char *  uses_port_name,
Ports::Port_ptr  provides_port_ref 
) throw (Engines::DSC::PortNotDefined, Engines::DSC::BadPortType, Engines::DSC::NilPort) [inline, virtual]
See also:
Engines::DSC::connect_uses_port

Reimplemented from Engines_DSC_interface.

Definition at line 112 of file ParallelDSC_i.hxx.

                            {
    Engines_DSC_interface::connect_uses_port(uses_port_name,
                                             provides_port_ref);
  }
virtual void Engines_ParallelDSC_i::disconnect_provides_port ( const char *  provides_port_name,
const Engines::DSC::Message  message 
) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected) [inline, virtual]
See also:
Engines::DSC::disconnect_provides_port

Reimplemented from Engines_DSC_interface.

Definition at line 132 of file ParallelDSC_i.hxx.

                                       {
      Engines_DSC_interface::disconnect_provides_port(provides_port_name,
                                                      message);
    }
virtual void Engines_ParallelDSC_i::disconnect_uses_port ( const char *  uses_port_name,
Ports::Port_ptr  provides_port_ref,
const Engines::DSC::Message  message 
) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected, Engines::DSC::BadPortReference) [inline, virtual]
See also:
Engines::DSC::disconnect_uses_port

Reimplemented from Engines_DSC_interface.

Definition at line 143 of file ParallelDSC_i.hxx.

                                       {
      Engines_DSC_interface::disconnect_uses_port(uses_port_name,
                                                  provides_port_ref,
                                                  message);
    }
virtual Ports::PortProperties_ptr Engines_ParallelDSC_i::get_port_properties ( const char *  port_name) throw (Engines::DSC::PortNotDefined) [inline, virtual]
See also:
Engines::DSC::get_port_properties

Reimplemented from Engines_DSC_interface.

Definition at line 154 of file ParallelDSC_i.hxx.

virtual Ports::Port_ptr Engines_ParallelDSC_i::get_provides_port ( const char *  provides_port_name,
const CORBA::Boolean  connection_error 
) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected) [inline, virtual]
See also:
Engines::DSC::get_provides_port

Reimplemented from Engines_DSC_interface.

Definition at line 84 of file ParallelDSC_i.hxx.

                                       {
      return Engines_DSC_interface::get_provides_port(provides_port_name,
                                                      connection_error);
    }

Here is the caller graph for this function:

const char * Engines_ParallelDSC_i::get_proxy ( const char *  provides_port_name) [virtual]

Used to get the proxy of the parallel port.

Parameters:
provides_port_namename of the parallel provides port.
Returns:
IOR of the proxy.

Definition at line 70 of file ParallelDSC_i.cxx.

                                                               {
  char * rtn_char = NULL;
  Ports::Port_ptr proxy = Engines_DSC_interface::get_provides_port(provides_port_name, 
                                                                   0);
  if (!CORBA::is_nil(proxy))
    rtn_char = (char *) _orb->object_to_string(proxy);
  return rtn_char;
}

Here is the call graph for this function:

Here is the caller graph for this function:

See also:
Engines::DSC::get_uses_port

Reimplemented from Engines_DSC_interface.

Definition at line 95 of file ParallelDSC_i.hxx.

                                       {
      return Engines_DSC_interface::get_uses_port(uses_port_name);
    }

Here is the caller graph for this function:

virtual CORBA::Boolean Engines_ParallelDSC_i::is_connected ( const char *  port_name) throw (Engines::DSC::PortNotDefined) [inline, virtual]
See also:
Engines::DSC::is_connected

Reimplemented from Engines_DSC_interface.

Definition at line 124 of file ParallelDSC_i.hxx.

                                     {
      return Engines_DSC_interface::is_connected(port_name);
    }
void Engines_ParallelDSC_i::set_paco_proxy ( CORBA::Object_ptr  ref,
const char *  provides_port_name,
Ports::PortProperties_ptr  port_prop 
) [virtual]

This method is used to register the proxy of the parallel port into all the nodes of the parallel component.

Parameters:
refCORBA proxy reference.
provides_port_nameprovides port associated with the proxy.
port_propport properties.

Definition at line 57 of file ParallelDSC_i.cxx.

                                                                         {
  assert(provides_port_name);
  Engines_DSC_interface::add_provides_port(Ports::Port::_narrow(ref), 
                                           provides_port_name,
                                           port_prop);
  // Waiting that all the nodes have the proxy
  _my_com->paco_barrier(); 
  cerr << "set_paco_proxy node fin" << endl;
}

Here is the call graph for this function:

void Engines_DSC_interface::writeEvent ( const char *  request,
const std::string &  containerName,
const char *  instance_name,
const char *  port_name,
const char *  error,
const char *  message 
) [static, inherited]

Write a record in the trace file.

Parameters:
requestthe name of the request executed
containerNamethe name of the container where the request is executed
instance_namethe name of the component where the request is executed
port_namethe name of the port that is concerned
errorif an error has occured, a string that identifies the error
messageinformations about error or about the request

Definition at line 499 of file DSC_interface.cxx.

{
  if(traceLevel < 0)
    initTrace(containerName);
  if(traceLevel == 0)return;

#ifdef WNT
#else
  struct timeval tv;
  gettimeofday(&tv,0);
  long tt0=tv.tv_sec/3600; //hours

  if(traceType == 2)
    {
      //notifier (not used: salome notifier is now obsolete)
      std::ostringstream msg;
      msg.width(7);
      msg << tt0 ;
      msg << ":" ;
      long tt1=(tv.tv_sec-3600*tt0)/60;//minutes
      msg.width(2);
      msg << tt1 ;
      msg << ":" ;
      long tt2=tv.tv_sec - 3600*tt0-60*tt1; //seconds
      msg.width(2);
      msg << tt2 ;
      msg << ":" ;
      long tt3=tv.tv_usec/1000; //milliseconds
      msg.width(3);
      msg << tt3 ;
      msg << " | " ;
      msg.width(24);
      msg << error;
      msg << " | " ;
      msg << message ;
      //send event to notifier (containerName.c_str(),instance_name, request, msg.str().c_str())
    }
  else
    {
      //cerr or file
      out->width(7);
      *out << tt0 ;
      *out << ":" ;
      long tt1=(tv.tv_sec-3600*tt0)/60;//minutes
      out->width(2);
      *out << tt1 ;
      *out << ":" ;
      long tt2=tv.tv_sec - 3600*tt0-60*tt1; //seconds
      out->width(2);
      *out << tt2 ;
      *out << ":" ;
      long tt3=tv.tv_usec/1000; //milliseconds
      out->width(3);
      *out << tt3 ;
      *out << " | " ;
      out->width(16);
      *out << request ;
      *out << " | " ;
      out->width(16);
      *out << containerName ;
      *out << " | " ;
      out->width(16);
      *out << instance_name ;
      *out << " | " ;
      out->width(16);
      *out << port_name ;
      *out << " | " ;
      out->width(24);
      *out << error;
      *out << " | " ;
      *out << message ;
      *out << std::endl;
    }
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

ports Engines_DSC_interface::my_ports [protected, inherited]

Definition at line 181 of file DSC_interface.hxx.

ports::iterator Engines_DSC_interface::my_ports_it [protected, inherited]

Definition at line 182 of file DSC_interface.hxx.


The documentation for this class was generated from the following files: