Plasma Engine  2.0
Loading...
Searching...
No Matches
RemoteMessage.h
1#pragma once
2
3#include <Foundation/Basics.h>
4#include <Foundation/IO/MemoryStream.h>
5#include <Foundation/Reflection/Reflection.h>
6
8
10class PL_FOUNDATION_DLL plRemoteMessage
11{
12public:
14 plRemoteMessage(plUInt32 uiSystemID, plUInt32 uiMessageID);
17 void operator=(const plRemoteMessage& rhs);
18
21
23 PL_ALWAYS_INLINE void SetMessageID(plUInt32 uiSystemID, plUInt32 uiMessageID)
24 {
25 m_uiSystemID = uiSystemID;
26 m_uiMsgID = uiMessageID;
27 }
28
30 PL_ALWAYS_INLINE plStreamWriter& GetWriter() { return m_Writer; }
31
32
34
37
39 PL_ALWAYS_INLINE plStreamReader& GetReader() { return m_Reader; }
40 PL_ALWAYS_INLINE plUInt32 GetApplicationID() const { return m_uiApplicationID; }
41 PL_ALWAYS_INLINE plUInt32 GetSystemID() const { return m_uiSystemID; }
42 PL_ALWAYS_INLINE plUInt32 GetMessageID() const { return m_uiMsgID; }
43 PL_ALWAYS_INLINE plArrayPtr<const plUInt8> GetMessageData() const
44 {
45 return {m_Storage.GetData(), m_Storage.GetStorageSize32()};
46 }
47
49
50private:
51 friend class plRemoteInterface;
52
53 plUInt32 m_uiApplicationID = 0;
54 plUInt32 m_uiSystemID = 0;
55 plUInt32 m_uiMsgID = 0;
56
58 plMemoryStreamReader m_Reader;
59 plMemoryStreamWriter m_Writer;
60};
61
63class PL_FOUNDATION_DLL plProcessMessage : public plReflectedClass
64{
65 PL_ADD_DYNAMIC_REFLECTION(plProcessMessage, plReflectedClass);
66
67public:
68 plProcessMessage() = default;
69};
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Definition MemoryStream.h:145
A reader which can access a memory stream.
Definition MemoryStream.h:259
A writer which can access a memory stream.
Definition MemoryStream.h:313
Base class for IPC messages transmitted by plIpcChannel.
Definition RemoteMessage.h:64
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
Definition RemoteInterface.h:60
Encapsulates all the data that is transmitted when sending or receiving a message with plRemoteInterf...
Definition RemoteMessage.h:11
PL_ALWAYS_INLINE plStreamWriter & GetWriter()
Returns a stream writer to append data to the message.
Definition RemoteMessage.h:30
PL_ALWAYS_INLINE void SetMessageID(plUInt32 uiSystemID, plUInt32 uiMessageID)
For setting the message IDs before sending it.
Definition RemoteMessage.h:23
PL_ALWAYS_INLINE plStreamReader & GetReader()
Returns a stream reader for reading the message data.
Definition RemoteMessage.h:39
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107