]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/VectorValuesContainer.h
...
[FrontAlgorithms.git] / lib / fpa / Base / VectorValuesContainer.h
1 #ifndef __FPA__BASE__VECTORVALUESCONTAINER__H__
2 #define __FPA__BASE__VECTORVALUESCONTAINER__H__
3
4 #include <vector>
5 #include <itkSimpleDataObjectDecorator.h>
6 #include <itkSmartPointer.h>
7
8 namespace fpa
9 {
10   namespace Base
11   {
12     /**
13      */
14     template< class T >
15     class VectorValuesContainer
16       : public itk::SimpleDataObjectDecorator< std::vector< T > >
17     {
18     public:
19       typedef std::vector< T >                             TDecorated;
20       typedef VectorValuesContainer                        Self;
21       typedef itk::SimpleDataObjectDecorator< TDecorated > Superclass;
22       typedef itk::SmartPointer< Self >                    Pointer;
23       typedef itk::SmartPointer< const Self >              ConstPointer;
24
25       typedef T TValue;
26       typedef typename TDecorated::iterator          Iterator;
27       typedef typename TDecorated::const_iterator    ConstIterator;
28
29     public:
30       itkNewMacro( Self );
31       itkTypeMacro( VectorValuesContainer, itkSimpleDataObjectDecorator );
32
33     public:
34       void PushBack( const T& v )
35         { this->Get( ).push_back( v ); this->Modified( ); }
36       void PopBack( const T& v )
37         { this->Get( ).pop_back( ); this->Modified( ); }
38       Iterator Begin( )
39         { return( this->Get( ).begin( ) ); }
40       Iterator End( )
41         { return( this->Get( ).end( ) ); }
42       ConstIterator Begin( ) const
43         { return( this->Get( ).begin( ) ); }
44       ConstIterator End( ) const
45         { return( this->Get( ).end( ) ); }
46
47     protected:
48       VectorValuesContainer( )
49         : Superclass( )
50         { }
51       virtual ~VectorValuesContainer( )
52         { }
53
54     private:
55       // Purposely not implemented
56       VectorValuesContainer( const Self& other );
57       Self& operator=( const Self& other );
58     };
59
60   } // ecapseman
61
62 } // ecapseman
63
64 #endif // __FPA__BASE__VECTORVALUESCONTAINER__H__
65
66 // eof - $RCSfile$