Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
CircularArray.h
- Committer:
- GLemasson
- Date:
- 2014-02-11
- Revision:
- 0:28766f5a758e
- Child:
- 1:5036a532fe62
File content as of revision 0:28766f5a758e:
#ifndef _CIRCULAR_ARRAY_H_ #define _CIRCULAR_ARRAY_H_ template<typename T> class CircularArray { private: unsigned int m_capacity; volatile unsigned int w; volatile unsigned int r; volatile bool m_full; volatile bool m_empty; volatile T * data; public: CircularArray(unsigned int capacity); ~CircularArray(); T * getWritePointer(); T * getReadPointer(T * buffer=0,unsigned int num=0); void writeElements(unsigned int num); void readElements(unsigned int num); unsigned int fillCapacity(); unsigned int freeSpace(); unsigned int size(); unsigned int readable(); bool full(); bool empty(); }; #endif