SALOME documentation central

src/DSC/DSC_User/Datastream/Calcium/CalciumPortTraits.hxx

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