31using miosix::ConditionVariable;
32using miosix::FastMutex;
41template <
typename T,
unsigned int Size>
49 void put(
const T& elem)
51 Lock<FastMutex> l(mutex);
67 T
get(
unsigned int i = 0)
69 Lock<FastMutex> l(mutex);
82 Lock<FastMutex> l(mutex);
95 Lock<FastMutex> l(mutex);
106 Lock<FastMutex> l(mutex);
107 return buffer.count();
112 Lock<FastMutex> l(mutex);
113 return buffer.isEmpty();
118 Lock<FastMutex> l(mutex);
119 return buffer.isFull();
127 Lock<FastMutex> l(mutex);
128 while (buffer.isEmpty())
141 mutable FastMutex mutex;
142 mutable ConditionVariable cv;
144 CircularBuffer<T, Size> buffer;
size_t count() const
Counts the elements in the buffer.
T pop()
Pops the first element in the buffer.
void waitUntilNotEmpty()
Waits until the buffer contains at least one element.
T last()
Returns the last element added in the buffer.
size_t getSize() const
Returns the maximum number of elements that can be stored in the buffer.
T get(unsigned int i=0)
Gets an element from the buffer, without removing it.
This file includes all the types the logdecoder script will decode.