Back to index

salome-kernel  6.5.0
calcium_port_factory.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : calcium_port_factory.cxx
00024 //  Author : Eric Fayolle (EDF)
00025 //  Module : KERNEL
00026 // Modified by : $LastChangedBy$
00027 // Date        : $LastChangedDate: 2007-01-08 19:01:14 +0100 (lun, 08 jan 2007) $
00028 // Id          : $Id: calcium_port_factory.cxx,v 1.3.2.1.18.2.12.1 2012-04-12 14:05:07 vsr Exp $
00029 //
00030 #include "calcium_port_factory.hxx"
00031 #include "Superv_Component_i.hxx"
00032 
00033 
00034 calcium_port_factory::calcium_port_factory() {
00035   Superv_Component_i::register_factory("CALCIUM",this);
00036 }
00037 
00038 calcium_port_factory::~calcium_port_factory() {}
00039 
00040 provides_port *
00041 calcium_port_factory::create_data_servant(std::string type) {
00042   provides_port * rtn_port = NULL;
00043 
00044   if ( type == "integer")
00045     rtn_port = new calcium_integer_port_provides();
00046   if ( type == "long")
00047     rtn_port = new calcium_long_port_provides();
00048   if ( type == "intc")
00049     rtn_port = new calcium_intc_port_provides();
00050   if ( type == "real")
00051     rtn_port = new calcium_real_port_provides();
00052   if ( type == "double")
00053     rtn_port = new calcium_double_port_provides();
00054   if ( type == "string")
00055     rtn_port = new calcium_string_port_provides();
00056   if ( type == "logical")
00057     rtn_port = new calcium_logical_port_provides();
00058   if ( type == "complex")
00059     rtn_port = new calcium_complex_port_provides();
00060 
00061   return rtn_port;
00062 }
00063 
00064 uses_port * 
00065 calcium_port_factory::create_data_proxy(std::string type) {
00066   uses_port * rtn_port = NULL;
00067 
00068   if ( type == "integer")
00069     rtn_port = new calcium_integer_port_uses();
00070   if ( type == "long")
00071     rtn_port = new calcium_long_port_uses();
00072   if ( type == "intc")
00073     rtn_port = new calcium_intc_port_uses();
00074   if ( type == "real")
00075     rtn_port = new calcium_real_port_uses();
00076   if ( type == "double")
00077     rtn_port = new calcium_double_port_uses();
00078   if ( type == "string")
00079     rtn_port = new calcium_string_port_uses();
00080   if ( type == "logical")
00081     rtn_port = new calcium_logical_port_uses();
00082   if ( type == "complex")
00083     rtn_port = new calcium_complex_port_uses();
00084 
00085   return rtn_port;
00086 }
00087 
00088 static calcium_port_factory myfactory;