2
* Whiteboard message queue and queue handler functions
3
* Node for storing messages in message queues
6
* David Yip <yipdw@rose-hulman.edu>
8
* Copyright (c) 2005 Authors
10
* Released under GNU GPL, read the file 'COPYING' for more information
13
#ifndef __WHITEBOARD_MESSAGE_NODE_H__
14
#define __WHITEBOARD_MESSAGE_NODE_H__
19
#include "gc-managed.h"
20
#include "gc-anchored.h"
21
#include "gc-finalized.h"
26
namespace Whiteboard {
29
* Encapsulates a document change message received by or sent to an Inkboard client.
31
* Received messages that end up in a MessageNode are of the following types:
33
* <li>CHANGE_REPEATABLE</li>
34
* <li>CHANGE_NOT_REPEATABLE</li>
35
* <li>CHANGE_COMMIT</li>
36
* <li>DOCUMENT_BEGIN</li>
37
* <li>DOCUMENT_END</li>
38
* <li>DUMMY_CHANGE</li>
41
* This class is intended for use in MessageQueues, although it could potentially
42
* see use outside of that context.
44
* \see Inkscape::Whiteboard::MessageQueue
46
class MessageNode : public GC::Managed<>, public GC::Anchored, public GC::Finalized {
51
* \param seq The sequence number of the message being encapsulated.
52
* \param sender The sender of the message.
53
* \param recip The intended recipient.
54
* \param message_body The body of the message.
55
* \param type The type of the message.
56
* \param chatroom Whether or not this message is to be sent to / was received from a chatroom.
58
MessageNode(unsigned int seq, std::string sender, std::string recip, Glib::ustring const& message_body, MessageType type, bool document, bool chatroom) :
59
_seq(seq), _type(type), _message(message_body), _document(document), _chatroom(chatroom)
61
this->_sender = sender;
62
this->_recipient = recip;
65
virtual ~MessageNode()
67
// g_log(NULL, G_LOG_LEVEL_DEBUG, "MessageNode destructor");
70
delete this->_message;
75
unsigned int sequence()
87
return this->_chatroom;
92
return this->_document;
95
std::string recipient()
97
return this->_recipient;
102
return this->_sender;
105
Glib::ustring const& message()
107
return this->_message;
113
std::string _recipient;
115
Glib::ustring _message;
129
c-file-style:"stroustrup"
130
c-file-offsets:((innamespace . 0)(inline-open . 0))
135
// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :