Lines Matching refs:message
40 static bool compareMessages(const Message& msg1,
41 const Message& msg2,
47 bool MessageQueue::hasMessages(const Message& message) {
50 static const Message::GenericMemberFunction nullMember = NULL;
51 const bool memberIsNull = message.member() == nullMember;
53 for (list<Message*>::iterator it = m_messages.begin();
55 Message* m = *it;
56 if (compareMessages(message, *m, memberIsNull))
62 void MessageQueue::remove(const Message& message) {
65 static const Message::GenericMemberFunction nullMember = NULL;
66 const bool memberIsNull = message.member() == nullMember;
68 for (list<Message*>::iterator it = m_messages.begin();
70 Message* m = *it;
71 if (compareMessages(message, *m, memberIsNull)) {
78 void MessageQueue::post(Message* message) {
81 double when = message->m_when;
82 LOG_ASSERT(when > 0, "Message time may not be 0");
84 list<Message*>::iterator it;
86 Message* m = *it;
91 m_messages.insert(it, message);
95 void MessageQueue::postAtFront(Message* message) {
97 message->m_when = 0;
98 m_messages.push_front(message);
101 Message* MessageQueue::next() {
108 Message* next = m_messages.front();
112 // Not time for this message yet, wait the difference in nanos
116 // Time for this message to run.
127 Message* message = m_queue.next();
128 if (message != NULL) {
129 message->run();