00001 // Copyright (C) 2007-2011 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 : CalciumPortTraits.hxx 00024 // Author : Eric Fayolle (EDF) 00025 // Module : KERNEL 00026 // Modified by : $LastChangedBy$ 00027 // Date : $LastChangedDate: 2007-02-28 15:26:32 +0100 (mer, 28 fév 2007) $ 00028 // Id : $Id: CalciumPortTraits.hxx,v 1.3.2.1.18.1.6.1 2011-06-01 13:51:41 vsr Exp $ 00029 // 00030 #ifndef _PORT_TRAITS_HXX_ 00031 #define _PORT_TRAITS_HXX_ 00032 00033 #include "Superv_Component_i.hxx" 00034 #include "calcium_port_factory.hxx" 00035 00036 // PROVIDES PORT TRAITS 00037 template <class T> struct UnknownProvidesPortType {}; 00038 00039 template <class T> struct ProvidesPortTraits { 00040 typedef UnknownProvidesPortType<T> PortType; 00041 }; 00042 struct integer {}; 00043 template <> struct ProvidesPortTraits<integer> { 00044 typedef calcium_integer_port_provides PortType; 00045 }; 00046 template <> struct ProvidesPortTraits<int> { 00047 typedef calcium_intc_port_provides PortType; 00048 }; 00049 template <> struct ProvidesPortTraits<long> { 00050 typedef calcium_long_port_provides PortType; 00051 }; 00052 template <> struct ProvidesPortTraits<float> { 00053 typedef calcium_real_port_provides PortType; 00054 }; 00055 template <> struct ProvidesPortTraits<double> { 00056 typedef calcium_double_port_provides PortType; 00057 }; 00058 template <> struct ProvidesPortTraits<bool> { 00059 typedef calcium_logical_port_provides PortType; 00060 }; 00061 // Définition du type cplx pour disciminer ce type de port 00062 // de celui du float 00063 struct cplx {}; 00064 template <> struct ProvidesPortTraits<cplx> { 00065 typedef calcium_complex_port_provides PortType; 00066 }; 00067 // Définition du type str pour obtenir le type de port 00068 // correspondant 00069 struct str {}; 00070 template <> struct ProvidesPortTraits<str> { 00071 typedef calcium_string_port_provides PortType; 00072 }; 00073 // Définition du type intc pour obtenir le type de port 00074 // correspondant 00075 struct intc {}; 00076 template <> struct ProvidesPortTraits<intc> { 00077 typedef calcium_intc_port_provides PortType; 00078 }; 00079 00080 00081 template < typename T > struct StarTrait { typedef T NonStarType; }; 00082 template < typename T > struct StarTrait< T * > { typedef T NonStarType; }; 00083 00084 00085 // USES PORT TRAITS 00086 template <class T> struct UnknownUsesPortType {}; 00087 template <class T> struct UsesPortTraits { 00088 typedef UnknownUsesPortType<T> PortType; 00089 }; 00090 template <> struct UsesPortTraits<integer> { 00091 typedef calcium_integer_port_uses PortType; 00092 }; 00093 template <> struct UsesPortTraits<int> { 00094 typedef calcium_intc_port_uses PortType; 00095 }; 00096 template <> struct UsesPortTraits<long> { 00097 typedef calcium_long_port_uses PortType; 00098 }; 00099 template <> struct UsesPortTraits<float> { 00100 typedef calcium_real_port_uses PortType; 00101 }; 00102 template <> struct UsesPortTraits<double> { 00103 typedef calcium_double_port_uses PortType; 00104 }; 00105 template <> struct UsesPortTraits<str> { 00106 typedef calcium_string_port_uses PortType; 00107 }; 00108 template <> struct UsesPortTraits<bool> { 00109 typedef calcium_logical_port_uses PortType; 00110 }; 00111 template <> struct UsesPortTraits<cplx> { 00112 typedef calcium_complex_port_uses PortType; 00113 }; 00114 template <> struct UsesPortTraits<intc> { 00115 typedef calcium_intc_port_uses PortType; 00116 }; 00117 00118 #endif