Dawn Framework 1.0
Universal data acquisition framework for embedded systems
stream_notifier.hxx
1// dawn/include/dawn/io/stream_notifier.hxx
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#pragma once
7
8#include <vector>
9
10#include "dawn/common/thread.hxx"
11#include "dawn/io/inotifier.hxx"
12#include "dawn/porting/config.hxx"
13
14namespace dawn
15{
16// Forward declaration
17
18struct io_ddata_t;
19
33class CStreamNotifier final : public IIONotifier
34{
35public:
38
39 CStreamNotifier(const CStreamNotifier &) = delete;
40 CStreamNotifier &operator=(const CStreamNotifier &) = delete;
41
42 void setThreadConfig(const CThreadedObject::SThreadConfig &config)
43 {
44 threadCtl.setThreadConfig(config);
45 }
46
47 void setThreadStackSize(size_t stackSize)
48 {
49 threadCtl.setThreadStackSize(stackSize);
50 }
51
52 void setThreadPriority(int priority)
53 {
54 threadCtl.setThreadPriority(priority);
55 }
56
57 void setThreadScheduler(int scheduler)
58 {
59 threadCtl.setThreadScheduler(scheduler);
60 }
61
62 int regNotifier(SIONotifier n) override;
63 int start();
64 int stop();
65
66private:
67 std::vector<SIONotifier> users;
68 CIOCommon *io;
69 io_ddata_t *data;
70 size_t batch;
71 CThreadedObject threadCtl;
72
73 void thread();
74};
75} // Namespace dawn
Base class for all I/O objects.
Definition common.hxx:27
Stream-based I/O notifier with dedicated thread per I/O.
int regNotifier(SIONotifier n)
Register I/O notification callback.
Portable thread owner abstraction for Dawn components.
Definition thread.hxx:32
void setThreadScheduler(int scheduler)
Configure worker thread scheduler policy.
Definition thread.hxx:169
void setThreadStackSize(size_t stackSize)
Configure worker thread stack size.
Definition thread.hxx:129
void setThreadPriority(int priority)
Configure worker thread priority.
Definition thread.hxx:149
void setThreadConfig(const SThreadConfig &config)
Replace the full thread configuration.
Definition thread.hxx:109
Abstract interface for registering asynchronous I/O notification.
Definition inotifier.hxx:25
Out-of-tree user-extension hooks for Dawn.
Definition bindable.hxx:13
Per-thread runtime configuration.
Definition thread.hxx:55
Notifier registration structure.
Definition inotifier.hxx:46
Heap-allocated dynamic I/O data buffer.
Definition ddata.hxx:21