Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# Oscl_MTLinked_List< LLClass, Alloc, TheLock > Class Template Reference
[OSCL Base]

`#include <oscl_linked_list.h>`

## Public Methods
| Oscl_MTLinked_List ()
| ~Oscl_MTLinked_List ()
int32 | dequeue_element (LLClass &element)
int32 | add_element (LLClass &new_element)
int32 | add_to_front (LLClass &new_element)
uint32 | get_element (int32 index, LLClass &element)
int32 | remove_element (const LLClass &data_to_remove)
int32 | get_index (const LLClass &data)
int32 | remove_element (const int32 index_to_remove)
int32 | move_to_end (const LLClass &data_to_move)
int32 | move_to_front (const LLClass &data_to_move)
## Protected Attributes
Oscl_Linked_List< LLClass, Alloc > | the_list

## Detailed Description

### template<class LLClass, class Alloc, class TheLock>
class Oscl_MTLinked_List< LLClass, Alloc, TheLock >

Oscl_MTLinked_List is a multi-threaded version of the LinkedList. It has mutex protection to allow access by different threads.

## Constructor & Destructor Documentation

template<class LLClass, class Alloc, class TheLock>
Oscl_MTLinked_List< LLClass, Alloc, TheLock >::Oscl_MTLinked_List | ( |  | ) | `[inline]`

| Constructor for Oscl_MTLinked_List

template<class LLClass, class Alloc, class TheLock>
Oscl_MTLinked_List< LLClass, Alloc, TheLock >::~Oscl_MTLinked_List | ( |  | ) | `[inline]`

| Destructor for Oscl_MTLinked_List

## Member Function Documentation

template<class LLClass, class Alloc, class TheLock>
int32 Oscl_MTLinked_List< LLClass, Alloc, TheLock >::add_element | ( | LLClass & | new_element | ) | `[inline]`

  | Adds new element to the Multi Threaded Linked list.if list is already there then it adds element at end of list otherwise it create the list and add the element as first element of list. Parameters:
  new_element | the element to be add in the list.
Returns: 32-bit integer on the success returns 1.

template<class LLClass, class Alloc, class TheLock>
int32 Oscl_MTLinked_List< LLClass, Alloc, TheLock >::add_to_front | ( | LLClass & | new_element | ) | `[inline]`

  | Adds new element at the start of the Multi Threaded Linked list. if list is already exist then it adds element at start of list otherwise it create the list and add the element as first element of list. Parameters:
  new_element | the element to be add in the list.
Returns: 32-bit integer on the success returns 1.

template<class LLClass, class Alloc, class TheLock>
int32 Oscl_MTLinked_List< LLClass, Alloc, TheLock >::dequeue_element | ( | LLClass & | element | ) | `[inline]`

template<class LLClass, class Alloc, class TheLock>
uint32 Oscl_MTLinked_List< LLClass, Alloc, TheLock >::get_element | ( | int32 | index,
|  | LLClass & | element
| ) | `[inline]`

  | Search and returs the element in the Multi Treaded Linked List for passed index. Parameters:
  index, element | The index is the count for the node.
Returns: 32-bit integer on success returns 1 otherwise returns 0.

template<class LLClass, class Alloc, class TheLock>
int32 Oscl_MTLinked_List< LLClass, Alloc, TheLock >::get_index | ( | const LLClass & | data | ) | `[inline]`

  | Returns the index for requested element. Parameters:
  data | the element for which index to be return.
Returns: 32-bit integer if data is found in the list it returns index otherwise it returns -1.

template<class LLClass, class Alloc, class TheLock>
int32 Oscl_MTLinked_List< LLClass, Alloc, TheLock >::move_to_end | ( | const LLClass & | data_to_move | ) | `[inline]`

  | Moves the element to end of the list Parameters:
  data_to_move |
Returns: On success returns 1 otherwise returns 0.

template<class LLClass, class Alloc, class TheLock>
int32 Oscl_MTLinked_List< LLClass, Alloc, TheLock >::move_to_front | ( | const LLClass & | data_to_move | ) | `[inline]`

  | Moves the element to front of the list Parameters:
  data_to_move |
Returns: On success returns 1 otherwise returns 0.

template<class LLClass, class Alloc, class TheLock>
int32 Oscl_MTLinked_List< LLClass, Alloc, TheLock >::remove_element | ( | const int32 | index_to_remove | ) | `[inline]`

  | Removes the element for requested index. Parameters:
  index_to_remove |
Returns: on success return 1 otherwise return 0.

template<class LLClass, class Alloc, class TheLock>
int32 Oscl_MTLinked_List< LLClass, Alloc, TheLock >::remove_element | ( | const LLClass & | data_to_remove | ) | `[inline]`

  | Removes the element from the list. Parameters:
  data_to_remove |
Returns: 32-bit integer on if element fount in the list returns 1 otherwise returns 0.

## Field Documentation

template<class LLClass, class Alloc, class TheLock>
Oscl_Linked_List<LLClass, Alloc> Oscl_MTLinked_List< LLClass, Alloc, TheLock >::the_list`[protected]`

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

- oscl_linked_list.h