Back to index

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

#include <CalciumCouplingPolicy.hxx>

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

List of all members.

Public Member Functions

 EraseDataIdProcessor (CalciumCouplingPolicy &couplingPolicy)
template<typename Container >
void apply (Container &storedDatas, typename Container::iterator &wDataIt1) const

Public Attributes

CalciumCouplingPolicy_couplingPolicy

Detailed Description

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

Definition at line 425 of file CalciumCouplingPolicy.hxx.


Constructor & Destructor Documentation

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

Definition at line 429 of file CalciumCouplingPolicy.hxx.

                                                             :
    _couplingPolicy(couplingPolicy) {};

Member Function Documentation

template<typename DataManipulator >
template<typename Container >
void CalciumCouplingPolicy::EraseDataIdProcessor< DataManipulator >::apply ( Container &  storedDatas,
typename Container::iterator &  wDataIt1 
) const [inline]

Definition at line 433 of file CalciumCouplingPolicy.hxx.

                                                           {

    typedef typename Container::key_type   key_type;
    typedef typename Container::value_type value_type;
    typedef typename Container::iterator iterator;

#ifdef MYDEBUG
    std::cout << "-------- CalciumCouplingPolicy::eraseDataId, storedDatasSize : " << storedDatas.size() << std::endl;
#endif
 
    if ( _couplingPolicy._storageLevel == CalciumTypes::UNLIMITED_STORAGE_LEVEL ) return;
 
    size_t storedDatasSize = storedDatas.size();
    long   s = storedDatasSize - _couplingPolicy._storageLevel;
    if (s > 0 ) {
      size_t dist=distance(storedDatas.begin(),wDataIt1);
      for (int i=0; i<s; ++i) {
              //no bug if removed : DataManipulator::delete_data((*storedDatas.begin()).second);
              DataManipulator::delete_data((*storedDatas.begin()).second);
              storedDatas.erase(storedDatas.begin());
      }
      // Si l'itérateur pointait sur une valeur que l'on vient de supprimer
      if (dist < s ) {
        throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "StorageLevel management " 
                                            << _couplingPolicy._storageLevel << 
                                            " has just removed the data to send")));
      }
    }
#ifdef MYDEBUG
    std::cout << "-------- CalciumCouplingPolicy::eraseDataId, new storedDatasSize : " << storedDatas.size() << std::endl;
#endif
    return;

  }

Member Data Documentation

template<typename DataManipulator >
CalciumCouplingPolicy& CalciumCouplingPolicy::EraseDataIdProcessor< DataManipulator >::_couplingPolicy

Definition at line 427 of file CalciumCouplingPolicy.hxx.


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