<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>EventQueue class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.2.17 --> <center> <a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>EventQueue Class Reference</h1><code>#include <<a class="el" href="eventqueue_8h-source.html">eventqueue.h</a>></code> <p> <a href="classEventQueue-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td></td></tr> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classEventQueue.html#a0">EventQueue</a> (int num_threads)</td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classEventQueue.html#a1">~EventQueue</a> ()</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classEventQueue.html#a2">Push</a> (<a class="el" href="classEvent.html">Event</a> *event)</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classEvent.html">Event</a> * </td><td valign=bottom><a class="el" href="classEventQueue.html#a3">Pop</a> ()</td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classEventQueue.html#a4">Size</a> ()</td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classEventQueue.html#a5">IsOk</a> ()</td></tr> <tr><td colspan=2><br><h2>Private Methods</h2></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classEventQueue.html#c0">EventQueue</a> (EventQueue &)</td></tr> <tr><td nowrap align=right valign=top>EventQueue & </td><td valign=bottom><a class="el" href="classEventQueue.html#c1">operator=</a> (EventQueue &)</td></tr> <tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> <tr><td nowrap align=right valign=top>queue< <a class="el" href="classEvent.html">Event</a> * > </td><td valign=bottom><a class="el" href="classEventQueue.html#o0">mQue</a></td></tr> <tr><td> </td><td><font size=-1><em>The queue of events - uses deque.</em> <a href="#o0"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>CRITICAL_SECTION </td><td valign=bottom><a class="el" href="classEventQueue.html#o1">mMutex</a></td></tr> <tr><td> </td><td><font size=-1><em>To enforce mutual exclusion.</em> <a href="#o1"></a><em></em></font><br><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> The EventQueue class implements a thread safe queue upon which Events may be pushed and popped. It is a FIFO queue. <p> <p> Definition at line <a class="el" href="eventqueue_8h-source.html#l00022">22</a> of file <a class="el" href="eventqueue_8h-source.html">eventqueue.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> <a name="a0" doxytag="EventQueue::EventQueue"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> EventQueue::EventQueue </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname1" valign="top" nowrap> <em>num_threads</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Constructor for EventQueue.<dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>num_threads</em> </td><td> The maximum number of threads allowed access to the queue.</td></tr> </table> </dl><dl compact><dt><b>Note: </b></dt><dd> One should check to see if this was properly initialized via IsOk. </dl> <p> Definition at line <a class="el" href="eventqueue_8cpp-source.html#l00026">26</a> of file <a class="el" href="eventqueue_8cpp-source.html">eventqueue.cpp</a>. <p> References <a class="el" href="eventqueue_8h-source.html#l00035">mMutex</a>. </td> </tr> </table> <a name="a1" doxytag="EventQueue::~EventQueue"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> EventQueue::~EventQueue </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Destructor for EventQueue. <p> Definition at line <a class="el" href="eventqueue_8cpp-source.html#l00039">39</a> of file <a class="el" href="eventqueue_8cpp-source.html">eventqueue.cpp</a>. <p> References <a class="el" href="eventqueue_8h-source.html#l00035">mMutex</a>. </td> </tr> </table> <a name="c0" doxytag="EventQueue::EventQueue"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> EventQueue::EventQueue </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">EventQueue & </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [private]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="a5" doxytag="EventQueue::IsOk"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool EventQueue::IsOk </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> IsOk checks to see if the EventQueue was properly initialized. <p> <dl compact><dt><b>Returns :</b></dt><dd> true if initialied or false if there was an error. </dl> <p> Definition at line <a class="el" href="eventqueue_8cpp-source.html#l00099">99</a> of file <a class="el" href="eventqueue_8cpp-source.html">eventqueue.cpp</a>. <p> Referenced by <a class="el" href="paradigm_8cpp-source.html#l00175">main</a>(). </td> </tr> </table> <a name="c1" doxytag="EventQueue::operator="></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> EventQueue& EventQueue::operator= </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">EventQueue & </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [private]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a3" doxytag="EventQueue::Pop"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classEvent.html">Event</a> * EventQueue::Pop </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Pops an <a class="el" href="classEvent.html">Event</a> onto the EventQueue. Client must destroy <a class="el" href="classEvent.html">Event</a>. <p> <dl compact><dt><b>Returns :</b></dt><dd> The <a class="el" href="classEvent.html">Event</a> object on the top of the queue or NULL </dl> <p> Definition at line <a class="el" href="eventqueue_8cpp-source.html#l00068">68</a> of file <a class="el" href="eventqueue_8cpp-source.html">eventqueue.cpp</a>. <p> References <a class="el" href="eventqueue_8h-source.html#l00035">mMutex</a>, and <a class="el" href="eventqueue_8h-source.html#l00034">mQue</a>. <p> Referenced by <a class="el" href="paradigm_8cpp-source.html#l00237">Chat</a>(), and <a class="el" href="server_8cpp-source.html#l00244">Server::ProcessQueue</a>(). </td> </tr> </table> <a name="a2" doxytag="EventQueue::Push"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void EventQueue::Push </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classEvent.html">Event</a> * </td> <td class="mdname1" valign="top" nowrap> <em>event</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Pushes and <a class="el" href="classEvent.html">Event</a> onto the EventQueue. Client must create <a class="el" href="classEvent.html">Event</a>.<dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>event</em> </td><td> The <a class="el" href="classEvent.html">Event</a> object to be pushed onto the queue </td></tr> </table> </dl> <p> Definition at line <a class="el" href="eventqueue_8cpp-source.html#l00052">52</a> of file <a class="el" href="eventqueue_8cpp-source.html">eventqueue.cpp</a>. <p> References <a class="el" href="eventqueue_8h-source.html#l00035">mMutex</a>, and <a class="el" href="eventqueue_8h-source.html#l00034">mQue</a>. <p> Referenced by <a class="el" href="server_8cpp-source.html#l00174">Server::AcceptConnection</a>(), <a class="el" href="paradigm_8cpp-source.html#l00237">Chat</a>(), <a class="el" href="server_8cpp-source.html#l00103">Server::Run</a>(), and <a class="el" href="server_8cpp-source.html#l00291">Server::ShutdownServer</a>(). </td> </tr> </table> <a name="a4" doxytag="EventQueue::Size"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int EventQueue::Size </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Size returns the number of Events contained in the EventQueue <p> <dl compact><dt><b>Returns :</b></dt><dd> number of Events in the EventQueue </dl> <p> Definition at line <a class="el" href="eventqueue_8cpp-source.html#l00089">89</a> of file <a class="el" href="eventqueue_8cpp-source.html">eventqueue.cpp</a>. <p> References <a class="el" href="eventqueue_8h-source.html#l00035">mMutex</a>, and <a class="el" href="eventqueue_8h-source.html#l00034">mQue</a>. </td> </tr> </table> <hr><h2>Member Data Documentation</h2> <a name="o1" doxytag="EventQueue::mMutex"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> CRITICAL_SECTION EventQueue::mMutex<code> [private]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> To enforce mutual exclusion. <p> <p> Definition at line <a class="el" href="eventqueue_8h-source.html#l00035">35</a> of file <a class="el" href="eventqueue_8h-source.html">eventqueue.h</a>. <p> Referenced by <a class="el" href="eventqueue_8cpp-source.html#l00026">EventQueue</a>(), <a class="el" href="eventqueue_8cpp-source.html#l00068">Pop</a>(), <a class="el" href="eventqueue_8cpp-source.html#l00052">Push</a>(), <a class="el" href="eventqueue_8cpp-source.html#l00089">Size</a>(), and <a class="el" href="eventqueue_8cpp-source.html#l00039">~EventQueue</a>(). </td> </tr> </table> <a name="o0" doxytag="EventQueue::mQue"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> queue<<a class="el" href="classEvent.html">Event</a>*> EventQueue::mQue<code> [private]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> The queue of events - uses deque. <p> <p> Definition at line <a class="el" href="eventqueue_8h-source.html#l00034">34</a> of file <a class="el" href="eventqueue_8h-source.html">eventqueue.h</a>. <p> Referenced by <a class="el" href="eventqueue_8cpp-source.html#l00068">Pop</a>(), <a class="el" href="eventqueue_8cpp-source.html#l00052">Push</a>(), and <a class="el" href="eventqueue_8cpp-source.html#l00089">Size</a>(). </td> </tr> </table> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="eventqueue_8h-source.html">eventqueue.h</a><li><a class="el" href="eventqueue_8cpp-source.html">eventqueue.cpp</a></ul> <hr><address style="align: right;"><small>Generated on Mon Mar 29 23:12:57 2004 for Paradigm by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.17 </small></address> </body> </html>