1 // Copyright (C) 2007-2008 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
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"
33 #include "calcium_port_factory.hxx"
35 // PROVIDES PORT TRAITS
36 template <class T> struct UnknownProvidesPortType {};
38 template <class T> struct ProvidesPortTraits {
39 typedef UnknownProvidesPortType<T> PortType;
41 template <> struct ProvidesPortTraits<int> {
42 typedef calcium_integer_port_provides PortType;
44 template <> struct ProvidesPortTraits<long> {
45 typedef calcium_integer_port_provides PortType;
47 template <> struct ProvidesPortTraits<float> {
48 typedef calcium_real_port_provides PortType;
50 template <> struct ProvidesPortTraits<double> {
51 typedef calcium_double_port_provides PortType;
53 template <> struct ProvidesPortTraits<bool> {
54 typedef calcium_logical_port_provides PortType;
56 // Définition du type cplx pour disciminer ce type de port
59 template <> struct ProvidesPortTraits<cplx> {
60 typedef calcium_complex_port_provides PortType;
62 // Définition du type str pour obtenir le type de port
65 template <> struct ProvidesPortTraits<str> {
66 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 template <class T> struct UnknownUsesPortType {};
76 template <class T> struct UsesPortTraits {
77 typedef UnknownUsesPortType<T> 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;