aboutsummaryrefslogtreecommitdiff
path: root/src/list.h
diff options
context:
space:
mode:
authorDavid <david@xagasoft.com>2007-06-18 19:41:34 +0000
committerDavid <david@xagasoft.com>2007-06-18 19:41:34 +0000
commit5292e5831934dc719d1ac06332bd252abe4ac3bc (patch)
tree1acbd783f6c155bcd376bcb4460ae47868e8285a /src/list.h
parent2b90449c30e4a420af4fff7e58588611d71f61fc (diff)
downloadlibbu++-5292e5831934dc719d1ac06332bd252abe4ac3bc.tar.gz
libbu++-5292e5831934dc719d1ac06332bd252abe4ac3bc.tar.bz2
libbu++-5292e5831934dc719d1ac06332bd252abe4ac3bc.tar.xz
libbu++-5292e5831934dc719d1ac06332bd252abe4ac3bc.zip
david - writing code documentation...
Diffstat (limited to '')
-rw-r--r--src/list.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/list.h b/src/list.h
index 4131987..9d1f904 100644
--- a/src/list.h
+++ b/src/list.h
@@ -21,6 +21,10 @@ namespace Bu
21 * members are only accessable const. Third, erasing a location does not 21 * members are only accessable const. Third, erasing a location does not
22 * invalidate the iterator, it simply points to the next valid location, or 22 * invalidate the iterator, it simply points to the next valid location, or
23 * end() if there are no more. 23 * end() if there are no more.
24 *
25 *@param value (typename) The type of data to store in your list
26 *@param valuealloc (typename) Memory Allocator for your value type
27 *@param linkalloc (typename) Memory Allocator for the list links.
24 */ 28 */
25 template<typename value, typename valuealloc=std::allocator<value>, typename linkalloc=std::allocator<struct ListLink<value> > > 29 template<typename value, typename valuealloc=std::allocator<value>, typename linkalloc=std::allocator<struct ListLink<value> > >
26 class List 30 class List
@@ -53,6 +57,10 @@ namespace Bu
53 clear(); 57 clear();
54 } 58 }
55 59
60 /**
61 * Assignment operator.
62 *@param src (const MyType &) The list to assign to your list.
63 */
56 MyType &operator=( const MyType &src ) 64 MyType &operator=( const MyType &src )
57 { 65 {
58 clear(); 66 clear();
@@ -62,6 +70,9 @@ namespace Bu
62 } 70 }
63 } 71 }
64 72
73 /**
74 * Clear the data from the list.
75 */
65 void clear() 76 void clear()
66 { 77 {
67 Link *pCur = pFirst; 78 Link *pCur = pFirst;
@@ -79,6 +90,10 @@ namespace Bu
79 nSize = 0; 90 nSize = 0;
80 } 91 }
81 92
93 /**
94 * Append a value to the list.
95 *@param v (const value_type &) The value to append.
96 */
82 void append( const value &v ) 97 void append( const value &v )
83 { 98 {
84 Link *pNew = la.allocate( 1 ); 99 Link *pNew = la.allocate( 1 );