Salome HOME
Merge branch 'V7_main'
[modules/kernel.git] / src / DSC / DSC_User / Datastream / CouplingPolicy.hxx
index b7f980c2c9eceaf229fc0b5a2876d66cd097b56a..a83a5710edf0cb14b5b1990aff9ba1149c00eada 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : CouplingPolicy.hxx
 //  Author : Eric Fayolle (EDF)
 //  Module : KERNEL
@@ -74,9 +75,9 @@ public:
   //     wDataIt1->first < wdataId < (wDataIt1+1)->first
   template < typename Container >
   bool isDataIdConveniant(Container & storedDatas, 
-                         const typename Container::key_type & expectedDataId,
-                         bool & isEqual ,  bool & isBounded, 
-                         typename Container::iterator & wDataIt1 ) const {
+                          const typename Container::key_type & expectedDataId,
+                          bool & isEqual ,  bool & isBounded, 
+                          typename Container::iterator & wDataIt1 ) const {
     typedef typename Container::key_type   key_type;
     typedef typename Container::value_type value_type;
     typedef typename Container::iterator iterator;
@@ -98,8 +99,8 @@ public:
     BoundedDataIdProcessor(const CouplingPolicy & couplingPolicy) {};
     template < typename Iterator, typename DataId > 
     void inline apply(typename iterator_t<Iterator>::value_type & data,
-                     const DataId & dataId,
-                     const Iterator  & it1) const {
+                      const DataId & dataId,
+                      const Iterator  & it1) const {
       typedef typename iterator_t<Iterator>::value_type value_type;
       std::cout << "-------- Generic BoundedDataIdProcessor.apply() called " << std::endl;
 
@@ -118,7 +119,7 @@ public:
 
     template < typename Container >
     void apply(Container & storedDatas, 
-              typename Container::iterator & wDataIt1 ) const {
+               typename Container::iterator & wDataIt1 ) const {
       typedef typename Container::key_type   key_type;
       typedef typename Container::value_type value_type;
       typedef typename Container::iterator iterator;
@@ -139,8 +140,8 @@ public:
 
     template < typename Container, typename DataId >
     bool apply(Container & storedDatas,
-              const DataId & expectedDataId,
-              typename Container::iterator & wDataIt1 ) const {
+               const DataId & expectedDataId,
+               typename Container::iterator & wDataIt1 ) const {
       typedef typename Container::key_type   key_type;
       typedef typename Container::value_type value_type;
       typedef typename Container::iterator   iterator;
@@ -150,6 +151,20 @@ public:
     }
   };
 
+  // Remove all DataId from a container before a given time or tag
+  template <typename DataManipulator>
+  struct EraseDataIdBeforeOrAfterTagProcessor {
+
+    EraseDataIdBeforeOrAfterTagProcessor(CouplingPolicy couplingPolicy) {};
+
+    template < typename Container , typename TimeType , typename TagType >
+    void apply(Container & storedDatas, TimeType time, TagType tag, bool before ) const {
+      typedef typename Container::key_type   key_type;
+      typedef typename Container::value_type value_type;
+      typedef typename Container::iterator iterator;
+    }
+  };
+
   // Permet de réveiller les méthodes d'un GenericPort en attente
   // depuis une CouplingPolicy
   virtual void wakeupWaiting(){};