1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : calcium_port_factory.cxx
24 // Author : Eric Fayolle (EDF)
26 // Modified by : $LastChangedBy$
27 // Date : $LastChangedDate: 2007-01-08 19:01:14 +0100 (lun, 08 jan 2007) $
30 #include "calcium_port_factory.hxx"
31 #include "Superv_Component_i.hxx"
34 calcium_port_factory::calcium_port_factory() {
35 Superv_Component_i::register_factory("CALCIUM",this);
38 calcium_port_factory::~calcium_port_factory() {}
41 calcium_port_factory::create_data_servant(std::string type) {
42 provides_port * rtn_port = NULL;
44 if ( type == "integer")
45 rtn_port = new calcium_integer_port_provides();
47 rtn_port = new calcium_long_port_provides();
49 rtn_port = new calcium_intc_port_provides();
51 rtn_port = new calcium_real_port_provides();
52 if ( type == "double")
53 rtn_port = new calcium_double_port_provides();
54 if ( type == "string")
55 rtn_port = new calcium_string_port_provides();
56 if ( type == "logical")
57 rtn_port = new calcium_logical_port_provides();
58 if ( type == "complex")
59 rtn_port = new calcium_complex_port_provides();
65 calcium_port_factory::create_data_proxy(std::string type) {
66 uses_port * rtn_port = NULL;
68 if ( type == "integer")
69 rtn_port = new calcium_integer_port_uses();
71 rtn_port = new calcium_long_port_uses();
73 rtn_port = new calcium_intc_port_uses();
75 rtn_port = new calcium_real_port_uses();
76 if ( type == "double")
77 rtn_port = new calcium_double_port_uses();
78 if ( type == "string")
79 rtn_port = new calcium_string_port_uses();
80 if ( type == "logical")
81 rtn_port = new calcium_logical_port_uses();
82 if ( type == "complex")
83 rtn_port = new calcium_complex_port_uses();
88 static calcium_port_factory myfactory;