S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_event_handler.h
Go to the documentation of this file.
1/*
2 * Licensed to Systerel under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work
4 * for additional information regarding copyright ownership.
5 * Systerel licenses this file to you under the Apache
6 * License, Version 2.0 (the "License"); you may not use this
7 * file except in compliance with the License. You may obtain
8 * a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#ifndef SOPC_EVENT_HANDLER_H_
21#define SOPC_EVENT_HANDLER_H_
22
23#include <stdint.h>
24
25#include "sopc_enums.h"
26
35typedef struct _SOPC_EventHandler SOPC_EventHandler;
36
43typedef struct _SOPC_Looper SOPC_Looper;
44
48typedef struct
49{
50 int32_t event;
51 uint32_t eltId;
52 uintptr_t params;
53 uintptr_t auxParam;
55
60
68 int32_t event,
69 uint32_t eltId,
70 uintptr_t params,
71 uintptr_t auxParam);
72
84
97 int32_t event,
98 uint32_t eltId,
99 uintptr_t params,
100 uintptr_t auxParam);
101
114 int32_t event,
115 uint32_t eltId,
116 uintptr_t params,
117 uintptr_t auxParam);
118
127SOPC_Looper* SOPC_Looper_Create(const char* threadName);
128
138
139#endif // SOPC_EVENT_HANDLER_H_
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
void SOPC_Looper_Delete(SOPC_Looper *looper)
Stops a looper and releases all resources allocated to it.
void SOPC_EventHandler_Callback(SOPC_EventHandler *handler, int32_t event, uint32_t eltId, uintptr_t params, uintptr_t auxParam)
Function prototype for message processing callbacks.
Definition sopc_event_handler.h:67
SOPC_Looper * SOPC_Looper_Create(const char *threadName)
Creates a new looper and attaches it to a new thread.
SOPC_EventHandler * SOPC_EventHandler_Create(SOPC_Looper *looper, SOPC_EventHandler_Callback *callback)
Creates a new event handler and attaches it to an existing looper.
SOPC_ReturnStatus SOPC_EventHandler_Post(SOPC_EventHandler *handler, int32_t event, uint32_t eltId, uintptr_t params, uintptr_t auxParam)
Posts an event to the back of the event handler's message queue.
SOPC_ReturnStatus SOPC_EventHandler_PostAsNext(SOPC_EventHandler *handler, int32_t event, uint32_t eltId, uintptr_t params, uintptr_t auxParam)
Posts an event to the front of the event handler's message queue.
struct _SOPC_EventHandler SOPC_EventHandler
Processes messages from a queue.
Definition sopc_event_handler.h:35
void SOPC_SetListenerFunc(SOPC_EventHandler *handler)
Function prototype for connecting an event emitter to a listener.
Definition sopc_event_handler.h:59
struct _SOPC_Looper SOPC_Looper
Manages the processing of events on a given thread.
Definition sopc_event_handler.h:43
Struct describing the various parts of an event.
Definition sopc_event_handler.h:49
int32_t event
Definition sopc_event_handler.h:50
uintptr_t params
Definition sopc_event_handler.h:52
uintptr_t auxParam
Definition sopc_event_handler.h:53
uint32_t eltId
Definition sopc_event_handler.h:51