Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions FreeRTOS-Cpp/include/FreeRTOS/EventGroups.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class EventGroupBase {
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

// NOLINTNEXTLINE
using EventBits = std::bitset<((configUSE_16_BIT_TICKS == 1) ? 8 : 24)>;
Expand Down Expand Up @@ -380,7 +378,21 @@ class EventGroupBase {
* FreeRTOS::EventGroup or FreeRTOS::StaticEventGroup.
*/
EventGroupBase() = default;
~EventGroupBase() = default;

/**
* EventGroup.hpp
*
* @brief Destroy the EventGroupBase object by calling <tt>void
* vEventGroupDelete( EventGroupHandle_t xEventGroup )</tt>
*
* @see <https://www.freertos.org/vEventGroupDelete.html>
*
* Delete an event group.
*
* Tasks that are blocked on the event group being deleted will be unblocked,
* and report an event group value of 0.
*/
~EventGroupBase() { vEventGroupDelete(this->handle); };

EventGroupBase(EventGroupBase&&) noexcept = default;
EventGroupBase& operator=(EventGroupBase&&) noexcept = default;
Expand Down Expand Up @@ -425,21 +437,7 @@ class EventGroup : public EventGroupBase {
* @include EventGroups/eventGroup.cpp
*/
EventGroup() { this->handle = xEventGroupCreate(); }

/**
* EventGroup.hpp
*
* @brief Destroy the EventGroup object by calling <tt>void vEventGroupDelete(
* EventGroupHandle_t xEventGroup )</tt>
*
* @see <https://www.freertos.org/vEventGroupDelete.html>
*
* Delete an event group.
*
* Tasks that are blocked on the event group being deleted will be unblocked,
* and report an event group value of 0.
*/
~EventGroup() { vEventGroupDelete(this->handle); }
~EventGroup() = default;

EventGroup(const EventGroup&) = delete;
EventGroup& operator=(const EventGroup&) = delete;
Expand Down
30 changes: 14 additions & 16 deletions FreeRTOS-Cpp/include/FreeRTOS/MessageBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ class MessageBufferBase {
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* MessageBuffer.hpp
Expand Down Expand Up @@ -391,7 +389,19 @@ class MessageBufferBase {

private:
MessageBufferBase() = default;
~MessageBufferBase() = default;

/**
* MessageBuffer.hpp
*
* @brief Destroy the MessageBufferBase object by calling <tt>void
* vMessageBufferDelete( MessageBufferHandle_t xMessageBuffer )</tt>
*
* @see <https://www.freertos.org/vMessageBufferDelete.html>
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
*/
~MessageBufferBase() { vMessageBufferDelete(this->handle); }

MessageBufferBase(MessageBufferBase&&) noexcept = default;
MessageBufferBase& operator=(MessageBufferBase&&) noexcept = default;
Expand Down Expand Up @@ -439,19 +449,7 @@ class MessageBuffer : public MessageBufferBase {
explicit MessageBuffer(size_t size) {
this->handle = xMessageBufferCreate(size);
}

/**
* MessageBuffer.hpp
*
* @brief Destroy the MessageBuffer object by calling <tt>void
* vMessageBufferDelete( MessageBufferHandle_t xMessageBuffer )</tt>
*
* @see <https://www.freertos.org/vMessageBufferDelete.html>
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
*/
~MessageBuffer() { vMessageBufferDelete(this->handle); }
~MessageBuffer() = default;

MessageBuffer(const MessageBuffer&) = delete;
MessageBuffer& operator=(const MessageBuffer&) = delete;
Expand Down
46 changes: 15 additions & 31 deletions FreeRTOS-Cpp/include/FreeRTOS/Mutex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class MutexBase {
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* Mutex.hpp
Expand Down Expand Up @@ -159,7 +157,19 @@ class MutexBase {

private:
MutexBase() = default;
~MutexBase() = default;

/**
* Mutex.hpp
*
* @brief Destroy the MutexBase object by calling <tt>void vSemaphoreDelete(
* SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a mutex that has tasks blocked on it (tasks that are in
* the Blocked state waiting for the mutex to become available).
*/
~MutexBase() { vSemaphoreDelete(this->handle); }

MutexBase(MutexBase&&) noexcept = default;
MutexBase& operator=(MutexBase&&) noexcept = default;
Expand Down Expand Up @@ -194,8 +204,6 @@ class RecursiveMutexBase : public MutexBase {
static void* operator new[](size_t, void*);
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* Mutex.hpp
Expand Down Expand Up @@ -298,19 +306,7 @@ class Mutex : public MutexBase {
* @include Mutex/mutex.cpp
*/
Mutex() { this->handle = xSemaphoreCreateMutex(); }

/**
* Mutex.hpp
*
* @brief Destroy the Mutex object by calling <tt>void vSemaphoreDelete(
* SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a mutex that has tasks blocked on it (tasks that are in
* the Blocked state waiting for the mutex to become available).
*/
~Mutex() { vSemaphoreDelete(this->handle); }
~Mutex() = default;

Mutex(const Mutex&) = delete;
Mutex& operator=(const Mutex&) = delete;
Expand Down Expand Up @@ -363,19 +359,7 @@ class RecursiveMutex : public RecursiveMutexBase {
* @include Mutex/recursiveMutex.cpp
*/
RecursiveMutex() { this->handle = xSemaphoreCreateRecursiveMutex(); }

/**
* Mutex.hpp
*
* @brief Destroy the RecursiveMutex object by calling <tt>void
* vSemaphoreDelete( SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a mutex that has tasks blocked on it (tasks that are in
* the Blocked state waiting for the mutex to become available).
*/
~RecursiveMutex() { vSemaphoreDelete(this->handle); }
~RecursiveMutex() = default;

RecursiveMutex(const RecursiveMutex&) = delete;
RecursiveMutex& operator=(const RecursiveMutex&) = delete;
Expand Down
30 changes: 14 additions & 16 deletions FreeRTOS-Cpp/include/FreeRTOS/Queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ class QueueBase {
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* Queue.hpp
Expand Down Expand Up @@ -610,7 +608,19 @@ class QueueBase {
* FreeRTOS::Queue or FreeRTOS::StaticQueue.
*/
QueueBase() = default;
~QueueBase() = default;

/**
* Queue.hpp
*
* @brief Destroy the QueueBase object by calling <tt>void vQueueDelete(
* QueueHandle_t xQueue )</tt>
*
* @see <https://www.freertos.org/a00018.html#vQueueDelete>
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
*/
~QueueBase() { vQueueDelete(this->handle); }

QueueBase(QueueBase&&) noexcept = default;
QueueBase& operator=(QueueBase&&) noexcept = default;
Expand Down Expand Up @@ -659,19 +669,7 @@ class Queue : public QueueBase<T> {
explicit Queue(const UBaseType_t length) {
this->handle = xQueueCreate(length, sizeof(T));
}

/**
* Queue.hpp
*
* @brief Destroy the Queue object by calling <tt>void vQueueDelete(
* QueueHandle_t xQueue )</tt>
*
* @see <https://www.freertos.org/a00018.html#vQueueDelete>
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
*/
~Queue() { vQueueDelete(this->handle); }
~Queue() = default;

Queue(const Queue&) = delete;
Queue& operator=(const Queue&) = delete;
Expand Down
47 changes: 15 additions & 32 deletions FreeRTOS-Cpp/include/FreeRTOS/Semaphore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class SemaphoreBase {
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* Semaphore.hpp
Expand Down Expand Up @@ -241,7 +239,19 @@ class SemaphoreBase {

private:
SemaphoreBase() = default;
~SemaphoreBase() = default;

/**
* Semaphore.hpp
*
* @brief Destroy the SemaphoreBase object by calling <tt>void
* vSemaphoreDelete( SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a semaphore that has tasks blocked on it (tasks that
* are in the Blocked state waiting for the semaphore to become available).
*/
~SemaphoreBase() { vSemaphoreDelete(this->handle); }

SemaphoreBase(SemaphoreBase&&) noexcept = default;
SemaphoreBase& operator=(SemaphoreBase&&) noexcept = default;
Expand Down Expand Up @@ -314,19 +324,7 @@ class BinarySemaphore : public SemaphoreBase {
* @include Semaphore/binarySemaphore.cpp
*/
BinarySemaphore() { this->handle = xSemaphoreCreateBinary(); }

/**
* Semaphore.hpp
*
* @brief Destroy the BinarySemaphore object by calling <tt>void
* vSemaphoreDelete( SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a semaphore that has tasks blocked on it (tasks that
* are in the Blocked state waiting for the semaphore to become available).
*/
~BinarySemaphore() { vSemaphoreDelete(this->handle); }
~BinarySemaphore() = default;

BinarySemaphore(const BinarySemaphore&) = delete;
BinarySemaphore& operator=(const BinarySemaphore&) = delete;
Expand Down Expand Up @@ -391,22 +389,7 @@ class CountingSemaphore : public SemaphoreBase {
const UBaseType_t initialCount = 0) {
this->handle = xSemaphoreCreateCounting(maxCount, initialCount);
}

/**
* Semaphore.hpp
*
* @brief Destroy the CountingSemaphore object by calling
* <tt>void vSemaphoreDelete( SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a semaphore that has tasks blocked on it (tasks that
* are in the Blocked state waiting for the semaphore to become available).
*
* <b>Example Usage</b>
* @include Semaphore/countingSemaphore.cpp
*/
~CountingSemaphore() { vSemaphoreDelete(this->handle); }
~CountingSemaphore() = default;

CountingSemaphore(const CountingSemaphore&) = delete;
CountingSemaphore& operator=(const CountingSemaphore&) = delete;
Expand Down
28 changes: 13 additions & 15 deletions FreeRTOS-Cpp/include/FreeRTOS/StreamBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ class StreamBufferBase {
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* StreamBuffer.hpp
Expand Down Expand Up @@ -422,7 +420,18 @@ class StreamBufferBase {

private:
StreamBufferBase() = default;
~StreamBufferBase() = default;

/**
* StreamBuffer.hpp
*
* @brief Destroy the StreamBufferBase object by calling
* <tt>void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer )</tt>
*
* @see <https://www.freertos.org/vStreamBufferDelete.html>
*
* Deletes a stream buffer and free the allocated memory.
*/
~StreamBufferBase() { vStreamBufferDelete(this->handle); }

StreamBufferBase(StreamBufferBase&&) noexcept = default;
StreamBufferBase& operator=(StreamBufferBase&&) noexcept = default;
Expand Down Expand Up @@ -478,18 +487,7 @@ class StreamBuffer : public StreamBufferBase {
explicit StreamBuffer(const size_t size, const size_t triggerLevel = 0) {
this->handle = xStreamBufferCreate(size, triggerLevel);
}

/**
* StreamBuffer.hpp
*
* @brief Destroy the StreamBuffer object by calling
* <tt>void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer )</tt>
*
* @see <https://www.freertos.org/vStreamBufferDelete.html>
*
* Deletes a stream buffer and free the allocated memory.
*/
~StreamBuffer() { vStreamBufferDelete(this->handle); }
~StreamBuffer() = default;

StreamBuffer(const StreamBuffer&) = delete;
StreamBuffer& operator=(const StreamBuffer&) = delete;
Expand Down
Loading