Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cOSPipeClient Class Reference

#include <cOSPipe.h>

Inheritance diagram for GrayLib::cOSPipeClient:
GrayLib::cOSPipe Gray::cStreamOutput Gray::cOSHandle Gray::cStreamBase Gray::cNonCopyable

Public Member Functions

 cOSPipeClient ()
 
virtual ~cOSPipeClient (void)
 
HRESULT OpenPipe (const FILECHAR_t *pszPipeName, TIMESYSD_t nTimeOutTotal=0)
 
virtual HRESULT WriteX (const void *pBuffer, size_t nDataSize) override
 
- Public Member Functions inherited from GrayLib::cOSPipe
 UNITTEST2_PREDEF (cOSPipe)
 
- Public Member Functions inherited from Gray::cOSHandle
 cOSHandle (HANDLE h=INVALID_HANDLE_VALUE) noexcept
 
 cOSHandle (const cOSHandle &Handle) noexcept
 
cOSHandleoperator= (const cOSHandle &Handle)
 
 ~cOSHandle ()
 
 operator HANDLE () const noexcept
 
HANDLE get_Handle () const noexcept
 
HANDLE & ref_Handle () noexcept
 
bool isValidHandle () const noexcept
 
void CloseHandle () noexcept
 
void AttachHandle (HANDLE h) noexcept
 
HANDLE DetachHandle () noexcept
 
HRESULT WriteX (const void *pData, size_t nDataSize) const
 
HRESULT ReadX (void *pData, size_t nDataSize) const
 
HRESULT FlushX () const
 
STREAM_SEEKRET_t Seek (STREAM_OFFSET_t lOffset, SEEK_ORIGIN_TYPE eSeekOrigin) const
 
HRESULT WaitForSingleObject (TIMESYSD_t dwMilliseconds) const
 
- Public Member Functions inherited from Gray::cStreamOutput
 cStreamOutput () noexcept
 
virtual ~cStreamOutput ()
 
HRESULT WriteT (const void *pVal, size_t nDataSize)
 
template<typename TYPE >
HRESULT WriteT (TYPE val)
 
HRESULT WriteSize (size_t nSize)
 
HRESULT WriteHashCode (HASHCODE_t nHashCode)
 
HRESULT WriteN (const void *pBuffer, size_t nSize)
 
template<typename _CH >
HRESULT WriteStringN (const _CH *pszStr)
 
template<typename _CH >
HRESULT WriteCharRepeat (_CH nChar, int nCount=1)
 
virtual HRESULT WriteString (const char *pszStr)
 
virtual HRESULT WriteString (const wchar_t *pszStr)
 
StrLen_t VPrintf (const char *pszFormat, va_list args)
 
StrLen_t VPrintf (const wchar_t *pszFormat, va_list args)
 
StrLen_t _cdecl Printf (const char *pszFormat,...)
 
StrLen_t _cdecl Printf (const wchar_t *pszFormat,...)
 
HRESULT WriteStream (cStreamInput &sInp, STREAM_POS_t nSizeMax=k_FILE_BLOCK_SIZE, IStreamProgressCallback *pProgress=nullptr, TIMESYSD_t nTimeout=0)
 Copy cStreamInput to this stream. More...
 
virtual HRESULT FlushX ()
 
- Public Member Functions inherited from Gray::cStreamBase
virtual ~cStreamBase ()
 
virtual STREAM_SEEKRET_t Seek (STREAM_OFFSET_t iOffset, SEEK_ORIGIN_TYPE eSeekOrigin=SEEK_Set)
 
void SeekToBegin ()
 
STREAM_POS_t SeekToEnd ()
 
virtual STREAM_POS_t GetPosition () const
 
virtual STREAM_POS_t GetLength () const
 

Static Public Member Functions

static HRESULT GRAYCALL OpenWritePipe (const FILECHAR_t *pszPipeName, TIMESYSD_t nTimeOutTotal, const void *pBuffer, size_t nDataSize)
 
- Static Public Member Functions inherited from GrayLib::cOSPipe
static StrLen_t GRAYCALL MakePipePath (OUT FILECHAR_t *pszPipePath, StrLen_t nLenMax, const FILECHAR_t *pszPipeName)
 
- Static Public Member Functions inherited from Gray::cOSHandle
static bool IsValidHandle (HANDLE h) noexcept
 
static bool CloseHandle (HANDLE h) noexcept
 

Additional Inherited Members

- Public Attributes inherited from Gray::cOSHandle
HANDLE m_h
 
- Static Public Attributes inherited from Gray::cStreamBase
static const BYTE k_SIZE_MASK = 0x80
 Used for WriteSize() More...
 
static const size_t k_FILE_BLOCK_SIZE = (32 * 1024)
 default arbitrary transfer block size. more than this is NOT more efficient. More...
 
- Protected Member Functions inherited from GrayLib::cOSPipe
 cOSPipe (void)
 
virtual ~cOSPipe (void)
 
- Protected Member Functions inherited from Gray::cOSHandle
void CloseHandleLast () noexcept
 
- Protected Member Functions inherited from Gray::cNonCopyable
 cNonCopyable () noexcept
 Force the use of Factory creation via protected constructor. More...
 
 ~cNonCopyable () noexcept
 

Detailed Description

writer is considered the client. waiting writes. Must open after the reader/server.

Constructor & Destructor Documentation

◆ cOSPipeClient()

GrayLib::cOSPipeClient::cOSPipeClient ( )

◆ ~cOSPipeClient()

GrayLib::cOSPipeClient::~cOSPipeClient ( void  )
virtual

Member Function Documentation

◆ OpenPipe()

HRESULT GrayLib::cOSPipeClient::OpenPipe ( const FILECHAR_t pszPipeName,
TIMESYSD_t  nTimeOutTotal = 0 
)

open a client/writer side of the pipe.

Note
Make sure we close the pipe ASAP. this will lock out other clients if we don't.
Returns
HRESULT_WIN32_C(ERROR_SEM_TIMEOUT) = couldn't open the pipe in time.

◆ OpenWritePipe()

HRESULT GRAYCALL GrayLib::cOSPipeClient::OpenWritePipe ( const FILECHAR_t pszPipeName,
TIMESYSD_t  nTimeOutTotal,
const void *  pBuffer,
size_t  nDataSize 
)
static

client Open,write,close as a single operation. same as _WIN32 ::CallNamedPipe()

◆ WriteX()

HRESULT GrayLib::cOSPipeClient::WriteX ( const void *  pBuffer,
size_t  nDataSize 
)
overridevirtual

cStreamOutput client/writer side of the pipe.

  • pData == nullptr = just test if i could write this much. ASSUME OpenPipe() was called. else use CallNamedPipe() ?

Reimplemented from Gray::cStreamOutput.


The documentation for this class was generated from the following files: