Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F629278
message-queue.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
780 B
Referenced Files
None
Subscribers
None
message-queue.h
View Options
#ifndef _paintown_message_queue_h
#define _paintown_message_queue_h
#include
<queue>
#include
<string>
#include
"thread.h"
/* multithreaded message queue.
* someone puts messages in, someone takes them out.
* FIFO order
*/
class
MessageQueue
{
public
:
MessageQueue
();
/* push on */
void
add
(
const
std
::
string
&
str
);
/* true if any messages are left */
bool
hasAny
();
/* get the first message */
std
::
string
get
();
virtual
~
MessageQueue
();
static
void
registerInfo
(
MessageQueue
*
);
static
void
unregisterInfo
(
MessageQueue
*
);
static
void
info
(
const
std
::
string
&
str
);
static
void
clearInfo
();
static
Util
::
Thread
::
Lock
messageLock
;
private
:
std
::
queue
<
std
::
string
>
messages
;
Util
::
Thread
::
Lock
lock
;
};
#endif
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Nov 15, 6:26 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
113197
Default Alt Text
message-queue.h (780 B)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline