Back to index

salome-kernel  6.5.0
Classes | Functions
Calcium.hxx File Reference
#include "Superv_Component_i.hxx"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PySupervCompo

Functions

void create_calcium_port (Superv_Component_i *compo, char *name, char *type, char *mode, char *depend)

Function Documentation

void create_calcium_port ( Superv_Component_i compo,
char *  name,
char *  type,
char *  mode,
char *  depend 
)

Definition at line 89 of file Calcium.cxx.

  {
    std::stringstream msg;
    msg << type << " " << mode << " " << depend;
    CORBA::String_var componentName=compo->instanceName();
    std::string containerName=compo->getContainerName();
    Engines_DSC_interface::writeEvent("create_calcium_port",containerName,componentName,name,"",msg.str().c_str());

    if(std::string(mode) == "IN")
      {
        provides_port * port ;
        //provides port
        try
          {
            port = compo->create_provides_data_port(type);
            compo->add_port(port, name);
            if(std::string(depend) == "I")
              setDependency(port,type,CalciumTypes::ITERATION_DEPENDENCY);
            else if(std::string(depend) == "T")
              setDependency(port,type,CalciumTypes::TIME_DEPENDENCY);
            else
              {
                std::cerr << "create_calcium_port:unknown dependency: " << depend << std::endl;
              }
          }
        catch(const Superv_Component_i::PortAlreadyDefined& ex)
          {
            //Port already defined : we use the old one
            delete port;
            std::cerr << "create_calcium_port: " << ex.what() << std::endl;
          }
        catch ( ... )
          {
            std::cerr << "create_calcium_port: unknown exception" << std::endl;
          }
      }
    else if(std::string(mode) == "OUT")
      {
        uses_port * uport ;
        try
          {
            uport = compo->create_uses_data_port(type);
            compo->add_port(uport, name);
          }
        catch(const Superv_Component_i::PortAlreadyDefined& ex)
          {
            //Port already defined : we use the old one
            delete uport;
            std::cerr << "create_calcium_port: " << ex.what() << std::endl;
          }
        catch ( ... )
          {
            std::cerr << "create_calcium_port: unknown exception" << std::endl;
          }
      }
    else
      {
        //Unknown mode
        std::cerr << "create_calcium_port:Unknown mode: " << mode << std::endl;
      }
  }

Here is the call graph for this function: