EventQueue Class Reference

Collaboration diagram for EventQueue:
Collaboration graph
[legend]

Public Member Functions

 EventQueue ()
 ~EventQueue ()
void append_event (const Event &ev)
bool get_event (Event &ev)

Detailed Description

Definition at line 79 of file multi_thread_test.cpp.


Constructor & Destructor Documentation

EventQueue::EventQueue (  )  [inline]

Definition at line 82 of file multi_thread_test.cpp.

00083     {
00084         mutex = g_mutex_new();
00085     }

EventQueue::~EventQueue (  )  [inline]

Definition at line 86 of file multi_thread_test.cpp.

00087     {
00088         g_mutex_free(mutex);
00089     }


Member Function Documentation

void EventQueue::append_event ( const Event ev  )  [inline]

Definition at line 91 of file multi_thread_test.cpp.

Referenced by EventHandler::handle_paginate_end(), EventHandler::handle_paginate_start(), EventHandler::handle_render_done(), and EventHandler::handle_search_done().

00092     {
00093         g_mutex_lock(mutex);
00094         event_queue.push_back(ev);
00095         g_mutex_unlock(mutex);
00096     }

Here is the caller graph for this function:

bool EventQueue::get_event ( Event ev  )  [inline]

Definition at line 98 of file multi_thread_test.cpp.

Referenced by timeout_handler().

00099     {
00100         bool ret = false;
00101         g_mutex_lock(mutex);
00102         if (!event_queue.empty())
00103         {
00104             ev = event_queue.front();
00105             event_queue.pop_front();
00106             ret = true;
00107         }
00108         g_mutex_unlock(mutex);
00109         return ret;
00110     }

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