UOperatingSystemDeviceMessenger
#include <OperatingSystemSimulator/Public/Devices/OperatingSystemDeviceMessenger.h>class UOperatingSystemDeviceMessengerDefined in OperatingSystemDeviceMessenger.h:98
Inherits:
UObject
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemDeviceMessenger["UOperatingSystemDeviceMessenger"]
class UObject["UObject"]
UObject <|-- UOperatingSystemDeviceMessenger
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemDeviceMessenger["UOperatingSystemDeviceMessenger"]
class UOperatingSystemBaseDevice["UOperatingSystemBaseDevice"]
UOperatingSystemDeviceMessenger *-- UOperatingSystemBaseDevice
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemDeviceMessenger {
+UOperatingSystemDeviceMessenger()
+BeginDestroyMessenger()
+Broadcast(const FName EventName, UObject *Payload)
+BeginListening(const FName ListenToEventName, const FOpera
+StopListening(const FName EventName)
+CreateMessenger(AOperatingSystemDeviceActor *NewDevice) UOperatingSystemDeviceMessenger() *
+OnConstructed()
+GetParentDevice() const TWeakObjectPtr< UOperatingSystemBaseDevi
+K2_OnConstructed()
+K2_OnMessengerBeginDestroy()
+ParentDevice : TWeakObjectPtr< UOperatingSystemBaseDevi
}
A class that provides messaging functionality for an operating system device.
This class is responsible for broadcasting and listening to events in the operating system device. It allows communication between different components of the device.
A class that creates a messenger for an operating system device.
This method creates a messenger for the specified operating system device. The messenger is responsible for broadcasting and listening to events in the device, allowing communication between different components of the device.
Parameters
Section titled “Parameters”NewDeviceThe operating system device for which to create the messenger.
Returns
Section titled “Returns”A pointer to the created messenger, or nullptr if the creation failed or the messenger class is null.
See also: AOperatingSystemDeviceActor, UOperatingSystemDeviceMessenger::BroadcastEvent, UOperatingSystemDeviceMessenger::BeginListening, UOperatingSystemDeviceMessenger::StopListening
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemDeviceMessenger | ||
void | BeginDestroyMessenger | Begins the process of destroying the operating system device messenger. |
void | Broadcast | Broadcasts an event with a payload. The event name is specified by the EventName parameter, and the payload object is specified by the Payload parameter. |
void | BeginListening | Starts listening for a specific event and registers the specified callback to be executed when the event occurs. The event can be triggered by an operating system device, and the registered callback will be notified with the event details. |
void | StopListening | Stops listening to a specific event identified by its name. Once this method is called, the device messenger will no longer receive events with the specified name. |
UOperatingSystemDeviceMessenger
Section titled “UOperatingSystemDeviceMessenger”UOperatingSystemDeviceMessenger()Defined in OperatingSystemDeviceMessenger.h:115
References
Section titled “References”CHECK_IN_BPIMPLEMENTED_IN_BP_LAMBDAOnConstructed
BeginDestroyMessenger
Section titled “BeginDestroyMessenger”void BeginDestroyMessenger()Defined in OperatingSystemDeviceMessenger.h:153 Begins the process of destroying the operating system device messenger.
This method is called when the operating system device is being destroyed. It performs the necessary clean-up tasks to ensure a proper destruction of the messenger.
Example usage:
UOperatingSystemDeviceMessenger* DeviceMessenger; // Assume this variable is already initialized.
DeviceMessenger->BeginDestroyMessenger();See also: UOperatingSystemDeviceMessenger
References
Section titled “References”Broadcast
Section titled “Broadcast”void Broadcast(const FName EventName, UObject * Payload)Defined in OperatingSystemDeviceMessenger.h:162
Broadcasts an event with a payload. The event name is specified by the EventName parameter, and the payload object is specified by the Payload parameter.
Parameters
Section titled “Parameters”-
EventNameThe name of the event to be broadcasted. -
PayloadThe payload object associated with the event.
BeginListening
Section titled “BeginListening”void BeginListening(const FName ListenToEventName, const FOperatingSystemDeviceMessageDelegate & Callback)Defined in OperatingSystemDeviceMessenger.h:187 Starts listening for a specific event and registers the specified callback to be executed when the event occurs. The event can be triggered by an operating system device, and the registered callback will be notified with the event details.
Parameters
Section titled “Parameters”-
ListenToEventNameThe name of the event to listen to. -
CallbackThe delegate that will be called when the event occurs.
Example usage:
UOperatingSystemDeviceMessenger* DeviceMessenger; // Assume this variable is already initialized.FName EventName = "MyEvent";
DeviceMessenger->BeginListening(EventName, [&](const FOperatingSystemDeviceMessage& Message) { // Process the event details...});See also: FOperatingSystemDeviceMessage, FOperatingSystemDeviceMessageDelegate
StopListening
Section titled “StopListening”void StopListening(const FName EventName)Defined in OperatingSystemDeviceMessenger.h:196 Stops listening to a specific event identified by its name. Once this method is called, the device messenger will no longer receive events with the specified name.
Parameters
Section titled “Parameters”EventNameThe name of the event to stop listening to.
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemDeviceMessenger * | CreateMessenger static |
CreateMessenger
Section titled “CreateMessenger”static
static UOperatingSystemDeviceMessenger * CreateMessenger(AOperatingSystemDeviceActor * NewDevice)Defined in OperatingSystemDeviceMessenger.h:134
Referenced by
Section titled “Referenced by”References
Section titled “References”NEW_SOFT_OBJOS_LOG_VERBOSE
Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
void | OnConstructed virtual inline | This method is called when the operating system device messenger is constructed. |
TWeakObjectPtr< UOperatingSystemBaseDevice > | GetParentDevice const | Retrieves the parent device associated with this operating system device. |
void | K2_OnConstructed | A method that is called when an object of the OperatingSystemDeviceMessenger class is constructed. |
void | K2_OnMessengerBeginDestroy | K2_OnMessengerBeginDestroy function. |
OnConstructed
Section titled “OnConstructed”virtual inline
virtual inline void OnConstructed()Defined in OperatingSystemDeviceMessenger.h:206 This method is called when the operating system device messenger is constructed.
This method is virtual and can be overridden by subclasses to perform custom initialization tasks when the messenger is constructed. Subclasses should override this method to provide any necessary initialization logic specific to the subclass.
Referenced by
Section titled “Referenced by”GetParentDevice
Section titled “GetParentDevice”const
TWeakObjectPtr< UOperatingSystemBaseDevice > GetParentDevice() constDefined in OperatingSystemDeviceMessenger.h:218 Retrieves the parent device associated with this operating system device.
This method returns the parent device actor that is associated with the current operating system device. If no parent device actor is set, it returns nullptr.
Returns
Section titled “Returns”The parent device actor, or nullptr if no parent device actor is set.
See also: DeviceActor
References
Section titled “References”K2_OnConstructed
Section titled “K2_OnConstructed”void K2_OnConstructed()Defined in OperatingSystemDeviceMessenger.h:229 A method that is called when an object of the OperatingSystemDeviceMessenger class is constructed.
This method is blueprint implementable, allowing it to be overridden in blueprint subclasses. It is intended to be used for any necessary initialization logic when an object is created.
K2_OnMessengerBeginDestroy
Section titled “K2_OnMessengerBeginDestroy”void K2_OnMessengerBeginDestroy()Defined in OperatingSystemDeviceMessenger.h:237 K2_OnMessengerBeginDestroy function.
This function is a BlueprintImplementableEvent that is part of the OperatingSystemDeviceMessenger class. It is used to handle the logic when the messenger begins destruction.
Referenced by
Section titled “Referenced by”Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
TWeakObjectPtr< UOperatingSystemBaseDevice > | ParentDevice | The device that owns this messenger. |
ParentDevice
Section titled “ParentDevice”TWeakObjectPtr< UOperatingSystemBaseDevice > ParentDeviceDefined in OperatingSystemDeviceMessenger.h:104 The device that owns this messenger.