00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef _MITK_STL_VECTOR_H_ 00019 #define _MITK_STL_VECTOR_H_ 00020 00021 #include <vector> 00022 #include <itkSimpleDataObjectDecorator.h> 00023 00024 namespace mitk 00025 { 00026 00027 00028 template <typename T> 00029 class STLVectorContainer : public itk::SimpleDataObjectDecorator< std::vector<T> > 00030 { 00031 public: 00032 00033 typedef STLVectorContainer<T> Self; 00034 typedef itk::SimpleDataObjectDecorator< std::vector<T> > Superclass; 00035 typedef itk::SmartPointer<Self> Pointer; 00036 typedef itk::SmartPointer<const Self> ConstPointer; 00037 itkTypeMacro(STLVectorContainer,itk::SimpleDataObjectDecorator) 00038 itkNewMacro( Self ); 00039 00040 typedef T ValueType; 00041 00042 typedef std::vector<ValueType> STLVectorContainerType; 00043 00048 unsigned int GetSize(); 00049 00054 void Clear(); 00055 00059 void Resize( unsigned int size ); 00060 00065 void SetElement( const unsigned int& index, const ValueType& element ); 00066 00071 ValueType& GetElement( const unsigned int& index ); 00072 00073 00074 }; 00075 00076 typedef STLVectorContainer<int> IntVectorContainer; 00077 typedef STLVectorContainer<unsigned int> UnsignedIntVectorContainer; 00078 typedef STLVectorContainer<long> LongVectorContainer; 00079 typedef STLVectorContainer<unsigned long> UnsignedLongVectorContainer; 00080 typedef STLVectorContainer<short int> ShortIntVectorContainer; 00081 typedef STLVectorContainer<short unsigned int> ShortUnsignedIntVectorContainer; 00082 typedef STLVectorContainer<float> FloatVectorContainer; 00083 typedef STLVectorContainer<double> DoubleVectorContainer; 00084 00085 00086 } //end of namespace mitk 00087 00088 #include "mitkSTLVectorContainer.txx" 00089 00090 #endif