![]() |
GM6000 Digital Heater Controller Build: 20 (Branch = develop)
SDX-1330
|
This concrete class implements an InputOutput stream using a Ring Buffer. More...
This concrete class implements an InputOutput stream using a Ring Buffer.
NOTES:
#include <InputOutput.h>
Public Member Functions | |
| InputOutput (void *rawMemory, unsigned memorySizeInBytes) | |
| Constructor. The application supplies the Memory. | |
| ~InputOutput () | |
| Destructor. | |
| virtual void | reset () |
| This function will clear/reset-to-empty the internal ring buffer IF the instance is still opened. | |
| bool | read (void *buffer, int numBytes, int &bytesRead) |
| See Cpl::Io::Input. | |
| bool | available () |
| See Cpl::Io::Input. | |
| bool | write (const void *buffer, int maxBytes, int &bytesWritten) |
| See Cpl::Io::Output. | |
| void | flush () |
| See Cpl::Io::Output. | |
| bool | isEos () |
| See Cpl::Io::IsEos. | |
| void | close () |
| See Cpl::Io::Close. Note: Once closed() has been called, all of the write() method will return false;. | |
Public Member Functions inherited from Cpl::Io::Input | |
| virtual bool | read (char &c) |
| Reads a single byte from the stream. | |
| virtual bool | read (Cpl::Text::String &destString) |
| Reads N bytes into the String's internal buffer. | |
| virtual | ~Input () |
| Lets the make the destructor virtual. | |
Public Member Functions inherited from Cpl::Io::Close | |
| virtual | ~Close () |
| Lets the make the destructor virtual. | |
Public Member Functions inherited from Cpl::Container::Item | |
| bool | insert_ (void *newContainerPtr) |
| Helper method to trap when inserting an item in multiple containers. | |
| bool | isInContainer_ (const void *containerPtr) const noexcept |
| Returns 'true' if the instance is in the specified container. | |
Public Member Functions inherited from Cpl::Io::IsEos | |
| virtual | ~IsEos () |
| Lets the make the destructor virtual. | |
Public Member Functions inherited from Cpl::Io::Output | |
| virtual bool | write (char c) |
| Writes a single byte to the stream. | |
| virtual bool | write (const char *string) |
| Writes a string to the stream. | |
| virtual bool | write (const Cpl::Text::String &string) |
| Writes a string to the stream. | |
| virtual bool | write (Cpl::Text::String &formatBuffer, const char *format,...) |
| Formatted write to the stream. | |
| virtual bool | vwrite (Cpl::Text::String &formatBuffer, const char *format, va_list ap) |
| Same as write( String& formatBuffer, const char* format,...), except that it is called with a va_list instead of a variable number of arguments. | |
| virtual bool | write (const void *buffer, int numBytes) |
| Writes the content of the buffer to the stream. | |
| virtual | ~Output () |
| Lets the make the destructor virtual. | |
Protected Attributes | |
| Cpl::Container::RingBuffer< uint8_t > | m_ringBuffer |
| Ring buffer. | |
| Cpl::System::Mutex | m_lock |
| Mutex to provide thread safety. | |
| Cpl::System::Semaphore | m_semaWriters |
| Semaphore to provide blocking semantics. | |
| Cpl::System::Semaphore | m_semaReaders |
| Semaphore to provide blocking semantics. | |
| unsigned | m_writersWaiting |
| Track my Write waiters. | |
| unsigned | m_readersWaiting |
| Track my Read waiters. | |
| bool | m_opened |
| Track my opened/closed state. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Cpl::Container::Item | |
| static void | remove_ (Item *itemPtr) noexcept |
| Helper method to do the proper 'clean-up' for the multiple-containers-error-trap when removing an item from a container. | |
Public Attributes inherited from Cpl::Container::Item | |
| void * | m_nextPtr_ |
| The link field. | |
| void * | m_inListPtr_ |
| Debug field. | |
Protected Member Functions inherited from Cpl::Container::Item | |
| Item () | |
| Constructor. | |
| Item (const char *) | |
| Constructor used ONLY with the child class MapItem: -->special constructor to allow a Map to be statically allocated. | |
| Cpl::Io::Ram::InputOutput::InputOutput | ( | void * | rawMemory, |
| unsigned | memorySizeInBytes ) |
Constructor. The application supplies the Memory.
| Cpl::Io::Ram::InputOutput::~InputOutput | ( | ) |
Destructor.
|
virtual |
See Cpl::Io::Input.
Implements Cpl::Io::Input.
|
virtual |
See Cpl::Io::Close. Note: Once closed() has been called, all of the write() method will return false;.
Implements Cpl::Io::Close.
|
virtual |
See Cpl::Io::Output.
Implements Cpl::Io::Output.
|
virtual |
See Cpl::Io::IsEos.
Implements Cpl::Io::IsEos.
|
virtual |
See Cpl::Io::Input.
Implements Cpl::Io::Input.
|
virtual |
This function will clear/reset-to-empty the internal ring buffer IF the instance is still opened.
|
virtual |
See Cpl::Io::Output.
Implements Cpl::Io::Output.
|
protected |
Mutex to provide thread safety.
|
protected |
Track my opened/closed state.
|
protected |
Track my Read waiters.
|
protected |
Ring buffer.
|
protected |
Semaphore to provide blocking semantics.
|
protected |
Semaphore to provide blocking semantics.
|
protected |
Track my Write waiters.