Back to index

salome-kernel  6.5.0
CalciumTypes2CorbaTypes.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 // Modified by : $LastChangedBy$
00024 // Date        : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
00025 // Id          : $Id: CalciumTypes2CorbaTypes.cxx,v 1.3.2.2.10.2.12.1 2012-04-12 14:05:07 vsr Exp $
00026 //
00027 #include "CalciumTypes2CorbaTypes.hxx"
00028 #include "utilities.h"
00029 #include <iostream>
00030 
00031 
00032 CORBA_DATE_CAL_SCHEM::CORBA_DATE_CAL_SCHEM() : std::map<CalciumTypes::DateCalSchem,
00033                                                    Ports::Calcium_Ports::DateCalSchem>()
00034 {
00035   std::map<CalciumTypes::DateCalSchem, 
00036     Ports::Calcium_Ports::DateCalSchem > &
00037     table  = ( std::map<CalciumTypes::DateCalSchem, 
00038                Ports::Calcium_Ports::DateCalSchem > & ) *this ;
00039 
00040 table[CalciumTypes::TI_SCHEM ] = Ports::Calcium_Ports::TI_SCHEM ;
00041 table[CalciumTypes::TF_SCHEM ] = Ports::Calcium_Ports::TF_SCHEM ;
00042 table[CalciumTypes::ALPHA_SCHEM ] = Ports::Calcium_Ports::ALPHA_SCHEM ;
00043 }
00044 
00045 
00046 Ports::Calcium_Ports::DateCalSchem CORBA_DATE_CAL_SCHEM::operator[]( const CalciumTypes::DateCalSchem &c ) const
00047 {
00048   std::map<CalciumTypes::DateCalSchem,
00049     Ports::Calcium_Ports::DateCalSchem > &table = (std::map<CalciumTypes::DateCalSchem,
00050                                                    Ports::Calcium_Ports::DateCalSchem >&)*this ;
00051   assert( table.find( (CalciumTypes::DateCalSchem)c ) != table.end() ) ;
00052   return table[ (CalciumTypes::DateCalSchem)c ] ;
00053 }
00054 
00055 const CORBA_DATE_CAL_SCHEM corbaDateCalSchem ;
00056 
00057 
00058 
00059 CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : std::map<CalciumTypes::DependencyType,
00060                                                      Ports::Calcium_Ports::DependencyType >()
00061 {
00062   std::map<CalciumTypes::DependencyType,
00063     Ports::Calcium_Ports::DependencyType > &
00064     table  = ( std::map<CalciumTypes::DependencyType,
00065                Ports::Calcium_Ports::DependencyType > & ) *this ;
00066 
00067   table[CalciumTypes::TIME_DEPENDENCY ]      = Ports::Calcium_Ports::TIME_DEPENDENCY ;
00068   table[CalciumTypes::ITERATION_DEPENDENCY ] = Ports::Calcium_Ports::ITERATION_DEPENDENCY ;
00069   table[CalciumTypes::UNDEFINED_DEPENDENCY ] = Ports::Calcium_Ports::UNDEFINED_DEPENDENCY ;
00070 
00071 
00072   MESSAGE("CORBA_DEPENDENCY_TYPE() : table["<<CalciumTypes::TIME_DEPENDENCY<<"] : "<< table[CalciumTypes::TIME_DEPENDENCY]);
00073   MESSAGE("CORBA_DEPENDENCY_TYPE() : table["<<CalciumTypes::ITERATION_DEPENDENCY<<"] : "<< table[CalciumTypes::ITERATION_DEPENDENCY]);
00074   MESSAGE("CORBA_DEPENDENCY_TYPE() : table["<<CalciumTypes::UNDEFINED_DEPENDENCY<<"] : "<< table[CalciumTypes::UNDEFINED_DEPENDENCY]);
00075 }
00076 
00077 
00078 Ports::Calcium_Ports::DependencyType CORBA_DEPENDENCY_TYPE::operator[]( const CalciumTypes::DependencyType &c ) const
00079 {
00080   std::map<CalciumTypes::DependencyType,
00081     Ports::Calcium_Ports::DependencyType > &
00082     table = (std::map<CalciumTypes::DependencyType,
00083              Ports::Calcium_Ports::DependencyType >& ) *this ;
00084 
00085   MESSAGE("CORBA_DEPENDENCY_TYPE() : ::operator["<<c<<"]: " << table[c]);
00086 
00087   assert( table.find( (CalciumTypes::DependencyType)c ) != table.end() ) ;
00088   return table[ (CalciumTypes::DependencyType)c ] ;
00089 }
00090 
00091 const CORBA_DEPENDENCY_TYPE corbaDependencyType ;
00092 
00093 
00094 
00095 
00096 CORBA_INTERPOLATION_SCHEM::CORBA_INTERPOLATION_SCHEM() : std::map<CalciumTypes::InterpolationSchem,
00097                                                              Ports::Calcium_Ports::InterpolationSchem > () 
00098 {
00099   std::map<CalciumTypes::InterpolationSchem,
00100     Ports::Calcium_Ports::InterpolationSchem > &
00101     table  = ( std::map<CalciumTypes::InterpolationSchem,
00102                Ports::Calcium_Ports::InterpolationSchem > & ) *this ;
00103 
00104   table[CalciumTypes::L0_SCHEM ] = Ports::Calcium_Ports::L0_SCHEM ;
00105   table[CalciumTypes::L1_SCHEM ] = Ports::Calcium_Ports::L1_SCHEM ;
00106 }
00107 
00108 
00109 Ports::Calcium_Ports::InterpolationSchem CORBA_INTERPOLATION_SCHEM::operator[]( const CalciumTypes::InterpolationSchem &c ) const
00110 {
00111   std::map<CalciumTypes::InterpolationSchem,
00112     Ports::Calcium_Ports::InterpolationSchem > &table = 
00113     (std::map<CalciumTypes::InterpolationSchem,
00114      Ports::Calcium_Ports::InterpolationSchem >& ) *this ;
00115 
00116   assert( table.find( (CalciumTypes::InterpolationSchem)c ) != table.end() ) ;
00117   return table[ (CalciumTypes::InterpolationSchem)c ] ;
00118 }
00119 
00120 const CORBA_INTERPOLATION_SCHEM corbaInterpolationSchem ;
00121 
00122 
00123 
00124 CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : std::map<CalciumTypes::ExtrapolationSchem,
00125                                                              Ports::Calcium_Ports::ExtrapolationSchem > () 
00126 {
00127   std::map<CalciumTypes::ExtrapolationSchem,
00128     Ports::Calcium_Ports::ExtrapolationSchem > &
00129     table  = ( std::map<CalciumTypes::ExtrapolationSchem,
00130                Ports::Calcium_Ports::ExtrapolationSchem > & ) *this ;
00131 
00132   table[CalciumTypes::E0_SCHEM ] = Ports::Calcium_Ports::E0_SCHEM ;
00133   table[CalciumTypes::E1_SCHEM ] = Ports::Calcium_Ports::E1_SCHEM ;
00134   table[CalciumTypes::UNDEFINED_EXTRA_SCHEM ] = Ports::Calcium_Ports::UNDEFINED_EXTRA_SCHEM ;
00135 }
00136 
00137 
00138 Ports::Calcium_Ports::ExtrapolationSchem CORBA_EXTRAPOLATION_SCHEM::operator[]( const CalciumTypes::ExtrapolationSchem &c ) const
00139 {
00140   std::map<CalciumTypes::ExtrapolationSchem,
00141     Ports::Calcium_Ports::ExtrapolationSchem > &table = 
00142     (std::map<CalciumTypes::ExtrapolationSchem,
00143      Ports::Calcium_Ports::ExtrapolationSchem >& ) *this ;
00144 
00145   assert( table.find( (CalciumTypes::ExtrapolationSchem)c ) != table.end() ) ;
00146   return table[ (CalciumTypes::ExtrapolationSchem)c ] ;
00147 }
00148 
00149 const CORBA_EXTRAPOLATION_SCHEM corbaExtrapolationSchem ;