xbmc
Public Member Functions | List of all members
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:
Inheritance graph
[legend]

Public Member Functions

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

Detailed Description

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

See also
CApplicationMessenger::RegisterReceiver to start receiving messages

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 PERIPHERALS::CPeripherals, CApplication, CGUIWindowManager, CGUIInfoManager, 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 PERIPHERALS::CPeripherals, CApplication, CGUIWindowManager, CGUIInfoManager, and KODI::PLAYLIST::CPlayListPlayer.


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