Back to index

salome-kernel  6.5.0
Public Types | Public Member Functions | Protected Attributes
GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort > Class Template Reference

#include <GenericUsesPort.hxx>

Inheritance diagram for GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef DataManipulator::Type DataType
typedef
DataManipulator::CorbaInType 
CorbaInDataType

Public Member Functions

 GenericUsesPort ()
virtual ~GenericUsesPort ()
virtual const char * get_repository_id ()
template<typename TimeType , typename TagType >
void put (CorbaInDataType data, TimeType time, TagType tag)
virtual void uses_port_changed (Engines::DSC::uses_port *new_uses_port, const Engines::DSC::Message message)

Protected Attributes

Engines::DSC::uses_port_my_ports

Detailed Description

template<typename DataManipulator, typename CorbaPortType, char * repositoryName, typename UsesPort = uses_port>
class GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >

Definition at line 48 of file GenericUsesPort.hxx.


Member Typedef Documentation

template<typename DataManipulator, typename CorbaPortType, char * repositoryName, typename UsesPort = uses_port>
typedef DataManipulator::CorbaInType GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >::CorbaInDataType

Definition at line 53 of file GenericUsesPort.hxx.

template<typename DataManipulator, typename CorbaPortType, char * repositoryName, typename UsesPort = uses_port>
typedef DataManipulator::Type GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >::DataType

Definition at line 52 of file GenericUsesPort.hxx.


Constructor & Destructor Documentation

template<typename DataManipulator , typename CorbaPortType , char * repositoryName, typename UsesPort >
GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >::GenericUsesPort ( )

Definition at line 71 of file GenericUsesPort.hxx.

                                                                                             {
  _my_ports = NULL;
}
template<typename DataManipulator , typename CorbaPortType , char * repositoryName, typename UsesPort >
GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >::~GenericUsesPort ( ) [virtual]

Definition at line 76 of file GenericUsesPort.hxx.

{
  delete _my_ports;
}

Member Function Documentation

template<typename DataManipulator , typename CorbaPortType , char * repositoryName, typename UsesPort >
const char * GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >::get_repository_id ( ) [virtual]

Definition at line 83 of file GenericUsesPort.hxx.

                                                                                               {
  return repositoryName;
}
template<typename DataManipulator , typename CorbaPortType , char * repositoryName, typename UsesPort >
template<typename TimeType , typename TagType >
void GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >::put ( CorbaInDataType  data,
TimeType  time,
TagType  tag 
)

Definition at line 91 of file GenericUsesPort.hxx.

                                                                                               {
  typedef typename CorbaPortType::_var_type CorbaPortTypeVar;
  if (!_my_ports)
    throw DSC_Exception(LOC("There is no connected provides port to communicate with."));

  // OLD : PB1 : Cf remarque dans CalciumInterface, si on n'effectue pas de copie
  // OLD :       du buffer ! 
  // OLD : PB2 : Si les ports provides auquels on envoie data sont collocalisés
  // OLD : ils vont partagés le même buffer (à cause de notre optim ds get_data)
  // OLD : il faut alors effectuer une copie ici.
  // OLD : Pour l'instant on résoud PB2 en créant une copie de la donnée en cas
  // OLD : de connexions multiples. Il faudra tester la collocalisation.
  // OLD :  DataType copyOfData; // = data; PB1
  for(int i = 0; i < _my_ports->length(); i++) {

    CorbaPortTypeVar port = CorbaPortType::_narrow((*_my_ports)[i]);
    //if (i) { PB1
    //OLD :   copyOfData = DataManipulator::clone(data);
#ifdef MYDEBUG
    std::cerr << "-------- GenericUsesPort::put -------- " << std::endl;
#endif
    //} PB1
    try {
      port->put(data,time,tag);
      // OLD : port->put(*copyOfData,time,tag);
    } catch(const CORBA::SystemException& ex) {
      //OLD : DataManipulator::delete_data(copyOfData);
      throw DSC_Exception(LOC(OSS() << "Can't invoke put method on port number "
                              << i << "( i>=  0)"));

    }
    //if (i) PB1 
    // La séquence est détruite avec le buffer si on n'est pas collocalisé
    // La séquence est détruite sans son buffer sinon (cf comportement de get_data
    // appelée dans put (port provides)
    //OLD : DataManipulator::delete_data(copyOfData);
  }
}
template<typename DataManipulator , typename CorbaPortType , char * repositoryName, typename UsesPort >
void GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >::uses_port_changed ( Engines::DSC::uses_port new_uses_port,
const Engines::DSC::Message  message 
) [virtual]

Definition at line 136 of file GenericUsesPort.hxx.

{
  if (_my_ports) delete _my_ports;

#ifdef MYDEBUG
  std::cerr << "GenericUsesPort::uses_port_changed" << std::endl;
#endif
  _my_ports = new_uses_port;
}

Member Data Documentation

template<typename DataManipulator, typename CorbaPortType, char * repositoryName, typename UsesPort = uses_port>
Engines::DSC::uses_port* GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort >::_my_ports [protected]

Definition at line 66 of file GenericUsesPort.hxx.


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