Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::MESSAGING::IMessageTarget Class Referenceabstract

A class wishing to receive messages should implement this and call. More...

#include "messaging/IMessageTarget.h"

Inheritance diagram for KODI::MESSAGING::IMessageTarget:
CApplication CGUIInfoManager CGUIWindowManager KODI::PLAYLIST::CPlayListPlayer PERIPHERALS::CPeripherals

Public Member Functions

virtual ~IMessageTarget ()=default
 
virtual int GetMessageMask ()=0
 Should return the message mask that it wishes to receive messages for.
 
virtual void OnApplicationMessage (ThreadMessage *msg)=0
 This gets called whenever a message matching the registered message mask is processed.
 

Detailed Description

A class wishing to receive messages should implement this and call.

See also
CApplicationMessenger::RegisterReceiver to start receiving messages

Constructor & Destructor Documentation

◆ ~IMessageTarget()

virtual KODI::MESSAGING::IMessageTarget::~IMessageTarget ( )
virtualdefault

Member Function Documentation

◆ GetMessageMask()

virtual int KODI::MESSAGING::IMessageTarget::GetMessageMask ( )
pure virtual

Should return the message mask that it wishes to receive messages for.

The message mask is defined in "messaging/ApplicationMessenger.h" pick the next one available when creating a new

Implemented in CApplication, CGUIInfoManager, CGUIWindowManager, PERIPHERALS::CPeripherals, and KODI::PLAYLIST::CPlayListPlayer.

◆ OnApplicationMessage()

virtual void KODI::MESSAGING::IMessageTarget::OnApplicationMessage ( ThreadMessage * msg)
pure virtual

This gets called whenever a message matching the registered message mask is processed.

There are no ordering guarantees here so implementations should never rely on a certain ordering of messages.

Cleaning up any pointers stored in the message payload is not specified and is decided by the implementer of the message. In general prefer to delete any data in this method to keep the callsites cleaner and simpler but if data is to be passed back it's perfectly valid to handle it any way that fits the situation as long as it's documented along with the message.

To return a simple value the result parameter of

See also
ThreadMessage can be used as it will be used as the return value for
CApplicationMessenger::SendMsg. It is up to the implementer to decide if this is to be used and it should be documented along with any new message implemented.

Implemented in CApplication, CGUIInfoManager, CGUIWindowManager, PERIPHERALS::CPeripherals, and KODI::PLAYLIST::CPlayListPlayer.


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