Back to index

salome-kernel  6.5.0
Public Member Functions | Protected Attributes | Private Attributes
data_short_port_uses Class Reference

This class a port that sends a CORBA short with the basic port policy. More...

#include <data_short_port_uses.hxx>

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

List of all members.

Public Member Functions

 data_short_port_uses ()
virtual ~data_short_port_uses ()
virtual const char * get_repository_id ()
 This method is used by the component to get port's CORBA repository id.
virtual void put (CORBA::Short data)
 This method is used by the component to send a short value to all the provides ports connected.
virtual void uses_port_changed (Engines::DSC::uses_port *new_uses_port, const Engines::DSC::Message message)
 This method is a callback for be aware of modification of the port's connections.
virtual Ports::PortProperties_ptr get_port_properties ()
 This is used to get the property object of the port.

Protected Attributes

PortProperties_idefault_properties

Private Attributes

Engines::DSC::uses_port_my_ports

Detailed Description

This class a port that sends a CORBA short with the basic port policy.

Definition at line 37 of file data_short_port_uses.hxx.


Constructor & Destructor Documentation

Definition at line 30 of file data_short_port_uses.cxx.

                                           {
  _my_ports = NULL;
}

Definition at line 34 of file data_short_port_uses.cxx.

{}

Member Function Documentation

Ports::PortProperties_ptr base_port::get_port_properties ( ) [virtual, inherited]

This is used to get the property object of the port.

Returns:
property's CORBA reference.

Definition at line 42 of file base_port.cxx.

{
  return default_properties->_this();
}
const char * data_short_port_uses::get_repository_id ( ) [virtual]

This method is used by the component to get port's CORBA repository id.

Returns:
port's CORBA repository id

Implements uses_port.

Definition at line 37 of file data_short_port_uses.cxx.

                                        {
  return "IDL:Ports/Data_Short_Port:1.0";
}
void data_short_port_uses::put ( CORBA::Short  data) [virtual]

This method is used by the component to send a short value to all the provides ports connected.

Parameters:
datathe short sended.

Definition at line 42 of file data_short_port_uses.cxx.

                                         {
//  if (!CORBA::is_nil(_my_port))
//    _my_port->put(data);
  if (!_my_ports)
    std::cerr << "data_short_port_uses::put is NULL" << std::endl;
  else
  {
    for(int i = 0; i < _my_ports->length(); i++)
    {
      Ports::Data_Short_Port_ptr port = Ports::Data_Short_Port::_narrow((*_my_ports)[i]);
      port->put(data);
    }
  }
}
void data_short_port_uses::uses_port_changed ( Engines::DSC::uses_port new_uses_port,
const Engines::DSC::Message  message 
) [virtual]

This method is a callback for be aware of modification of the port's connections.

Parameters:
new_uses_portthe new uses port's sequence.
messagemessage associated to the modification.

Implements uses_port.

Definition at line 58 of file data_short_port_uses.cxx.

{
  if (_my_ports)
    delete _my_ports;

  std::cerr << "data_short_port_uses::uses_port_changed" << std::endl;
  _my_ports = new Engines::DSC::uses_port(*new_uses_port);
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 71 of file data_short_port_uses.hxx.

Definition at line 49 of file base_port.hxx.


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