Back to index

salome-kernel  6.5.0
Public Types | Public Member Functions | Public Attributes
AdjacentFunctor< T > Struct Template Reference

#include <AdjacentFunctor.hxx>

Collaboration diagram for AdjacentFunctor< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef ConstTrait< T >
::NonConstType 
TNoConst

Public Member Functions

 AdjacentFunctor (const T &value)
bool operator() (const T &v1)
void setMaxValue (const T &value)
bool isEqual () const
bool isBounded () const
bool getBounds (TNoConst &min, TNoConst &max) const
void reset ()

Public Attributes

const T & _minValue
_maxValue
TNoConst _max
TNoConst _min
bool _minFound
bool _maxFound
bool _equal

Detailed Description

template<typename T>
struct AdjacentFunctor< T >

Definition at line 41 of file AdjacentFunctor.hxx.


Member Typedef Documentation

template<typename T>
typedef ConstTrait<T>::NonConstType AdjacentFunctor< T >::TNoConst

Definition at line 43 of file AdjacentFunctor.hxx.


Constructor & Destructor Documentation

template<typename T>
AdjacentFunctor< T >::AdjacentFunctor ( const T &  value) [inline]

Definition at line 50 of file AdjacentFunctor.hxx.

                                 :_minValue(value),_maxValue(value),
                                  _minFound(false),_maxFound(false),
                                  _equal(false) {}

Member Function Documentation

template<typename T>
bool AdjacentFunctor< T >::getBounds ( TNoConst min,
TNoConst max 
) const [inline]

Definition at line 106 of file AdjacentFunctor.hxx.

                                                       {
#ifdef MYDEBUG
    std::cout << "_minFound : " <<_minFound << ", _maxFound " << _maxFound << std::endl;
#endif
    if (_minFound && _maxFound ) { min=_min; max=_max; return true; }
    return false;
  }
template<typename T>
bool AdjacentFunctor< T >::isBounded ( ) const [inline]

Definition at line 105 of file AdjacentFunctor.hxx.

{ return _minFound && _maxFound;}

Here is the caller graph for this function:

template<typename T>
bool AdjacentFunctor< T >::isEqual ( ) const [inline]

Definition at line 104 of file AdjacentFunctor.hxx.

{ return _equal;}

Here is the caller graph for this function:

template<typename T>
bool AdjacentFunctor< T >::operator() ( const T &  v1) [inline]

Definition at line 55 of file AdjacentFunctor.hxx.

                               {
#ifdef MYDEBUG
    std::cout << "AdjacentFunctor: " << _minValue << _maxValue << std::endl;
    std::cout << "AdjacentFunctor: " << _min << _max << std::endl;
#endif
    if ( v1 <= _minValue && v1 >= _maxValue)    
    {
      _equal= true;
#ifdef MYDEBUG
      std::cout << "AdjacentFunctor: _equal : " << v1 << std::endl;   
#endif
      return true; 
    }
    if ( v1 < _minValue )    
    {
      _min=v1;_minFound=true;
#ifdef MYDEBUG
      std::cout << "AdjacentFunctor: _minFound : " <<_min << std::endl;
#endif
    }
    else if ( v1 > _maxValue )
    {
      _max=v1;_maxFound=true;
#ifdef MYDEBUG
      std::cout << "AdjacentFunctor: _maxFound : " <<_max << std::endl;
#endif
    }


    /*
    if ( v1 < _minValue)    {
      std::cout << "EE1: _min : " << _min << std::endl;
      _min=v1;_minFound=true;
      std::cout << "AdjacentFunctor: _minFound : " <<_min << ", _minValue " << _minValue << std::endl;
    } else if ( v1 > _maxValue ) {
      _max=v1;_maxFound=true;
      std::cout << "AdjacentFunctor: _maxFound : " <<_max << ", _maxValue " << _maxValue << std::endl;
    } else {
      _equal= true;
      std::cout << "AdjacentFunctor: _equal : " << v1<< ", _minValue " << _minValue << ", _maxValue " << _maxValue << std::endl;   
      return true; 
    } // end if
    */
    
    //std::cout << "AdjacentFunctor: _minFound : " <<_min << ", _maxFound " << _max << std::endl;
    return  ( _minFound && _maxFound );
  }
template<typename T>
void AdjacentFunctor< T >::reset ( ) [inline]

Definition at line 113 of file AdjacentFunctor.hxx.

{ _minFound = false; _maxFound = false; _equal = false; };
template<typename T>
void AdjacentFunctor< T >::setMaxValue ( const T &  value) [inline]

Definition at line 103 of file AdjacentFunctor.hxx.

{_maxValue = value;}

Here is the caller graph for this function:


Member Data Documentation

template<typename T>
bool AdjacentFunctor< T >::_equal

Definition at line 48 of file AdjacentFunctor.hxx.

template<typename T>
TNoConst AdjacentFunctor< T >::_max

Definition at line 46 of file AdjacentFunctor.hxx.

template<typename T>
bool AdjacentFunctor< T >::_maxFound

Definition at line 48 of file AdjacentFunctor.hxx.

template<typename T>
T AdjacentFunctor< T >::_maxValue

Definition at line 45 of file AdjacentFunctor.hxx.

template<typename T>
TNoConst AdjacentFunctor< T >::_min

Definition at line 47 of file AdjacentFunctor.hxx.

template<typename T>
bool AdjacentFunctor< T >::_minFound

Definition at line 48 of file AdjacentFunctor.hxx.

template<typename T>
const T& AdjacentFunctor< T >::_minValue

Definition at line 44 of file AdjacentFunctor.hxx.


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