SSDP::MessageQueue Class Reference

Queue of objects managed by a single timer. More...

#include <MessageQueue.h>

Public Member Functions

 MessageQueue (MessageDelegate delegate)
 
 ~MessageQueue ()
 
void clear ()
 
unsigned count ()
 
void setCallback (MessageDelegate delegate)
 Set a callback to handle sending a message @Param delegate. More...
 
void add (MessageSpec *ms, uint32_t intervalMs)
 Schedule a message to start after the given interval has elapsed. More...
 
bool contains (const MessageSpec &ms) const
 Determine if a matching message specification is already queued. More...
 
unsigned remove (void *object)
 Remove any messages for this object. More...
 

Detailed Description

Queue of objects managed by a single timer.

Constructor & Destructor Documentation

◆ MessageQueue()

SSDP::MessageQueue::MessageQueue ( MessageDelegate  delegate)

◆ ~MessageQueue()

SSDP::MessageQueue::~MessageQueue ( )
inline

Member Function Documentation

◆ add()

void SSDP::MessageQueue::add ( MessageSpec ms,
uint32_t  intervalMs 
)

Schedule a message to start after the given interval has elapsed.

Parameters
msThe template spec. for constructing the message(s)
intervalMsHow long to wait before sending

The UPnP spec. requires that messages are sent after random delays, hence the interval. MessagesSpec objects must be created using the new allocator and are deleted after sending.

◆ clear()

void SSDP::MessageQueue::clear ( )

◆ contains()

bool SSDP::MessageQueue::contains ( const MessageSpec ms) const

Determine if a matching message specification is already queued.

Parameters
ms
Return values
booltrue if the given spec. is already queued.

See MessageSpec operator== definition for how comparison is performed.

◆ count()

unsigned SSDP::MessageQueue::count ( )

◆ remove()

unsigned SSDP::MessageQueue::remove ( void *  object)

Remove any messages for this object.

Return values
unsignedNumber of messages removed

◆ setCallback()

void SSDP::MessageQueue::setCallback ( MessageDelegate  delegate)
inline

Set a callback to handle sending a message @Param delegate.


The documentation for this class was generated from the following file: