]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Filters/QueueAlgorithm.h
...
[FrontAlgorithms.git] / lib / fpa / Filters / QueueAlgorithm.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Filters__QueueAlgorithm__h__
6 #define __fpa__Filters__QueueAlgorithm__h__
7
8 #include <deque>
9 #include <fpa/Config.h>
10
11 namespace fpa
12 {
13   namespace Filters
14   {
15       /**
16        */
17       template< class _TDataInterface >
18       class QueueAlgorithm
19         : public _TDataInterface
20       {
21       public:
22         typedef _TDataInterface                 Superclass;
23         typedef QueueAlgorithm                  Self;
24         typedef itk::SmartPointer< Self >       Pointer;
25         typedef itk::SmartPointer< const Self > ConstPointer;
26
27         typedef typename Superclass::TTraits TTraits;
28         fpaTraitsMacro( typename TTraits );
29
30         typedef std::deque< TNode > TQueue;
31
32       public:
33         itkTypeMacro( fpa::Filters::QueueAlgorithm, TDataInterface );
34
35       protected:
36         QueueAlgorithm( bool double_buffer );
37         virtual ~QueueAlgorithm( );
38
39         virtual void _QueueSwap( );
40         virtual void _QueueClear( ) override;
41         virtual TNode _QueuePop( ) override;
42         virtual void _QueuePush( const TNode& n ) override;
43         virtual unsigned long _QueueSize( ) const override;
44
45       private:
46         QueueAlgorithm( const Self& other );
47         Self& operator=( const Self& other );
48
49       protected:
50         TQueue       m_Queues[ 2 ];
51         unsigned int m_CurrQueue;
52         bool         m_DoubleBuffer;
53       };
54
55     } // ecapseman
56
57 } // ecapseman
58
59 #ifndef ITK_MANUAL_INSTANTIATION
60 #  include <fpa/Filters/QueueAlgorithm.hxx>
61 #endif // ITK_MANUAL_INSTANTIATION
62 #endif // __fpa__Filters__QueueAlgorithm__h__
63 // eof - $RCSfile$