Cleanup/improvements

This commit is contained in:
Ken Van Hoeylandt 2025-09-01 00:08:26 +02:00
parent 1aa5daf1b0
commit 601b7733d4
9 changed files with 12 additions and 19 deletions

View File

@ -13,9 +13,7 @@ namespace tt {
/**
* A dictionary that maps keys (strings) onto several atomary types.
*/
class Bundle {
private:
class Bundle final {
typedef uint32_t Hash;

View File

@ -19,7 +19,8 @@ namespace tt {
* Generally, one task would dispatch the execution,
* while the other thread consumes and executes the work.
*/
class Dispatcher {
class Dispatcher final {
public:
typedef std::function<void()> Function;

View File

@ -5,7 +5,7 @@
namespace tt {
/** Starts a Thread to process dispatched messages */
class DispatcherThread {
class DispatcherThread final {
Dispatcher dispatcher;
std::unique_ptr<Thread> thread;

View File

@ -8,8 +8,7 @@ namespace tt {
/**
* Wrapper for FreeRTOS xEventGroup.
*/
class EventFlag {
private:
class EventFlag final {
struct EventGroupHandleDeleter {
void operator()(EventGroupHandle_t handleToDelete) {

View File

@ -7,7 +7,7 @@ namespace tt {
/** Publish and subscribe to messages in a thread-safe manner. */
template<typename DataType>
class PubSub {
class PubSub final {
struct Subscription {
uint64_t id;

View File

@ -21,8 +21,6 @@ namespace tt {
*/
class Semaphore final : public Lock {
private:
struct SemaphoreHandleDeleter {
void operator()(QueueHandle_t handleToDelete) {
assert(!kernel::isIsr());

View File

@ -22,9 +22,7 @@ namespace tt {
* interrupt that will write to the buffer (the writer), and only one task or
* interrupt that will read from the buffer (the reader).
*/
class StreamBuffer {
private:
class StreamBuffer final {
struct StreamBufferHandleDeleter {
void operator()(StreamBufferHandle_t handleToDelete) {

View File

@ -1,6 +1,5 @@
#pragma once
#include "CoreDefines.h"
#include "RtosCompatTask.h"
#include <functional>
@ -11,7 +10,7 @@ namespace tt {
typedef TaskHandle_t ThreadId;
class Thread {
class Thread final {
public:
@ -184,8 +183,8 @@ public:
static uint32_t awaitFlags(uint32_t flags, uint32_t options, uint32_t timeout);
};
#define THREAD_PRIORITY_SERVICE Thread::Priority::High
#define THREAD_PRIORITY_RENDER Thread::Priority::Higher
#define THREAD_PRIORITY_ISR Thread::Priority::Critical
constexpr auto THREAD_PRIORITY_SERVICE = Thread::Priority::High;
constexpr auto THREAD_PRIORITY_RENDER = Thread::Priority::Higher;
constexpr auto THREAD_PRIORITY_ISR = Thread::Priority::Critical;
} // namespace

View File

@ -5,7 +5,7 @@
namespace tt {
inline static StreamBufferHandle_t createStreamBuffer(size_t size, size_t triggerLevel) {
static StreamBufferHandle_t createStreamBuffer(size_t size, size_t triggerLevel) {
assert(size != 0);
return xStreamBufferCreate(size, triggerLevel);
}