Back to index

salome-kernel  6.5.0
Public Member Functions | Public Attributes
CalciumCouplingPolicy::EraseDataIdBeforeOrAfterTagProcessor< DataManipulator > Struct Template Reference

#include <CalciumCouplingPolicy.hxx>

Collaboration diagram for CalciumCouplingPolicy::EraseDataIdBeforeOrAfterTagProcessor< DataManipulator >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 EraseDataIdBeforeOrAfterTagProcessor (CalciumCouplingPolicy &couplingPolicy)
template<typename Container , typename TimeType , typename TagType >
void apply (Container &storedDatas, TimeType time, TagType tag, bool before) const

Public Attributes

CalciumCouplingPolicy_couplingPolicy

Detailed Description

template<typename DataManipulator>
struct CalciumCouplingPolicy::EraseDataIdBeforeOrAfterTagProcessor< DataManipulator >

Definition at line 355 of file CalciumCouplingPolicy.hxx.


Constructor & Destructor Documentation

template<typename DataManipulator >
CalciumCouplingPolicy::EraseDataIdBeforeOrAfterTagProcessor< DataManipulator >::EraseDataIdBeforeOrAfterTagProcessor ( CalciumCouplingPolicy couplingPolicy) [inline]

Definition at line 359 of file CalciumCouplingPolicy.hxx.

                                                                             :
    _couplingPolicy(couplingPolicy) {};

Member Function Documentation

template<typename DataManipulator >
template<typename Container , typename TimeType , typename TagType >
void CalciumCouplingPolicy::EraseDataIdBeforeOrAfterTagProcessor< DataManipulator >::apply ( Container &  storedDatas,
TimeType  time,
TagType  tag,
bool  before 
) const [inline]

Definition at line 363 of file CalciumCouplingPolicy.hxx.

    {
      typedef typename Container::iterator   iterator;
      typedef typename Container::reverse_iterator   riterator;

      if(_couplingPolicy._dependencyType == CalciumTypes::TIME_DEPENDENCY)
        {
          if(before)
            {
              iterator it=storedDatas.begin();
              while(it != storedDatas.end() && it->first.first <= time)
                {
                  DataManipulator::delete_data(it->second);
                  storedDatas.erase(it);
                  it=storedDatas.begin();
                }
            }
          else
            {
              riterator it=storedDatas.rbegin();
              while(it != storedDatas.rend() && it->first.first >= time)
                {
                  DataManipulator::delete_data(it->second);
                  storedDatas.erase(it->first);
                  it=storedDatas.rbegin();
                }
            }
        }
      else
        {
          if(before)
            {
              iterator it=storedDatas.begin();
              while(it != storedDatas.end() && it->first.second <= tag)
                {
                  DataManipulator::delete_data(it->second);
                  storedDatas.erase(it);
                  it=storedDatas.begin();
                }
            }
          else
            {
              riterator it=storedDatas.rbegin();
              while(it != storedDatas.rend() && it->first.second >= tag)
                {
                  DataManipulator::delete_data(it->second);
                  storedDatas.erase(it->first);
                  it=storedDatas.rbegin();
                }
            }
        }
    }

Member Data Documentation

Definition at line 357 of file CalciumCouplingPolicy.hxx.


The documentation for this struct was generated from the following file: