1 // Copyright (C) 2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : CalciumPortTraits.hxx
23 // Author : Eric Fayolle (EDF)
25 // Modified by : $LastChangedBy$
26 // Date : $LastChangedDate: 2007-02-28 15:26:32 +0100 (mer, 28 fév 2007) $
29 #ifndef _PORT_TRAITS_HXX_
30 #define _PORT_TRAITS_HXX_
32 #include "Superv_Component_i.hxx"
34 // PROVIDES PORT TRAITS
35 struct UnknownProvidesPortType {};
36 template <class T> struct ProvidesPortTraits {
37 typedef UnknownProvidesPortType PortType;
39 template <> struct ProvidesPortTraits<int> {
40 typedef calcium_integer_port_provides PortType;
42 template <> struct ProvidesPortTraits<long> {
43 typedef calcium_integer_port_provides PortType;
45 template <> struct ProvidesPortTraits<float> {
46 typedef calcium_real_port_provides PortType;
48 template <> struct ProvidesPortTraits<double> {
49 typedef calcium_double_port_provides PortType;
51 template <> struct ProvidesPortTraits<bool> {
52 typedef calcium_logical_port_provides PortType;
54 // Définition du type cplx pour disciminer ce type de port
57 template <> struct ProvidesPortTraits<cplx> {
58 typedef calcium_complex_port_provides PortType;
60 // Défénition du type str pour obtenir le type de port
63 template <> struct ProvidesPortTraits<str> {
64 typedef calcium_string_port_provides PortType;
66 template <> struct ProvidesPortTraits<char *> {
67 typedef calcium_string_port_provides PortType;
70 template < typename T > struct StarTrait { typedef T NonStarType; };
71 template < typename T > struct StarTrait< T * > { typedef T NonStarType; };
75 struct UnknownUsesPortType {};
76 template <class T> struct UsesPortTraits {
77 typedef UnknownUsesPortType PortType;
79 template <> struct UsesPortTraits<int> {
80 typedef calcium_integer_port_uses PortType;
82 template <> struct UsesPortTraits<long> {
83 typedef calcium_integer_port_uses PortType;
85 template <> struct UsesPortTraits<float> {
86 typedef calcium_real_port_uses PortType;
88 template <> struct UsesPortTraits<double> {
89 typedef calcium_double_port_uses PortType;
91 template <> struct UsesPortTraits<str> {
92 typedef calcium_string_port_uses PortType;
94 template <> struct UsesPortTraits<bool> {
95 typedef calcium_logical_port_uses PortType;
97 template <> struct UsesPortTraits<cplx> {
98 typedef calcium_complex_port_uses PortType;