1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Filters__PriorityQueueAlgorithm__h__
6 #define __fpa__Filters__PriorityQueueAlgorithm__h__
9 #include <fpa/Config.h>
17 template< class _TDataInterface >
18 class PriorityQueueAlgorithm
19 : public _TDataInterface
22 typedef _TDataInterface Superclass;
23 typedef PriorityQueueAlgorithm Self;
24 typedef itk::SmartPointer< Self > Pointer;
25 typedef itk::SmartPointer< const Self > ConstPointer;
27 typedef typename Superclass::TTraits TTraits;
28 fpaTraitsMacro( typename TTraits );
30 typedef std::vector< TNode > TQueue;
33 bool operator()( const TNode& a, const TNode& b ) const
35 return( b.Value < a.Value );
40 itkTypeMacro( fpa::Filters::PriorityQueueAlgorithm, TDataInterface );
43 PriorityQueueAlgorithm( bool double_buffer );
44 virtual ~PriorityQueueAlgorithm( );
46 virtual void _QueueSwap( );
47 virtual void _QueueClear( ) override;
48 virtual TNode _QueuePop( ) override;
49 virtual void _QueuePush( const TNode& n ) override;
50 virtual unsigned long _QueueSize( ) const override;
53 PriorityQueueAlgorithm( const Self& other );
54 Self& operator=( const Self& other );
58 TQueueOrder m_QueueOrder;
59 unsigned int m_CurrQueue;
67 #ifndef ITK_MANUAL_INSTANTIATION
68 # include <fpa/Filters/PriorityQueueAlgorithm.hxx>
69 #endif // ITK_MANUAL_INSTANTIATION
70 #endif // __fpa__Filters__PriorityQueueAlgorithm__h__