Source code for elos/eventbuffer/types.h

// SPDX-License-Identifier: MIT
#pragma once

#include <pthread.h>
#include <safu/flags.h>
#include <safu/ringbuffer_types.h>
#include <safu/types.h>

#include "elos/common/types.h"
#include "elos/event/event_types.h"

typedef elosId_t elosEventBufferId_t;
typedef safuVec_t elosEventPtrVector_t;
typedef safuVec_t elosEventBufferPtrVector_t;
[docs][docs]/******************************************************************* * Parameter for EventBuffer initialization * * Members: * limitEventCount: Number of Events for each priority that an EventBuffer is required to keep available ******************************************************************/ typedef struct elosEventBufferParam {
[docs][docs] uint32_t limitEventCount;
} elosEventBufferParam_t;
[docs][docs]/******************************************************************* * Ring data structure of an EventBuffer. * Stores the Events written to the EventBuffer, each priority (e.g. HIGH, NORMAL) has its own indivual ring. * * Members: * ringBuffer: safuRingBuffer containing the Events * limitEventCount: size of the RingBuffer used for storing the Events ******************************************************************/ typedef struct elosEventBufferRing {
[docs][docs] safuRingBuffer_t ringBuffer;
[docs][docs] uint32_t limitEventCount;
} elosEventBufferRing_t;
[docs][docs]/******************************************************************* * Data structure of an EventBuffer * * Members: * flags: contains the component status bits, e.g. initialized * writeTrigger: optional eventfd that is used for signalizing that an event was written * ring: pointer to an array of elosEventBufferRing_t's * ringCount: size of the array of elosEventBufferRing_t's ******************************************************************/ typedef struct elosEventBuffer {
[docs][docs] safuFlags_t flags;
[docs][docs] atomic_int writeTrigger;
[docs][docs] elosEventBufferRing_t *ring;
[docs][docs] size_t ringCount;
} elosEventBuffer_t;