gpg::RealTimeEventListenerHelper

#include <real_time_event_listener_helper.h>

Defines a helper which can be used to provide IRealTimeEventListener callbacks to the SDK without defining the full IRealTimeEventListener interface.

Summary

Callbacks configured on this object will be invoked by the Real- Time multiplayer APIs as described in RealTimeMultiplayerManager. Callbacks not explicitly set will do nothing.

Constructors and Destructors

RealTimeEventListenerHelper()
RealTimeEventListenerHelper(std::shared_ptr< RealTimeEventListenerHelperImpl > impl)
Constructs a RealTimeEventListenerHelper from a shared_ptr to a RealTimeEventListenerHelperImpl.

Public types

OnDataReceivedCallback typedef
std::function< void(const RealTimeRoom &room, const MultiplayerParticipant &from_participant, std::vector< uint8_t > data, bool is_reliable)>
OnDataReceivedCallback is called whenever data is received from another MultiplayerParticipant.
OnP2PConnectedCallback typedef
std::function< void(const RealTimeRoom &, const MultiplayerParticipant &)>
OnP2PConnectedCallback is called when a MultiplayerParticipant object connects directly to the local player.
OnP2PDisconnectedCallback typedef
std::function< void(const RealTimeRoom &, const MultiplayerParticipant &)>
OnP2PDisconnectedCallback is called when a MultiplayerParticipant object disconnects directly from the local player.
OnParticipantStatusChangedCallback typedef
std::function< void(const RealTimeRoom &, const MultiplayerParticipant &)>
OnParticipantStatusChangedCallback is called when a MultiplayerParticipant object disconnects directly from the local player.
OnRoomConnectedSetChangedCallback typedef
std::function< void(const RealTimeRoom &)>
OnConnectedSetChangedCallback is called when a MultiplayerParticipant object connects or disconnects from the room's connected set.
OnRoomStatusChangedCallback typedef
std::function< void(const RealTimeRoom &)>
OnRoomStatusChangedCallback is called when a RealTimeRoom object's Status() method returns an update.

Public functions

SetOnDataReceivedCallback(OnDataReceivedCallback callback)
Set the OnDataReceivedCallback.
SetOnP2PConnectedCallback(OnP2PConnectedCallback callback)
Set the OnP2PConnectedCallback.
SetOnP2PDisconnectedCallback(OnP2PDisconnectedCallback callback)
Set the OnP2PDisconnectedCallback.
SetOnParticipantStatusChangedCallback(OnParticipantStatusChangedCallback callback)
Set the OnParticipantStatusChangedCallback.
SetOnRoomConnectedSetChangedCallback(OnRoomConnectedSetChangedCallback callback)
Set the OnRoomConnectedSetChangedCallback.
SetOnRoomStatusChangedCallback(OnRoomStatusChangedCallback callback)
Set the OnRoomStatusChangedCallback.

Public types

OnDataReceivedCallback

std::function< void(const RealTimeRoom &room, const MultiplayerParticipant &from_participant, std::vector< uint8_t > data, bool is_reliable)> OnDataReceivedCallback

OnDataReceivedCallback is called whenever data is received from another MultiplayerParticipant.

OnP2PConnectedCallback

std::function< void(const RealTimeRoom &, const MultiplayerParticipant &)> OnP2PConnectedCallback

OnP2PConnectedCallback is called when a MultiplayerParticipant object connects directly to the local player.

OnP2PDisconnectedCallback

std::function< void(const RealTimeRoom &, const MultiplayerParticipant &)> OnP2PDisconnectedCallback

OnP2PDisconnectedCallback is called when a MultiplayerParticipant object disconnects directly from the local player.

OnParticipantStatusChangedCallback

std::function< void(const RealTimeRoom &, const MultiplayerParticipant &)> OnParticipantStatusChangedCallback

OnParticipantStatusChangedCallback is called when a MultiplayerParticipant object disconnects directly from the local player.

OnRoomConnectedSetChangedCallback

std::function< void(const RealTimeRoom &)> OnRoomConnectedSetChangedCallback

OnConnectedSetChangedCallback is called when a MultiplayerParticipant object connects or disconnects from the room's connected set.

OnRoomStatusChangedCallback

std::function< void(const RealTimeRoom &)> OnRoomStatusChangedCallback

OnRoomStatusChangedCallback is called when a RealTimeRoom object's Status() method returns an update.

Public functions

RealTimeEventListenerHelper

 RealTimeEventListenerHelper()

RealTimeEventListenerHelper

 RealTimeEventListenerHelper(
  std::shared_ptr< RealTimeEventListenerHelperImpl > impl
)

Constructs a RealTimeEventListenerHelper from a shared_ptr to a RealTimeEventListenerHelperImpl.

Intended for internal use by the API.

SetOnDataReceivedCallback

RealTimeEventListenerHelper & SetOnDataReceivedCallback(
  OnDataReceivedCallback callback
)

Set the OnDataReceivedCallback.

SetOnP2PConnectedCallback

RealTimeEventListenerHelper & SetOnP2PConnectedCallback(
  OnP2PConnectedCallback callback
)

Set the OnP2PConnectedCallback.

SetOnP2PDisconnectedCallback

RealTimeEventListenerHelper & SetOnP2PDisconnectedCallback(
  OnP2PDisconnectedCallback callback
)

Set the OnP2PDisconnectedCallback.

SetOnParticipantStatusChangedCallback

RealTimeEventListenerHelper & SetOnParticipantStatusChangedCallback(
  OnParticipantStatusChangedCallback callback
)

Set the OnParticipantStatusChangedCallback.

SetOnRoomConnectedSetChangedCallback

RealTimeEventListenerHelper & SetOnRoomConnectedSetChangedCallback(
  OnRoomConnectedSetChangedCallback callback
)

Set the OnRoomConnectedSetChangedCallback.

SetOnRoomStatusChangedCallback

RealTimeEventListenerHelper & SetOnRoomStatusChangedCallback(
  OnRoomStatusChangedCallback callback
)

Set the OnRoomStatusChangedCallback.