#include <sync_list.h>
Public Types | |
typedef Sequence::iterator | iterator |
typedef Sequence::const_iterator | const_iterator |
typedef Sequence::size_type | size_type |
typedef Sequence::reference | reference |
typedef Sequence::const_reference | const_reference |
typedef Sequence::value_type | value_type |
Public Member Functions | |
bool | empty () |
Judge if the list is empty. | |
size_type | size () |
Get the size of list. | |
bool | front (reference ret) |
Get the first element in the list. If the list is empty, it will return false, else return true and assign the first element to the parameter. | |
T & | operator[] (int index) |
Get element without range check. | |
T & | at (int index) |
Get element with range check. | |
bool | insert (int index, const T &e) |
Add the specified element into the list. | |
bool | push_front (const T &x) |
Add a specified element to be the first element of the list. | |
bool | push_back (const T &x) |
Add a specified element to be the last element of the list. | |
void | pop_front () |
Pop the first element of the list. | |
void | pop_back () |
Pop the last element of the list. | |
void | clear () |
Erases all of the elements. | |
bool | remove (const T &value) |
Remove one element. different from remove in stl, which remove all the same elements. | |
void | unique () |
Removes all but the first element in every consecutive group of equal elements. | |
void | merge (Sequence &x) |
Both *this and x must be sorted according to operator<, and they must be distinct. (That is, it is required that &x != this.) This function removes all of x's elements and inserts them in order into *this. | |
void | reverse () |
Reverses the order of elements in the list. All iterators remain valid and continue to point to the same elements. | |
void | sort () |
Sort the list. | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
T | The type of the element which is stored in the list | |
Sequence | The internal list's type which take the std::list<T> as the default value. * |
typedef Sequence::iterator amino::SyncList< T, Sequence >::iterator |
typedef Sequence::const_iterator amino::SyncList< T, Sequence >::const_iterator |
typedef Sequence::size_type amino::SyncList< T, Sequence >::size_type |
typedef Sequence::reference amino::SyncList< T, Sequence >::reference |
typedef Sequence::const_reference amino::SyncList< T, Sequence >::const_reference |
typedef Sequence::value_type amino::SyncList< T, Sequence >::value_type |
bool amino::SyncList< T, Sequence >::empty | ( | ) | [inline] |
Judge if the list is empty.
size_type amino::SyncList< T, Sequence >::size | ( | ) | [inline] |
Get the size of list.
bool amino::SyncList< T, Sequence >::front | ( | reference | ret | ) | [inline] |
Get the first element in the list. If the list is empty, it will return false, else return true and assign the first element to the parameter.
ret | The first element in the list. It is valid if the return value is true. |
T& amino::SyncList< T, Sequence >::operator[] | ( | int | index | ) | [inline] |
Get element without range check.
index | The position of the element |
T& amino::SyncList< T, Sequence >::at | ( | int | index | ) | [inline] |
Get element with range check.
index | The position of the element |
bool amino::SyncList< T, Sequence >::insert | ( | int | index, | |
const T & | e | |||
) | [inline] |
Add the specified element into the list.
index | The position to be added to | |
value | The element to be added |
bool amino::SyncList< T, Sequence >::push_front | ( | const T & | x | ) | [inline] |
Add a specified element to be the first element of the list.
bool amino::SyncList< T, Sequence >::push_back | ( | const T & | x | ) | [inline] |
Add a specified element to be the last element of the list.
void amino::SyncList< T, Sequence >::pop_front | ( | ) | [inline] |
Pop the first element of the list.
void amino::SyncList< T, Sequence >::pop_back | ( | ) | [inline] |
Pop the last element of the list.
void amino::SyncList< T, Sequence >::clear | ( | ) | [inline] |
Erases all of the elements.
bool amino::SyncList< T, Sequence >::remove | ( | const T & | value | ) | [inline] |
void amino::SyncList< T, Sequence >::unique | ( | ) | [inline] |
Removes all but the first element in every consecutive group of equal elements.
void amino::SyncList< T, Sequence >::merge | ( | Sequence & | x | ) | [inline] |
Both *this and x must be sorted according to operator<, and they must be distinct. (That is, it is required that &x != this.) This function removes all of x's elements and inserts them in order into *this.
x Another list
void amino::SyncList< T, Sequence >::reverse | ( | ) | [inline] |
Reverses the order of elements in the list. All iterators remain valid and continue to point to the same elements.
void amino::SyncList< T, Sequence >::sort | ( | ) | [inline] |
Sort the list.
iterator amino::SyncList< T, Sequence >::begin | ( | ) | [inline] |
iterator amino::SyncList< T, Sequence >::end | ( | ) | [inline] |
const_iterator amino::SyncList< T, Sequence >::begin | ( | ) | const [inline] |
const_iterator amino::SyncList< T, Sequence >::end | ( | ) | const [inline] |