1 #ifndef __FPA__BASE__UNIQUEVALUESCONTAINER__H__
2 #define __FPA__BASE__UNIQUEVALUESCONTAINER__H__
5 #include <itkSimpleDataObjectDecorator.h>
6 #include <itkSmartPointer.h>
14 template< class V, class VC >
15 class UniqueValuesContainer
16 : public itk::SimpleDataObjectDecorator< std::set< V, VC > >
19 typedef std::set< V, VC > TDecorated;
20 typedef UniqueValuesContainer Self;
21 typedef itk::SimpleDataObjectDecorator< TDecorated > Superclass;
22 typedef itk::SmartPointer< Self > Pointer;
23 typedef itk::SmartPointer< const Self > ConstPointer;
26 typedef VC TValueCompare;
28 typedef typename TDecorated::iterator Iterator;
29 typedef typename TDecorated::const_iterator ConstIterator;
33 itkTypeMacro( UniqueValuesContainer, itkSimpleDataObjectDecorator );
36 void Insert( const V& v )
37 { this->Get( ).insert( v ); this->Modified( ); }
38 void Erase( const V& v )
39 { this->Get( ).erase( v ); this->Modified( ); }
41 { this->Get( ).clear( ); this->Modified( ); }
42 bool Find( const V& v ) const
43 { return( this->Get( ).find( v ) != this->Get( ).end( ) ); }
45 { return( this->Get( ).begin( ) ); }
47 { return( this->Get( ).end( ) ); }
48 ConstIterator Begin( ) const
49 { return( this->Get( ).begin( ) ); }
50 ConstIterator End( ) const
51 { return( this->Get( ).end( ) ); }
52 unsigned long Size( ) const
53 { return( this->Get( ).size( ) ); }
56 UniqueValuesContainer( )
59 virtual ~UniqueValuesContainer( )
63 // Purposely not implemented
64 UniqueValuesContainer( const Self& other );
65 Self& operator=( const Self& other );
72 #endif // __FPA__BASE__UNIQUEVALUESCONTAINER__H__