Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
utility::in_place_list< T > Class Template Reference

#include <in_place_list.hh>

Inheritance diagram for utility::in_place_list< T >:
Inheritance graph
[legend]

Public Types

typedef platform::Size Size
 

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::VirtualBase
 VirtualBase ()=default
 Default constructor. More...
 
virtual ~VirtualBase ()=default
 The virtual destructor is one of the main reasons for the VirtualBase class. More...
 
 VirtualBase (VirtualBase const &)=default
 
 VirtualBase (VirtualBase &&)=default
 
VirtualBaseoperator= (VirtualBase const &)=default
 
VirtualBaseoperator= (VirtualBase &&)=default
 

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_
 

Member Typedef Documentation

Constructor & Destructor Documentation

template<class T >
utility::in_place_list< T >::in_place_list ( )
inline
template<class T >
utility::in_place_list< T >::in_place_list ( Size  n_items)
inline
template<class T >
utility::in_place_list< T >::in_place_list ( Size  n_items,
T const &  val 
)
inline

Size + value constructor; list can be used straight away, unlike with the default constructor.

Member Function Documentation

template<class T >
void utility::in_place_list< T >::clear ( )
inline
template<class T >
Size utility::in_place_list< T >::end ( ) const
inline
template<class T >
void utility::in_place_list< T >::extract ( Size  index)
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 debug_assert, utility::in_place_list< T >::elements_, utility::in_place_list< T >::head_, ObjexxFCL::index(), 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().

template<class T >
Size utility::in_place_list< T >::head ( ) const
inline
template<class T >
void utility::in_place_list< T >::move_to_back ( Size  index)
inline
template<class T >
void utility::in_place_list< T >::move_to_front ( Size  index)
inline
template<class T >
list_element< T > const& utility::in_place_list< T >::operator[] ( Size  index) const
inline
template<class T >
list_element< T >& utility::in_place_list< T >::operator[] ( Size  index)
inline
template<class T >
void utility::in_place_list< T >::remove ( Size  index)
inline
template<class T >
void utility::in_place_list< T >::resize ( Size  n_items)
inline
template<class T >
void utility::in_place_list< T >::set_head ( Size  index)
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 debug_assert, utility::in_place_list< T >::elements_, utility::in_place_list< T >::head_, ObjexxFCL::index(), and utility::in_place_list< T >::tail_.

Referenced by utility::in_place_list< T >::move_to_front().

template<class T >
void utility::in_place_list< T >::set_tail ( Size  index)
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 debug_assert, utility::in_place_list< T >::elements_, utility::in_place_list< T >::head_, ObjexxFCL::index(), and utility::in_place_list< T >::tail_.

Referenced by utility::in_place_list< T >::move_to_back().

template<class T >
Size utility::in_place_list< T >::size ( ) const
inline
template<class T >
Size utility::in_place_list< T >::tail ( ) const
inline

Member Data Documentation

template<class T >
utility::vector1< list_element< T > > utility::in_place_list< T >::elements_
private
template<class T >
Size utility::in_place_list< T >::head_
private
template<class T >
Size utility::in_place_list< T >::tail_
private

The documentation for this class was generated from the following files: