61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
/*
|
|
* File: MulticastMessageQueue.h
|
|
* Author: jgaebler
|
|
*
|
|
* Created on April 13, 2010, 6:14 PM
|
|
*/
|
|
#pragma once
|
|
|
|
#ifndef MULTICASTMESSAGEQUEUE_H
|
|
#define MULTICASTMESSAGEQUEUE_H
|
|
|
|
#include "common/Defines.h"
|
|
#include "common/transport/MessageReference.h"
|
|
#include "mt/msg/MulticastMessage.h"
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
/**
|
|
* @class MulticastMessageQueue
|
|
* @brief Provides a queue for storing MulticastMessages. Each message is stored only one time.
|
|
* @ingroup Moversight
|
|
* @author Jan Gäbler
|
|
*/
|
|
class MulticastMessageQueue : public List<MulticastMessage *>{
|
|
public:
|
|
|
|
void clear();
|
|
|
|
MulticastMessage * find(const MessageReference & mref);
|
|
void remove(const MessageReference & mRef);
|
|
void add(const MulticastMessage * pdu);
|
|
void printQueue();
|
|
|
|
void sortByLogicalDeliveryTime();
|
|
|
|
private:
|
|
typedef List<MulticastMessage*> MessageQueue;
|
|
|
|
class MulticastMessageFunctor {
|
|
public:
|
|
MulticastMessageFunctor(const MessageReference & aMref) {
|
|
mref = aMref;
|
|
}
|
|
|
|
bool operator()(const MulticastMessage * pdu) {
|
|
return mref == pdu->getMessageReference();
|
|
}
|
|
|
|
private:
|
|
MessageReference mref;
|
|
};
|
|
};
|
|
|
|
bool MulticastMessageLogicalDeliveryTimeComparatorLessThan(const MulticastMessage * a, const MulticastMessage* b);
|
|
};
|
|
};
|
|
|
|
#endif /* MULTICASTMESSAGEQUEUE_H */
|
|
|