Back to index

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