10 extern "C" void transit_(void *compo,double *dt);
11 extern "C" void perma_(void *compo);
13 //! Constructor for component "FLUIDE" instance
17 FLUIDE_i::FLUIDE_i(CORBA::ORB_ptr orb,
18 PortableServer::POA_ptr poa,
19 PortableServer::ObjectId * contId,
20 const char *instanceName,
21 const char *interfaceName)
22 : Superv_Component_i(orb, poa, contId, instanceName, interfaceName)
24 cerr << "create component" << endl;
26 _id = _poa->activate_object(_thisObj);
29 //! Destructor for component "FLUIDE" instance
34 //! Register datastream ports for a component service given its name
36 * \param service_name : service name
37 * \return true if port registering succeeded, false if not
40 FLUIDE_i::init_service(const char * service_name) {
41 CORBA::Boolean rtn = false;
42 string s_name(service_name);
47 std::cerr << "FLUIDE: prun: " << std::endl;
48 //initialization CALCIUM ports IN
49 create_calcium_port(this,"tpi","CALCIUM_real","IN","I");
50 create_calcium_port(this,"iconv","CALCIUM_integer","IN","I");
51 //initialization CALCIUM ports OUT
52 create_calcium_port(this,"tfi","CALCIUM_real","OUT","I");
54 catch(const PortAlreadyDefined& ex)
56 std::cerr << "FLUIDE: " << ex.what() << std::endl;
57 //Ports already created : we use them
61 std::cerr << "FLUIDE: unknown exception" << std::endl;
70 std::cerr << "FLUIDE: trun: " << std::endl;
71 //initialization CALCIUM ports IN
72 create_calcium_port(this,"tparoi","CALCIUM_real","IN","T");
73 create_calcium_port(this,"rparoi","CALCIUM_real","IN","T");
74 //initialization CALCIUM ports OUT
75 create_calcium_port(this,"tfluide","CALCIUM_real","OUT","T");
76 create_calcium_port(this,"rfluide","CALCIUM_real","OUT","T");
78 catch(const PortAlreadyDefined& ex)
80 std::cerr << "FLUIDE: " << ex.what() << std::endl;
81 //Ports already created : we use them
85 std::cerr << "FLUIDE: unknown exception" << std::endl;
94 std::cerr << "FLUIDE_i::prun" << std::endl;
95 Superv_Component_i * component = dynamic_cast<Superv_Component_i*>(this);
96 char nom_instance[INSTANCE_LEN];
97 int info = cp_cd(component,nom_instance);
101 //to do or not to do ???
102 cp_fin(component,CP_ARRET);
104 catch ( const CalciumException & ex)
106 std::cerr << ex.what() << std::endl;
107 cp_fin(component,CP_ARRET);
111 std::cerr << "unexpected exception" << std::endl;
112 cp_fin(component,CP_ARRET);
114 std::cerr << "end of FLUIDE_i::prun" << std::endl;
117 void FLUIDE_i::trun(CORBA::Double dt)
119 std::cerr << "FLUIDE_i::trun" << std::endl;
120 Superv_Component_i * component = dynamic_cast<Superv_Component_i*>(this);
121 char nom_instance[INSTANCE_LEN];
122 int info = cp_cd(component,nom_instance);
125 transit_(&component,&dt);
126 //to do or not to do ???
127 cp_fin(component,CP_ARRET);
129 catch ( const CalciumException & ex)
131 std::cerr << ex.what() << std::endl;
132 cp_fin(component,CP_ARRET);
136 std::cerr << "unexpected exception" << std::endl;
137 cp_fin(component,CP_ARRET);
139 std::cerr << "end of FLUIDE_i::trun" << std::endl;
144 PortableServer::ObjectId * FLUIDEEngine_factory( CORBA::ORB_ptr orb,
145 PortableServer::POA_ptr poa,
146 PortableServer::ObjectId * contId,
147 const char *instanceName,
148 const char *interfaceName)
150 MESSAGE("PortableServer::ObjectId * FLUIDEEngine_factory()");
151 FLUIDE_i * myEngine = new FLUIDE_i(orb, poa, contId, instanceName, interfaceName);
152 return myEngine->getId() ;