]> SALOME platform Git repositories - modules/kernel.git/blob - src/DSC/DSC_User/Datastream/Calcium/CalciumPortTraits.hxx
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/kernel.git] / src / DSC / DSC_User / Datastream / Calcium / CalciumPortTraits.hxx
1 //  Copyright (C) 2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
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. 
8 // 
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. 
13 // 
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 
17 // 
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //
21 //
22 //  File   : CalciumPortTraits.hxx
23 //  Author : Eric Fayolle (EDF)
24 //  Module : KERNEL
25 // Modified by : $LastChangedBy$
26 // Date        : $LastChangedDate: 2007-02-28 15:26:32 +0100 (mer, 28 fév 2007) $
27 // Id          : $Id$
28
29 #ifndef _PORT_TRAITS_HXX_
30 #define _PORT_TRAITS_HXX_
31
32 #include "Superv_Component_i.hxx"
33
34 // PROVIDES PORT TRAITS
35 struct UnknownProvidesPortType {};
36 template <class T> struct ProvidesPortTraits {
37   typedef  UnknownProvidesPortType PortType;
38 };
39 template <> struct ProvidesPortTraits<int> {
40   typedef  calcium_integer_port_provides PortType;
41 };
42 template <> struct ProvidesPortTraits<long> {
43   typedef  calcium_integer_port_provides PortType;
44 };
45 template <> struct ProvidesPortTraits<float> {
46   typedef  calcium_real_port_provides PortType;
47 };
48 template <> struct ProvidesPortTraits<double> {
49   typedef  calcium_double_port_provides PortType;
50 };
51 template <> struct ProvidesPortTraits<bool> {
52   typedef  calcium_logical_port_provides PortType;
53 };
54 // Définition du type cplx pour disciminer ce type de port
55 // de celui du float 
56 struct cplx {};
57 template <> struct ProvidesPortTraits<cplx> {
58    typedef calcium_complex_port_provides PortType;
59 };
60 // Défénition du type str pour obtenir le type de port
61 // correspondant
62 struct str {};
63 template <> struct ProvidesPortTraits<str> {
64    typedef calcium_string_port_provides PortType;
65 };
66  template <> struct ProvidesPortTraits<char *> {
67    typedef  calcium_string_port_provides PortType;
68  };
69
70 template < typename T > struct StarTrait        { typedef  T NonStarType; };
71 template < typename T > struct StarTrait< T * > { typedef  T NonStarType; };
72
73
74 // USES PORT TRAITS
75 struct UnknownUsesPortType {};
76 template <class T> struct UsesPortTraits {
77   typedef  UnknownUsesPortType PortType;
78 };
79 template <> struct UsesPortTraits<int> {
80   typedef  calcium_integer_port_uses PortType;
81 };
82 template <> struct UsesPortTraits<long> {
83   typedef  calcium_integer_port_uses PortType;
84 };
85 template <> struct UsesPortTraits<float> {
86   typedef  calcium_real_port_uses PortType;
87 };
88 template <> struct UsesPortTraits<double> {
89   typedef  calcium_double_port_uses PortType;
90 };
91 template <> struct UsesPortTraits<str> {
92   typedef  calcium_string_port_uses PortType;
93 };
94 template <> struct UsesPortTraits<bool> {
95   typedef  calcium_logical_port_uses PortType;
96 };
97 template <> struct UsesPortTraits<cplx> {
98    typedef  calcium_complex_port_uses PortType;
99 };
100
101 #endif