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 : ProcessTimeIntervalTraits.hxx 00023 // Author : Eric Fayolle (EDF) 00024 // Module : KERNEL 00025 // Modified by : $LastChangedBy$ 00026 // Date : $LastChangedDate: 2007-01-08 19:01:14 +0100 (lun, 08 jan 2007) $ 00027 // Id : $Id$ 00028 // 00029 #ifndef _PROCESS_TIME_INTERVAL_TRAIT_HXX_ 00030 #define _PROCESS_TIME_INTERVAL_TRAIT_HXX_ 00031 00032 #include "IteratorTraits.hxx" 00033 00034 // Par défaut les classes définissant un mode de couplage n'implémentent pas 00035 // de traitement particulier pour une de demande de données identifiées à partir 00036 // d'un dataId non reçu mais encadré par deux dataIds 00037 // Ce trait peut être spécialisé pour la classe de couplage pour effectuer 00038 // le traitement de son choix 00039 template <class WhatEver > struct ProcessTimeIntervalTraits { 00040 00041 template < typename Iterator > 00042 std::pair<bool, typename iterator_t<Iterator>::value_type > 00043 static inline apply(typename WhatEver::DataId dataId, Iterator it1) { 00044 typedef typename iterator_t<Iterator>::value_type value_type; 00045 return std::make_pair<bool,value_type> (0,0); 00046 } 00047 }; 00048 00049 // class CalciumCoulpingPolicy; 00050 // template < typename Iterator > 00051 // typename iterator_t<Iterator>::value_type 00052 // CalciumCoulpingPolicy::processTimeInterval (DataId & dataId, 00053 // Iterator & it1, Iterator & it2); 00054 #include "CalciumCouplingPolicy.hxx" 00055 template <> struct ProcessTimeIntervalTraits<CalciumCouplingPolicy> { 00056 00057 template < class Iterator > 00058 std::pair<bool,typename iterator_t<Iterator>::value_type> 00059 static inline apply(CalciumCouplingPolicy::DataId dataId, Iterator it1) { 00060 00061 Iterator it2=it1; it2++; 00062 00063 typedef typename iterator_t<Iterator>::value_type value_type; 00064 return std::make_pair<bool,value_type> (1,processTimeInterval(dataId,it1,it2)); 00065 } 00066 }; 00067 00068 #endif