30 #ifndef _GENERIC_USES_PORT_HXX_
31 #define _GENERIC_USES_PORT_HXX_
33 #include "CorbaTypeManipulator.hxx"
35 #include "uses_port.hxx"
36 #include "SALOME_Ports.hh"
38 #include "DSC_Exception.hxx"
46 template <
typename DataManipulator,
typename CorbaPortType,
char * repositoryName,
52 typedef typename DataManipulator::Type DataType;
53 typedef typename DataManipulator::CorbaInType CorbaInDataType;
58 virtual const char * get_repository_id();
59 template <
typename TimeType,
typename TagType>
60 void put(CorbaInDataType data, TimeType time, TagType tag);
70 template <
typename DataManipulator,
typename CorbaPortType,
char * repositoryName,
typename UsesPort >
75 template <
typename DataManipulator,
typename CorbaPortType,
char * repositoryName,
typename UsesPort >
81 template <
typename DataManipulator,
typename CorbaPortType,
char * repositoryName,
typename UsesPort >
84 return repositoryName;
88 template <
typename DataManipulator,
typename CorbaPortType,
char * repositoryName,
typename UsesPort >
89 template <
typename TimeType,
typename TagType>
94 typedef typename CorbaPortType::_var_type CorbaPortTypeVar;
96 throw DSC_Exception(LOC(
"There is no connected provides port to communicate with."));
106 for(
int i = 0; i < _my_ports->length(); i++) {
108 CorbaPortTypeVar port = CorbaPortType::_narrow((*_my_ports)[i]);
112 std::cerr <<
"-------- GenericUsesPort::put -------- " << std::endl;
116 port->put(data,time,tag);
118 }
catch(
const CORBA::SystemException& ex) {
121 << i <<
"( i>= 0)"));
133 template <
typename DataManipulator,
typename CorbaPortType,
char * repositoryName,
typename UsesPort>
139 if (_my_ports)
delete _my_ports;
142 std::cerr <<
"GenericUsesPort::uses_port_changed" << std::endl;
144 _my_ports = new_uses_port;