Back to index

salome-kernel  6.5.0
Public Types | Public Member Functions | Public Attributes | Friends
TEST1 Class Reference
Inheritance diagram for TEST1:
Inheritance graph
[legend]
Collaboration diagram for TEST1:
Collaboration graph
[legend]

List of all members.

Public Types

typedef CORBA::Long TimeType
typedef CORBA::Long TagType
typedef std::pair< TimeType,
TagType
DataId
typedef
InternalDataIdContainer
< TimeType, TagType
DataIdContainer
typedef
CalciumTypes::DependencyType 
DependencyType
typedef CalciumTypes::DateCalSchem DateCalSchem
typedef
CalciumTypes::InterpolationSchem 
InterpolationSchem
typedef
CalciumTypes::ExtrapolationSchem 
ExtrapolationSchem
typedef
CalciumTypes::DisconnectDirective 
DisconnectDirective
typedef double TimeType
typedef long TagType
typedef std::pair< TimeType,
TagType
DataId
typedef
InternalDataIdContainer
< TimeType, TagType
DataIdContainer
typedef std::vector< DataId >
::iterator 
iterator

Public Member Functions

 TEST1 ()
 TEST1 ()
filtre_conversionget_filtre_convert_TIME ()
filtre_conversionget_filtre_convert_TAG ()
TimeType getTime (const DataId &dataId) const
TagType getTag (const DataId &dataId) const
template<typename Container >
bool isDataIdConveniant (Container &storedDatas, const typename Container::key_type &expectedDataId, bool &isEqual, bool &isBounded, typename Container::iterator &wDataIt1) const
virtual void wakeupWaiting ()
void setDependencyType (DependencyType dependencyType)
DependencyType getDependencyType () const
void setStorageLevel (size_t storageLevel)
size_t getStorageLevel () const
void setDateCalSchem (DateCalSchem dateCalSchem)
DateCalSchem getDateCalSchem () const
void setAlpha (double alpha)
double getAlpha () const
void setDeltaT (double deltaT)
double getDeltaT () const
void setInterpolationSchem (InterpolationSchem interpolationSchem)
void setExtrapolationSchem (ExtrapolationSchem extrapolationSchem)
InterpolationSchem getInterpolationSchem () const
ExtrapolationSchem getExtrapolationSchem () const
TimeType getTime (const DataId &dataId) const
TagType getTag (const DataId &dataId) const
template<typename AssocContainer >
bool isDataIdConveniant (AssocContainer &storedDatas, const typename AssocContainer::key_type &expectedDataId, bool &isEqual, bool &isBounded, typename AssocContainer::iterator &wDataIt1) const
template<typename Container >
bool isDataIdConveniant (Container &storedDatas, const typename Container::key_type &expectedDataId, bool &isEqual, bool &isBounded, typename Container::iterator &wDataIt1) const
TimeType getEffectiveTime (TimeType ti, TimeType tf)
void disconnect (bool provideLastGivenValue)

Public Attributes

int ret

Friends

class InternalDataIdContainer
class InternalDataIdContainer
class BoundedDataIdProcessor
class EraseDataIdProcessor
class EraseDataIdBeforeOrAfterTagProcessor
class DisconnectProcessor

Detailed Description

Definition at line 37 of file test_DataIdContainer.cxx.


Member Typedef Documentation

typedef std::pair< TimeType , TagType > PalmCouplingPolicy::DataId [inherited]
typedef std::pair< TimeType , TagType > CalciumCouplingPolicy::DataId [inherited]

Definition at line 103 of file CalciumCouplingPolicy.hxx.

Definition at line 62 of file PalmCouplingPolicy.hxx.

Definition at line 104 of file CalciumCouplingPolicy.hxx.

Definition at line 59 of file CalciumCouplingPolicy.hxx.

Definition at line 58 of file CalciumCouplingPolicy.hxx.

Definition at line 62 of file CalciumCouplingPolicy.hxx.

Definition at line 61 of file CalciumCouplingPolicy.hxx.

Definition at line 60 of file CalciumCouplingPolicy.hxx.

typedef std::vector< DataId >::iterator CalciumCouplingPolicy::iterator [inherited]

Definition at line 105 of file CalciumCouplingPolicy.hxx.

typedef CORBA::Long PalmCouplingPolicy::TagType [inherited]

Definition at line 60 of file PalmCouplingPolicy.hxx.

typedef long CalciumCouplingPolicy::TagType [inherited]

Definition at line 102 of file CalciumCouplingPolicy.hxx.

typedef CORBA::Long PalmCouplingPolicy::TimeType [inherited]

Definition at line 59 of file PalmCouplingPolicy.hxx.

typedef double CalciumCouplingPolicy::TimeType [inherited]

Definition at line 101 of file CalciumCouplingPolicy.hxx.


Constructor & Destructor Documentation

TEST1::TEST1 ( ) [inline]

Definition at line 40 of file test_DataIdContainer.cxx.

          {

    ret=0;
  
    CORBA::Long time=1,tag=1;
    typedef CalciumCouplingPolicy::DataIdContainer DataIdContainer;  
    typedef CalciumCouplingPolicy::DataId          DataId;
    
    DataId          dataId(time,tag);   //potentiellement avec un troisième paramètre
    try {
      DataIdContainer dataIds(dataId,*this);   

      DataIdContainer::iterator dataIdIt = dataIds.begin();
      
      if (!dataIds.empty())
        for (;dataIdIt != dataIds.end();++dataIdIt) {
          std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt;
          std::cout << " == " << dataId << " : " << (ret = (*dataIdIt == dataId)) << std::endl;
        }
    } catch(const CalciumException & ex) {
      ret=1;
      std::cout << ex.what() << std::endl;
    }

  }

Here is the call graph for this function:

TEST1::TEST1 ( ) [inline]

Definition at line 35 of file test_DataIdContainer.cxx.

          {

  std::cout << "------------  TEST1 --------------" << std::endl;

  // int ret=0;
  
  CORBA::Long time=1,tag=1;
  typedef PalmCouplingPolicy::DataIdContainer DataIdContainer;  
  typedef PalmCouplingPolicy::DataId          DataId;
    
  DataId          dataId(time,tag);   //potentiellement avec un troisième paramètre
  //std::vector<CORBA::Long> a(1,time);std::vector<CORBA::Long> b(1,tag);
  //DataIdContainer dataIds(a,b);   

  std::cout << "-------- MARK 1 --"<< dataId <<"----------------" << std::endl;
   
  filtre_conversion * f_time = get_filtre_convert_TIME();
  filtre_conversion * f_tag =  get_filtre_convert_TAG(); 

  // On accepte les temps de 1 à 100 sans conversion
  filtre_elementaire * f_time_el = new filtre_elementaire(1, 100);
  f_time->config_elementaire(*f_time_el);

  // On accepte que les tags 1 et ce sans conversion
  filtre_elementaire * f_time_tag = new filtre_elementaire(1);
  f_tag->config_elementaire(*f_time_tag);

  DataIdContainer dataIds(dataId,*this);   

  DataIdContainer::iterator dataIdIt = dataIds.begin();

  if (!dataIds.empty())
    for (;dataIdIt != dataIds.end();++dataIdIt) {
      std::cout << "-------- MARK 2 --"<< *dataIdIt <<"----------------" << std::endl;

    }
  }

Here is the call graph for this function:


Member Function Documentation

void CalciumCouplingPolicy::disconnect ( bool  provideLastGivenValue) [inherited]

Definition at line 105 of file CalciumCouplingPolicy.cxx.

                                                                 {

  if (provideLastGivenValue) {
#ifdef MYDEBUG
    std::cout << "-------- CalciumCouplingPolicy::disconnect CP_CONT  ------------------" << std::endl;
#endif
    _disconnectDirective = CalciumTypes::CONTINUE;
  } else {
#ifdef MYDEBUG
    std::cout << "-------- CalciumCouplingPolicy::disconnect CP_ARRET  ------------------" << std::endl;
#endif
    _disconnectDirective = CalciumTypes::STOP;
  }

  //Wakeup get data if any
  wakeupWaiting();  
}

Here is the call graph for this function:

Definition at line 54 of file PalmCouplingPolicy.hxx.

{ return &filtre_convert_TAG;  }

Here is the caller graph for this function:

Definition at line 53 of file PalmCouplingPolicy.hxx.

{ return &filtre_convert_TIME; }

Here is the caller graph for this function:

double CalciumCouplingPolicy::getAlpha ( ) const [inherited]

Definition at line 67 of file CalciumCouplingPolicy.cxx.

{ return _alpha; }

Definition at line 55 of file CalciumCouplingPolicy.cxx.

{ return _dateCalSchem; }
double CalciumCouplingPolicy::getDeltaT ( ) const [inherited]

Definition at line 76 of file CalciumCouplingPolicy.cxx.

{return _deltaT;}

Definition at line 39 of file CalciumCouplingPolicy.cxx.

{ return _dependencyType;}

Definition at line 96 of file CalciumCouplingPolicy.cxx.

                                                                          {
  if ( _dateCalSchem == CalciumTypes::TI_SCHEM )  return ti;
  if ( _dateCalSchem == CalciumTypes::TF_SCHEM )  return tf;
  
  //CalciumTypes::ALPHA_SCHEM
  return tf*_alpha + ti*(1-_alpha);
}

Definition at line 92 of file CalciumCouplingPolicy.cxx.

{ return _extrapolationSchem; };

Definition at line 91 of file CalciumCouplingPolicy.cxx.

{ return _interpolationSchem; };
size_t CalciumCouplingPolicy::getStorageLevel ( ) const [inherited]

Definition at line 47 of file CalciumCouplingPolicy.cxx.

{return _storageLevel;}
TagType PalmCouplingPolicy::getTag ( const DataId dataId) const [inline, inherited]

Definition at line 65 of file PalmCouplingPolicy.hxx.

{ return dataId.second;}
TagType CalciumCouplingPolicy::getTag ( const DataId dataId) const [inline, inherited]

Definition at line 111 of file CalciumCouplingPolicy.hxx.

{ return dataId.second;}
TimeType PalmCouplingPolicy::getTime ( const DataId dataId) const [inline, inherited]

Definition at line 64 of file PalmCouplingPolicy.hxx.

{ return dataId.first;}
TimeType CalciumCouplingPolicy::getTime ( const DataId dataId) const [inline, inherited]

Definition at line 110 of file CalciumCouplingPolicy.hxx.

{ return dataId.first;}
template<typename Container >
bool CouplingPolicy::isDataIdConveniant ( Container &  storedDatas,
const typename Container::key_type &  expectedDataId,
bool isEqual,
bool isBounded,
typename Container::iterator &  wDataIt1 
) const [inline, inherited]

Definition at line 77 of file CouplingPolicy.hxx.

                                                                        {
    typedef typename Container::key_type   key_type;
    typedef typename Container::value_type value_type;
    typedef typename Container::iterator iterator;
    isBounded = false;
    FindKeyPredicate<value_type> fkp(expectedDataId);
    wDataIt1  = std::find_if(storedDatas.begin(),storedDatas.end(),fkp);
    isEqual   = (wDataIt1 != storedDatas.end());
    std::cout << "-------- Generic isDataIdConvenient : isEqual : " << isEqual << " , isBounded " << isBounded << std::endl;
    return isEqual || isBounded;
  }
template<typename Container >
bool CouplingPolicy::isDataIdConveniant ( Container &  storedDatas,
const typename Container::key_type &  expectedDataId,
bool isEqual,
bool isBounded,
typename Container::iterator &  wDataIt1 
) const [inline, inherited]

Definition at line 77 of file CouplingPolicy.hxx.

                                                                        {
    typedef typename Container::key_type   key_type;
    typedef typename Container::value_type value_type;
    typedef typename Container::iterator iterator;
    isBounded = false;
    FindKeyPredicate<value_type> fkp(expectedDataId);
    wDataIt1  = std::find_if(storedDatas.begin(),storedDatas.end(),fkp);
    isEqual   = (wDataIt1 != storedDatas.end());
    std::cout << "-------- Generic isDataIdConvenient : isEqual : " << isEqual << " , isBounded " << isBounded << std::endl;
    return isEqual || isBounded;
  }
template<typename AssocContainer >
bool CalciumCouplingPolicy::isDataIdConveniant ( AssocContainer &  storedDatas,
const typename AssocContainer::key_type &  expectedDataId,
bool isEqual,
bool isBounded,
typename AssocContainer::iterator &  wDataIt1 
) const [inherited]

Definition at line 292 of file CalciumCouplingPolicy.hxx.

                                                                                                                                    {
 
  // Rem : le type key_type == DataId
  typedef typename AssocContainer::key_type key_type;
  AdjacentFunctor< key_type > af(expectedDataId);
  if ( _dependencyType == CalciumTypes::TIME_DEPENDENCY )
  {
#ifdef MYDEBUG
    std::cout << "-------- time expected : " << expectedDataId.first << std::endl;
    std::cout << "-------- time expected corrected : " << expectedDataId.first*(1.0-_deltaT) << std::endl;
#endif
    af.setMaxValue(key_type(expectedDataId.first*(1.0-_deltaT),0));
  }
  isBounded = false;

  // Rem 1 :
  // L'algo adjacent_find ne peut être utilisé avec l'AdjacentPredicate 
  //   - si la table contient un seul élément l'algorithme adjacent_find retourne end()
  //     que se soit l'élément attendu ou non
  //   - si la table contient deux éléments dont le dernier est celui recherché
  //     l'algorithme adjacent_find retourne end() aussi
  //   d'ou la necessité d'effectuer  un find avant ou d'écrire un algorithme ad hoc
 
  // Rem 2 :
  //
  // L'algo find_if ne peut être utilisé car il recopie l'AdjacentFunctor
  // qui ne peut alors pas mémoriser ses états précédents
  //    
 
  // Un codage en reverse serait plus efficace
  typename AssocContainer::iterator prev    = storedDatas.begin();
  typename AssocContainer::iterator current = prev;
  while ( (current != storedDatas.end()) && !af(current->first)  ) 
  {
#ifdef MYDEBUG
    std::cerr << "------- stored time : " << current->first << std::endl;
#endif
    //  if ( af(current->first) ) break;
    prev = current++;
  }

  isEqual = af.isEqual();
    
  // On considère qu'il n'est pas possible d'encadrer en dépendance itérative,
  // on se veut pas calculer d'interpolation. 
  if  ( _dependencyType == CalciumTypes::TIME_DEPENDENCY)  isBounded = af.isBounded();

  if ( isEqual ) wDataIt1 = current;
  else 
    if (isBounded) wDataIt1 = prev;
    else
      wDataIt1 = storedDatas.end();

#ifdef MYDEBUG
  std::cout << "-------- isDataIdConvenient : isEqual : " << isEqual << " , isBounded " << isBounded << std::endl;
#endif

  return isEqual || isBounded;
}

Here is the call graph for this function:

void CalciumCouplingPolicy::setAlpha ( double  alpha) [inherited]

Definition at line 57 of file CalciumCouplingPolicy.cxx.

                                                 {
  MESSAGE( "CalciumCouplingPolicy::setAlpha: " << alpha );
  if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set alpha on a port that is not time dependent"));
  
  if ( 0 <= alpha && alpha <= 1 ) _alpha = alpha; 
  else 
    throw CalciumException(CalciumTypes::CPRENA,LOC("alpha must be between [0,1]"));
}

Definition at line 48 of file CalciumCouplingPolicy.cxx.

                                                                                          {
  MESSAGE( "CalciumCouplingPolicy::setDateCalSchem: " << dateCalSchem );
  if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set a temporal scheme on a port that is not time dependent"));
  _dateCalSchem = dateCalSchem;
}
void CalciumCouplingPolicy::setDeltaT ( double  deltaT) [inherited]

Definition at line 69 of file CalciumCouplingPolicy.cxx.

                                                    {
  if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set deltaT on a port that is not time dependent"));
  if ( 0 <= deltaT && deltaT <= 1 ) _deltaT = deltaT; 
  else 
    throw(CalciumException(CalciumTypes::CPRENA,LOC("deltaT must be between [0,1]")));
}

Definition at line 85 of file CalciumCouplingPolicy.cxx.

                                                                                                    {
  if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set ExtrapolationSchem on a port that is not time dependent"));
_extrapolationSchem=extrapolationSchem;
}

Definition at line 78 of file CalciumCouplingPolicy.cxx.

                                                                                                    {
  MESSAGE( "CalciumCouplingPolicy::setInterpolationSchem: " << interpolationSchem );
  if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set InterpolationSchem on a port that is not time dependent"));
  _interpolationSchem=interpolationSchem;
}
void CalciumCouplingPolicy::setStorageLevel ( size_t  storageLevel) [inherited]

Definition at line 41 of file CalciumCouplingPolicy.cxx.

                                                                              {
  MESSAGE( "CalciumCouplingPolicy::setStorageLevel: " << storageLevel );
  if ( storageLevel < 1 && (storageLevel != CalciumTypes::UNLIMITED_STORAGE_LEVEL)  )
    throw CalciumException(CalciumTypes::CPRENA,LOC("StorageLevel < 1 is not allowed"));
  _storageLevel = storageLevel;
}
virtual void CouplingPolicy::wakeupWaiting ( ) [inline, virtual, inherited]

Friends And Related Function Documentation

friend class BoundedDataIdProcessor [friend, inherited]

Definition at line 53 of file CalciumCouplingPolicy.hxx.

friend class DisconnectProcessor [friend, inherited]

Definition at line 56 of file CalciumCouplingPolicy.hxx.

friend class EraseDataIdBeforeOrAfterTagProcessor [friend, inherited]

Definition at line 55 of file CalciumCouplingPolicy.hxx.

friend class EraseDataIdProcessor [friend, inherited]

Definition at line 54 of file CalciumCouplingPolicy.hxx.

friend class InternalDataIdContainer [friend, inherited]

Definition at line 50 of file PalmCouplingPolicy.hxx.

friend class InternalDataIdContainer [friend, inherited]

Definition at line 50 of file CalciumCouplingPolicy.hxx.


Member Data Documentation

Definition at line 39 of file test_DataIdContainer.cxx.


The documentation for this class was generated from the following files: