1#ifndef Driver_TPipe_Pipe_h_
2#define Driver_TPipe_Pipe_h_
86 const char* verbDelimiters=
" "
115 bool sendCommand( const
char* completeCommandText,
size_t numBytes ) noexcept;
118 bool sendRawCommand( const
char* completeCommandText,
size_t numBytes ) noexcept;
This template class implements a THREAD SAFE Ring Buffer.
Definition RingBufferMT.h:33
This partially abstract class defines a interface for operating on an output stream (example of a str...
Definition Output.h:34
This partially concrete class defines an interface a Text "Decoder" that has a Cpl::Io::Input stream ...
Definition StreamDecoder.h:34
This concrete class implements the Encoder API where the Output destination is a Cpl::Io::Output stre...
Definition StreamEncoder.h:36
This concrete class provides the implementation of TPipe.
Definition Pipe.h:60
bool poll() noexcept
This method provides the TPipe CPU/Execution time.
char * m_frameBuffer
Frame buffer.
Definition Pipe.h:139
bool sendCommand(const char *completeCommandText, size_t numBytes) noexcept
See Driver::TPipe::Tx.
Cpl::Text::Frame::StreamEncoder & m_framer
Frame Encoder.
Definition Pipe.h:136
void stop() noexcept
This method performs the in-thread shutdown of the TPipe.
Cpl::System::Mutex m_lock
Lock for thread safety and atomic transmits.
Definition Pipe.h:145
size_t getUnknownFrameCount() noexcept
This method returns the number of received frames that there was no registered frame handler to proce...
void start(Cpl::Io::Input &inStream, Cpl::Io::Output &outStream) noexcept
This method performs the in-thread initialization of the TPipe.
Cpl::Container::Map< RxFrameHandlerApi > & m_rxHandlers
List of Frame handlers.
Definition Pipe.h:130
size_t m_unknownFrames
Track the number of unknown frames (i.e. frame received with no register frame handler)
Definition Pipe.h:154
Cpl::Text::Frame::StreamDecoder & m_deframer
Frame Decoder.
Definition Pipe.h:133
bool sendRawCommand(const char *completeCommandText, size_t numBytes) noexcept
See Driver::TPipe::Tx.
Pipe(Cpl::Container::Map< RxFrameHandlerApi > &rxFrameHdlrs, Cpl::Text::Frame::StreamDecoder &deframer, Cpl::Text::Frame::StreamEncoder &framer, size_t rxFrameSize, const char *verbDelimiters=" ")
Constructor.
Cpl::Io::Output * m_outfdPtr
Cache the handle to the output stream (for raw-commands)
Definition Pipe.h:142
size_t m_frameBufSize
Frame buffer size (not including the null terminator)
Definition Pipe.h:148
const char * m_verbDelimiters
Delimiter(s) to find the end of the command verb.
Definition Pipe.h:151
This abstract class defines the 'Received Frame Handler' interface for the TPipe.
Definition RxFrameHandlerApi.h:29
This abstract class defines the 'Transmit Command' interface for the TPipe.
Definition Tx.h:27
The 'Cpl' namespace is the root name space for the Colony.
Definition Api16.h:20