w_list_t< T, LOCK > Class Template Reference

Inherits w_list_base_t.

Inherited by w_keyed_list_t< T, LOCK, K >.

Inheritance diagram for w_list_t< T, LOCK >:

Inheritance graph
[legend]
Collaboration diagram for w_list_t< T, LOCK >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T, class LOCK>
class w_list_t< T, LOCK >

Templated list of type T.

Attention:
These lists are not thread-safe. The user must provide the locks to access the lists if thread-safety is necessary. In order to identify the locations of all these, I am adding a template type for the lock, and I'm going to assert lock.is_mine, at least in debugging mode.

Definition at line 264 of file w_list.h.

Public Member Functions

NORET w_list_t (uint4_t link_offset, LOCK *l)
 Linked list constructor.
NORET w_list_t ()
NORET ~w_list_t ()
void set_offset (uint4_t link_offset)
virtual void put_in_order (T *t)
w_list_t< T, LOCK > & push_front (T *t)
w_list_t< T, LOCK > & push_back (T *t)
T * front ()
T * back ()
T * pop_front ()
T * pop_back ()
w_list_t< T, LOCK > & push (T *t)
 Insert.
w_list_t< T, LOCK > & append (T *t)
 Insert at tail.
T * pop ()
 Remove.
T * chop ()
 Remove from rear.
T * top ()
 Get first but don't remove.
T * bottom ()
 Get last but don't remove.
T * next (w_link_t *p)
 Get next.
T * prev (w_link_t *p)
 Get prev.

Protected Member Functions

w_link_tlink_of (T *t)
const w_link_tlink_of (const T *t) const
 const version of the above
T * base_of (w_link_t *p) const
 return object of which the given link is a member
const T * base_of (const w_link_t *p) const
 const version of the above

Friends

ostream &const w_list_t< T,
LOCK > & 
l
ostream & operator<< BIND_FRIEND_OPERATOR_PART_2 (T, LOCK)(ostream &o
 streams output


Constructor & Destructor Documentation

template<class T, class LOCK>
NORET w_list_t< T, LOCK >::w_list_t ( uint4_t  link_offset,
LOCK *  l 
) [inline]

Linked list constructor.

Parameters:
[in] link_offset Offset into type T of the w_link_t used for this list.
[in] l Pointer to the lock that will protect this list.
Note:
These lists are not locked; it is up to the client to provide synchronization for the list. The LOCK template argument is solely to make the list uses somewhat self-documenting. By code perusal you might be able to tell what lock type and what lock is meant to protect this list.

Definition at line 308 of file w_list.h.

template<class T, class LOCK>
NORET w_list_t< T, LOCK >::w_list_t (  )  [inline]

create a list sans offset. Client must use set_offset later, before using the list.

Definition at line 321 of file w_list.h.


Member Function Documentation

template<class T, class LOCK>
w_link_t* w_list_t< T, LOCK >::link_of ( T *  t  )  [inline, protected]

return non-const ptr to link member of an object in this list

Definition at line 268 of file w_list.h.

Referenced by w_list_t< xct_dependent_t, w_pthread_lock_t >::append(), w_list_t< xct_dependent_t, w_pthread_lock_t >::push(), w_descend_list_t< T, LOCK, K >::put_in_order(), and w_ascend_list_t< T, LOCK, K >::put_in_order().

Here is the caller graph for this function:

template<class T, class LOCK>
void w_list_t< T, LOCK >::set_offset ( uint4_t  link_offset  )  [inline]

Tell the list where to find the offset of the w_link_t in the item-type T. Lists constructed with the vacuous constructor must have this called before the list is used.

Reimplemented from w_list_base_t.

Definition at line 331 of file w_list.h.

Referenced by w_keyed_list_t< T, LOCK, K >::set_offset().

Here is the caller graph for this function:

template<class T, class LOCK>
virtual void w_list_t< T, LOCK >::put_in_order ( T *  t  )  [inline, virtual]

For ordered lists, this uses the ordering. For unordered lists (simply w_list_t<T,LOCK>), it just inserts.

Reimplemented in w_ascend_list_t< T, LOCK, K >, and w_descend_list_t< T, LOCK, K >.

Definition at line 337 of file w_list.h.


The documentation for this class was generated from the following file:
Generated on Wed Jul 7 17:22:43 2010 for Shore Storage Manager by  doxygen 1.4.7