1 #ifndef __FPA__BASE__MATRIXVALUESCONTAINER__H__
2 #define __FPA__BASE__MATRIXVALUESCONTAINER__H__
5 #include <itkSimpleDataObjectDecorator.h>
6 #include <itkSmartPointer.h>
14 template< class I, class V, class VI >
15 class MatrixValuesContainer
16 : public itk::SimpleDataObjectDecorator< std::map< I, std::map< I, V, VI >, VI > >
19 typedef std::map< I, V, VI > TDecoratedRow;
20 typedef std::map< I, TDecoratedRow, VI > TDecorated;
21 typedef MatrixValuesContainer Self;
22 typedef itk::SimpleDataObjectDecorator< TDecorated > Superclass;
23 typedef itk::SmartPointer< Self > Pointer;
24 typedef itk::SmartPointer< const Self > ConstPointer;
28 typedef VI TIndexCompare;
30 typedef typename TDecoratedRow::iterator RowIterator;
31 typedef typename TDecoratedRow::const_iterator ConstRowIterator;
32 typedef typename TDecorated::iterator Iterator;
33 typedef typename TDecorated::const_iterator ConstIterator;
37 itkTypeMacro( MatrixValuesContainer, itkSimpleDataObjectDecorator );
40 void SetValue( const I& a, const I& b, const V& v )
41 { this->Get( )[ a ][ b ] = v; this->Modified( ); }
43 { this->Get( ).clear( ); this->Modified( ); }
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 RowIterator Begin( const Iterator& i )
53 { return( i->second.begin( ) ); }
54 RowIterator End( const Iterator& i )
55 { return( i->second.end( ) ); }
56 ConstRowIterator Begin( const ConstIterator& i ) const
57 { return( i->second.begin( ) ); }
58 ConstRowIterator End( const ConstIterator& i ) const
59 { return( i->second.end( ) ); }
62 MatrixValuesContainer( )
65 virtual ~MatrixValuesContainer( )
69 // Purposely not implemented
70 MatrixValuesContainer( const Self& other );
71 Self& operator=( const Self& other );
78 #endif // __FPA__BASE__MATRIXVALUESCONTAINER__H__