diff options
Diffstat (limited to '')
-rw-r--r-- | src/list.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 ); |