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_CONTAINER_TXX_ 00019 #define _MITK_STL_VECTOR_CONTAINER_TXX_ 00020 00021 #include "mitkSTLVectorContainer.h" 00022 00023 template<typename T> 00024 unsigned int mitk::STLVectorContainer<T>::GetSize() 00025 { 00026 return this->Get().size(); 00027 } 00028 00029 template<typename T> 00030 void mitk::STLVectorContainer<T>::Clear() 00031 { 00032 return this->Get().clear(); 00033 this->Modified(); 00034 } 00035 00036 /* 00037 * Resizes the underlying stl vector to the given size. 00038 */ 00039 template<typename T> 00040 void mitk::STLVectorContainer<T>::Resize( unsigned int size ) 00041 { 00042 this->Get().resize( size ); 00043 this->Modified(); 00044 } 00045 00046 /* 00047 * sets the n'th element of the underluing stl vector. 00048 * if the index is out of range, an assertion is raised 00049 */ 00050 template<typename T> 00051 void mitk::STLVectorContainer<T>::SetElement( const unsigned int& index, const typename mitk::STLVectorContainer<T>::ValueType& element ) 00052 { 00053 assert( index < this->Get().size() ); 00054 this->Get()[index] = element; 00055 this->Modified(); 00056 } 00057 00058 /* 00059 * returns the n'th element of the undelying stl vector 00060 * If the index is out of range, an assertion is raised! 00061 */ 00062 template<typename T> 00063 typename mitk::STLVectorContainer<T>::ValueType& mitk::STLVectorContainer<T>::GetElement( const unsigned int& index ) 00064 { 00065 assert( index < this->Get().size() ); 00066 return this->Get()[index]; 00067 00068 } 00069 00070 00071 #endif