SSDP::MessageSpec Class Reference

Defines the information used to create an outgoing message. More...

#include <MessageSpec.h>

Public Member Functions

 MessageSpec (MessageType type)
 
 MessageSpec (MessageType type, SearchTarget target, void *object=nullptr)
 
 MessageSpec (NotifySubtype nts, SearchTarget target, void *object=nullptr)
 
 MessageSpec (const MessageSpec &ms, SearchMatch match, void *object)
 Construct a new message spec for a specific match type. More...
 
bool operator== (const MessageSpec &rhs) const
 
IpAddress remoteIp () const
 Get the remote IP address. More...
 
uint16_t remotePort () const
 Get the remote port number. More...
 
template<class Object >
Object * object () const
 Get the target object pointer. More...
 
MessageType type () const
 Get the message type. More...
 
NotifySubtype notifySubtype () const
 Get the notification sub-type. More...
 
SearchMatch match () const
 Get the search match type. More...
 
SearchTarget target () const
 Get the search target. More...
 
void setTarget (SearchTarget target)
 Set the search target. More...
 
void setRemote (IpAddress address, uint16_t port)
 Set the remote address and port. More...
 
void setRepeat (uint8_t count)
 Set number of times to repeat message. More...
 
uint8_t repeat () const
 Get current repeat value. More...
 
bool shouldRepeat ()
 Check if message should be repeated and adjust counter. More...
 

Friends

class MessageQueue
 

Detailed Description

Defines the information used to create an outgoing message.

The message queue stores these objects as a linked list.

Constructor & Destructor Documentation

◆ MessageSpec() [1/4]

SSDP::MessageSpec::MessageSpec ( MessageType  type)
inline

◆ MessageSpec() [2/4]

SSDP::MessageSpec::MessageSpec ( MessageType  type,
SearchTarget  target,
void *  object = nullptr 
)
inline

◆ MessageSpec() [3/4]

SSDP::MessageSpec::MessageSpec ( NotifySubtype  nts,
SearchTarget  target,
void *  object = nullptr 
)
inline

◆ MessageSpec() [4/4]

SSDP::MessageSpec::MessageSpec ( const MessageSpec ms,
SearchMatch  match,
void *  object 
)
inline

Construct a new message spec for a specific match type.

Parameters
msTemplate message spec
matchThe match type
objectTarget for message

Member Function Documentation

◆ match()

SearchMatch SSDP::MessageSpec::match ( ) const
inline

Get the search match type.

◆ notifySubtype()

NotifySubtype SSDP::MessageSpec::notifySubtype ( ) const
inline

Get the notification sub-type.

◆ object()

template<class Object >
Object* SSDP::MessageSpec::object ( ) const
inline

Get the target object pointer.

This is templated to provide cleaner code. Example:

MyObject* object = ms.object<MyObject>();

◆ operator==()

bool SSDP::MessageSpec::operator== ( const MessageSpec rhs) const
inline

◆ remoteIp()

IpAddress SSDP::MessageSpec::remoteIp ( ) const
inline

Get the remote IP address.

◆ remotePort()

uint16_t SSDP::MessageSpec::remotePort ( ) const
inline

Get the remote port number.

◆ repeat()

uint8_t SSDP::MessageSpec::repeat ( ) const
inline

Get current repeat value.

◆ setRemote()

void SSDP::MessageSpec::setRemote ( IpAddress  address,
uint16_t  port 
)
inline

Set the remote address and port.

◆ setRepeat()

void SSDP::MessageSpec::setRepeat ( uint8_t  count)
inline

Set number of times to repeat message.

◆ setTarget()

void SSDP::MessageSpec::setTarget ( SearchTarget  target)
inline

Set the search target.

◆ shouldRepeat()

bool SSDP::MessageSpec::shouldRepeat ( )
inline

Check if message should be repeated and adjust counter.

◆ target()

SearchTarget SSDP::MessageSpec::target ( ) const
inline

Get the search target.

◆ type()

MessageType SSDP::MessageSpec::type ( ) const
inline

Get the message type.

Friends And Related Function Documentation

◆ MessageQueue

friend class MessageQueue
friend

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