diff --git a/Code/Common/otbObjectList.h b/Code/Common/otbObjectList.h index ee9d51575448e2258581b66e4896b382147ddd46..76d3bb96526f6a05067fcdd26c5d5d4f47b80f59 100644 --- a/Code/Common/otbObjectList.h +++ b/Code/Common/otbObjectList.h @@ -60,12 +60,12 @@ public: * Get the capacity of the vector. * \return The capacity of the vector. */ - unsigned int Capacity(void); + unsigned int Capacity(void) const; /** * Get the number of elements in the vector. * \return The number of elements in the vector. */ - unsigned int Size(void); + unsigned int Size(void) const; /** * Resize the maximal list capacity. * \param size The new maximal size of the list. @@ -87,7 +87,7 @@ public: * \param index The index of the object to get. * \return The pointer to the nth element of the list. */ - ObjectPointerType GetNthElement(unsigned int index); + ObjectPointerType GetNthElement(unsigned int index) const; /** * Return the first element of the list. * \return The first element of the list. diff --git a/Code/Common/otbObjectList.txx b/Code/Common/otbObjectList.txx index 58ee9321a59cb7ee7b20e4f2929d0903491bc013..d370c7f2c7929405e8d1a4f028f632faf208618f 100644 --- a/Code/Common/otbObjectList.txx +++ b/Code/Common/otbObjectList.txx @@ -47,7 +47,7 @@ namespace otb template <class TObject> unsigned int ObjectList<TObject> - ::Capacity(void) + ::Capacity(void) const { return m_InternalContainer.capacity(); } @@ -58,7 +58,7 @@ namespace otb template <class TObject> unsigned int ObjectList<TObject> - ::Size(void) + ::Size(void) const { return m_InternalContainer.size(); } @@ -104,7 +104,7 @@ namespace otb template <class TObject> typename ObjectList<TObject>::ObjectPointerType ObjectList<TObject> - ::GetNthElement(unsigned int index) + ::GetNthElement(unsigned int index) const { return m_InternalContainer[index]; }