![]() |
Rosetta Utilities
2014.16.56682
|
#include <in_place_list.hh>
Public Types | |
| typedef platform::Size | Size |
Public Types inherited from utility::pointer::ReferenceCount | |
| typedef platform::Size | Size |
| typedef platform::Size | size_type |
Public Member Functions | |
| in_place_list () | |
| in_place_list (Size n_items) | |
| in_place_list (Size n_items, T const &val) | |
| Size + value constructor; list can be used straight away, unlike with the default constructor. More... | |
| Size | size () const |
| void | resize (Size n_items) |
| Clear the list entirely, and resize to be larger. More... | |
| void | clear () |
| O(k) clear – iterates from head to end, clears each element in the list. More... | |
| list_element< T > const & | operator[] (Size index) const |
| list_element< T > & | operator[] (Size index) |
| void | move_to_front (Size index) |
| void | move_to_back (Size index) |
| void | remove (Size index) |
| Size | head () const |
| Size | tail () const |
| Size | end () const |
Public Member Functions inherited from utility::pointer::ReferenceCount | |
| void | ctor () |
| virtual | ~ReferenceCount () |
| Destructor. More... | |
| Size | ref_count () const |
| Reference count. More... | |
Private Member Functions | |
| void | extract (Size index) |
| Remove an element from its place in the list; update the prev_ and next_ pointers of its surrounding elements. Also update the head_ and tail_ pointers for the list, if necessary. More... | |
| void | set_head (Size index) |
| Simply set the head-element in the list. Does not clean up pointers for the surrounding elements if the requested element is already a member of the list. More... | |
| void | set_tail (Size index) |
| Simply set the tail-element in the list. Does not clean up pointers for the surrounding elements if the requested element is already a member of the list. More... | |
Private Attributes | |
| utility::vector1< list_element < T > > | elements_ |
| Size | head_ |
| Size | tail_ |
Additional Inherited Members | |
Protected Member Functions inherited from utility::pointer::ReferenceCount | |
| ReferenceCount () | |
| Default constructor. More... | |
| ReferenceCount (ReferenceCount const &) | |
| Copy constructor. More... | |
| ReferenceCount & | operator= (ReferenceCount const &) |
| Copy assignment. More... | |
| typedef platform::Size utility::in_place_list< T >::Size |
|
inline |
|
inline |
|
inline |
Size + value constructor; list can be used straight away, unlike with the default constructor.
|
inline |
O(k) clear – iterates from head to end, clears each element in the list.
References utility::in_place_list< T >::elements_, utility::in_place_list< T >::end(), utility::in_place_list< T >::head_, and utility::in_place_list< T >::tail_.
Referenced by utility::in_place_list< T >::resize().
|
inline |
Referenced by utility::in_place_list< T >::clear().
|
inlineprivate |
Remove an element from its place in the list; update the prev_ and next_ pointers of its surrounding elements. Also update the head_ and tail_ pointers for the list, if necessary.
References utility::in_place_list< T >::elements_, utility::in_place_list< T >::head_, and utility::in_place_list< T >::tail_.
Referenced by utility::in_place_list< T >::move_to_back(), utility::in_place_list< T >::move_to_front(), and utility::in_place_list< T >::remove().
|
inline |
References utility::in_place_list< T >::head_.
|
inline |
|
inline |
|
inline |
References utility::in_place_list< T >::elements_.
|
inline |
References utility::in_place_list< T >::elements_.
|
inline |
|
inline |
Clear the list entirely, and resize to be larger.
References utility::in_place_list< T >::clear(), utility::in_place_list< T >::elements_, utility::in_place_list< T >::head_, and utility::in_place_list< T >::tail_.
|
inlineprivate |
Simply set the head-element in the list. Does not clean up pointers for the surrounding elements if the requested element is already a member of the list.
References utility::in_place_list< T >::elements_, utility::in_place_list< T >::head_, and utility::in_place_list< T >::tail_.
Referenced by utility::in_place_list< T >::move_to_front().
|
inlineprivate |
Simply set the tail-element in the list. Does not clean up pointers for the surrounding elements if the requested element is already a member of the list.
References utility::in_place_list< T >::elements_, utility::in_place_list< T >::head_, and utility::in_place_list< T >::tail_.
Referenced by utility::in_place_list< T >::move_to_back().
|
inline |
References utility::in_place_list< T >::elements_.
|
inline |
References utility::in_place_list< T >::tail_.
|
private |
Referenced by utility::in_place_list< T >::clear(), utility::in_place_list< T >::extract(), utility::in_place_list< T >::move_to_back(), utility::in_place_list< T >::move_to_front(), utility::in_place_list< T >::operator[](), utility::in_place_list< T >::remove(), utility::in_place_list< T >::resize(), utility::in_place_list< T >::set_head(), utility::in_place_list< T >::set_tail(), and utility::in_place_list< T >::size().
|
private |
|
private |
1.8.7