Skip to content
Snippets Groups Projects
Commit c6a549f1 authored by Nina Džugasová's avatar Nina Džugasová Committed by Tomáš Oberhuber
Browse files

Improved documentation of Containers/List.

parent 8baf2486
No related branches found
No related tags found
1 merge request!15Nina
...@@ -26,9 +26,9 @@ template< class T > class ListDataElement; ...@@ -26,9 +26,9 @@ template< class T > class ListDataElement;
/*! To acces elements in the list one can use method getSize() and /*! To acces elements in the list one can use method getSize() and
operator[](). To add elements there are methods Append(), operator[](). To add elements there are methods Append(),
Prepend() and Insert() to insert an element at given Prepend() and Insert() to insert an element at given
position. To erase particular element there is merthod position. To erase particular element there is method
Erase() taking the element position. To erase all elements Erase() taking the element position. To erase all elements
there is method EraseAll. There are also alternatives DeepErase() there is method reset(). There are also alternatives DeepErase()
and DeepEraseAll() to free dynamicaly allocated data inside the and DeepEraseAll() to free dynamicaly allocated data inside the
data elements. data elements.
The list stores pointer to last accesed element so if one goes The list stores pointer to last accesed element so if one goes
...@@ -51,7 +51,7 @@ template< class T > class List ...@@ -51,7 +51,7 @@ template< class T > class List
/// \brief Copy constructor. /// \brief Copy constructor.
/// ///
/// Construct a copy of \e list. /// Construct a copy of \e list.
/// @param list Name of another list. /// \param list Name of another list.
List( const List& list ); List( const List& list );
/// \brief Destructor. /// \brief Destructor.
...@@ -96,18 +96,27 @@ template< class T > class List ...@@ -96,18 +96,27 @@ template< class T > class List
bool Insert( const T& data, const int& ind ); bool Insert( const T& data, const int& ind );
/// Appends copy of another list. /// Appends copy of another list.
///
/// \param lst Name of another list.
bool AppendList( const List< T >& lst ); bool AppendList( const List< T >& lst );
/// Prepends copy of another list. /// Prepends copy of another list.
///
/// \param lst Name of another list.
bool PrependList( const List< T >& lst ); bool PrependList( const List< T >& lst );
/// Transforms list to an \e array.
template< typename Array > template< typename Array >
void toArray( Array& array ); void toArray( Array& array );
/// Erases data element at given position. /// Erases data element at given position.
///
/// \param ind Index of the data element one chooses to remove.
void Erase( const int& ind ); void Erase( const int& ind );
/// Erases data element with contained data at given position. /// Erases data element with contained data at given position.
///
/// \param ind Index of the data element one chooses to remove.
void DeepErase( const int& ind ); void DeepErase( const int& ind );
/// Erases all data elements. /// Erases all data elements.
...@@ -119,15 +128,23 @@ template< class T > class List ...@@ -119,15 +128,23 @@ template< class T > class List
void DeepEraseAll(); void DeepEraseAll();
/// Saves the list in binary format. /// Saves the list in binary format.
///
/// \param file Name of file.
bool Save( File& file ) const; bool Save( File& file ) const;
/// Saves the list in binary format using method save of type T. /// Saves the list in binary format using method save of type T.
///
/// \param file Name of file.
bool DeepSave( File& file ) const; bool DeepSave( File& file ) const;
/// Loads the list. /// Loads the list from file.
///
/// \param file Name of file.
bool Load( File& file ); bool Load( File& file );
/// Loads the list using method Load of the type T. /// Loads the list from file using method Load of the type T.
///
/// \param file Name of file.
bool DeepLoad( File& file ); bool DeepLoad( File& file );
protected: protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment