11 #include "threads/CriticalSection.h" 30 template<
typename Payload>
36 CPayloadWrap(Payload& data) { m_pPayload.reset(
new Payload(data)); }
37 Payload* GetPlayload() {
return m_pPayload.get(); }
40 std::unique_ptr<Payload> m_pPayload;
49 static constexpr
size_t MSG_INTERNAL_BUFFER_SIZE = 32;
58 uint8_t buffer[MSG_INTERNAL_BUFFER_SIZE];
59 uint8_t *data =
nullptr;
60 std::unique_ptr<CPayloadWrapBase> payloadObj;
61 Message *replyMessage =
nullptr;
66 bool Reply(
int sig,
void *data =
nullptr,
size_t size = 0);
77 : portName(std::move(name)), containerInEvent(inEvent), containerOutEvent(outEvent)
83 void ReturnMessage(
Message *msg);
84 bool SendOutMessage(
int signal,
85 const void* data =
nullptr,
89 bool SendInMessage(
int signal,
90 const void* data =
nullptr,
94 bool SendOutMessageSync(
int signal,
96 std::chrono::milliseconds timeout,
97 const void* data =
nullptr,
99 bool SendOutMessageSync(
int signal,
101 std::chrono::milliseconds timeout,
103 bool ReceiveOutMessage(
Message **msg);
104 bool ReceiveInMessage(
Message **msg);
106 void PurgeIn(
int signal);
107 void PurgeOut(
int signal);
108 void DeferIn(
bool value) { inDefered = value; }
109 void DeferOut(
bool value) { outDefered = value; }
110 void Lock() { criticalSection.lock(); }
111 void Unlock() { criticalSection.unlock(); }
112 std::string portName;
115 CEvent *containerInEvent, *containerOutEvent;
116 CCriticalSection criticalSection;
117 std::queue<Message*> outMessages;
118 std::queue<Message*> inMessages;
119 std::queue<Message*> freeMessageQueue;
120 bool inDefered =
false, outDefered =
false;
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
Definition: ActorProtocol.h:73
Definition: ActorProtocol.h:31
Definition: ActorProtocol.h:21
Definition: ActorProtocol.h:45
Definition: ActorProtocol.h:24