text::SafeDeque< T > Class Template Reference

#include <text_base_types.h>

Inheritance diagram for text::SafeDeque< T >:
Inheritance graph
[legend]

Public Member Functions

 SafeDeque ()
 Constructors and destructors.
 ~SafeDeque ()
size_t size ()
bool empty ()
T & back ()
T & front ()
T & operator[] (unsigned int idx)
void push_back (const T &value)
void push_front (const T &value)
void clear ()

Detailed Description

template<typename T>
class text::SafeDeque< T >

Definition at line 228 of file text_base_types.h.


Constructor & Destructor Documentation

template<typename T>
text::SafeDeque< T >::SafeDeque (  )  [inline]

Constructors and destructors.

Definition at line 232 of file text_base_types.h.

00233     {
00234         g_static_rw_lock_init(&rw_lock);
00235     }

template<typename T>
text::SafeDeque< T >::~SafeDeque (  )  [inline]

Definition at line 237 of file text_base_types.h.

00238     {
00239         g_static_rw_lock_free(&rw_lock);
00240     }


Member Function Documentation

template<typename T>
T& text::SafeDeque< T >::back (  )  [inline]

Definition at line 259 of file text_base_types.h.

Referenced by text::SafeDeque< PageInfo >::back(), and text::TextView::paginate().

00260     {
00261         g_static_rw_lock_reader_lock(&rw_lock);
00262         T& back = data.back();
00263         g_static_rw_lock_reader_unlock(&rw_lock);
00264         return back;
00265     }

Here is the caller graph for this function:

template<typename T>
void text::SafeDeque< T >::clear ( void   )  [inline]

Definition at line 298 of file text_base_types.h.

Referenced by text::TextView::clear_pages(), and text::TextView::render().

00299     {
00300         g_static_rw_lock_writer_lock(&rw_lock);
00301         data.clear();
00302         g_static_rw_lock_writer_unlock(&rw_lock);
00303     }

Here is the caller graph for this function:

template<typename T>
bool text::SafeDeque< T >::empty (  )  [inline]

Definition at line 251 of file text_base_types.h.

00252     {
00253         g_static_rw_lock_reader_lock(&rw_lock);
00254         bool is_empty = data.empty();
00255         g_static_rw_lock_reader_unlock(&rw_lock);
00256         return is_empty;
00257     }

template<typename T>
T& text::SafeDeque< T >::front (  )  [inline]

Definition at line 267 of file text_base_types.h.

Referenced by text::SafeDeque< PageInfo >::front(), and text::TextView::paginate().

00268     {
00269         g_static_rw_lock_reader_lock(&rw_lock);
00270         T& front = data.front();
00271         g_static_rw_lock_reader_unlock(&rw_lock);
00272         return front;
00273     }

Here is the caller graph for this function:

template<typename T>
T& text::SafeDeque< T >::operator[] ( unsigned int  idx  )  [inline]

Definition at line 275 of file text_base_types.h.

00276     {
00277         g_static_rw_lock_reader_lock(&rw_lock);
00278         T& value = data[idx];
00279         g_static_rw_lock_reader_unlock(&rw_lock);
00280         return value;
00281     }

template<typename T>
void text::SafeDeque< T >::push_back ( const T &  value  )  [inline]

Definition at line 284 of file text_base_types.h.

Referenced by text::TextView::paginate().

00285     {
00286         g_static_rw_lock_writer_lock(&rw_lock);
00287         data.push_back(value);
00288         g_static_rw_lock_writer_unlock(&rw_lock);
00289     }

Here is the caller graph for this function:

template<typename T>
void text::SafeDeque< T >::push_front ( const T &  value  )  [inline]

Definition at line 291 of file text_base_types.h.

Referenced by text::TextView::paginate().

00292     {
00293         g_static_rw_lock_writer_lock(&rw_lock);
00294         data.push_front(value);
00295         g_static_rw_lock_writer_unlock(&rw_lock);
00296     }

Here is the caller graph for this function:

template<typename T>
size_t text::SafeDeque< T >::size (  )  [inline]

Definition at line 243 of file text_base_types.h.

Referenced by text::TextView::calculate_next_page_pos(), text::TextView::calculate_prev_page_pos(), text::TextView::check_page_table(), text::TextView::get_anchor_by_page(), text::TextView::get_page_anchor_by_anchor(), text::TextView::get_page_index_by_anchor(), text::TextView::paginate(), and text::SafeDeque< PageInfo >::size().

00244     {
00245         g_static_rw_lock_reader_lock(&rw_lock);
00246         size_t size = data.size();
00247         g_static_rw_lock_reader_unlock(&rw_lock);
00248         return size;
00249     }

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208