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

#include <cOSPipe.h>

Inheritance diagram for GrayLib::cOSPipeServer:
GrayLib::cOSPipe Gray::cStreamInput Gray::cOSHandle Gray::cStreamBase Gray::cNonCopyable

Public Member Functions

bool isConnected () const noexcept
 
 cOSPipeServer (void)
 
virtual ~cOSPipeServer (void)
 
HRESULT CreatePipe (const FILECHAR_t *pszPipeName, size_t nOutBufferSize=kSizeDef, TIMESYS_t waitForClient=cTimeSys::k_FREQ/2)
 
virtual HRESULT ReadX (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::cStreamInput
 cStreamInput () noexcept
 
virtual ~cStreamInput ()
 
virtual size_t SetSeekSizeMin (size_t nSizeMin=k_FILE_BLOCK_SIZE)
 
virtual HRESULT ReadX (OUT void *pData, size_t nDataSize)
 
HRESULT ReadAll (OUT cHeapBlock &block, size_t nSizeExtra=0)
 
virtual HRESULT ReadStringLine (OUT char *pszBuffer, StrLen_t iSizeMax)
 
virtual HRESULT ReadStringLine (OUT wchar_t *pszBuffer, StrLen_t iSizeMax)
 
HRESULT ReadT (OUT void *pVal, size_t nSize)
 
template<typename TYPE >
HRESULT ReadT (OUT TYPE &val)
 
template<typename TYPE >
HRESULT ReadTN (OUT TYPE &val)
 
HRESULT ReadSize (OUT size_t &nSize)
 
template<typename TYPE >
HRESULT ReadSizeT (OUT TYPE &n)
 
HRESULT ReadHashCode (OUT UINT32 &nHashCode)
 
HRESULT ReadHashCode (OUT UINT64 &nHashCode)
 
HRESULT ReadN (OUT BYTE *pBuffer, size_t nSizeMax)
 
template<typename _CH >
HRESULT ReadStringN (OUT _CH *pszStr, StrLen_t iSizeMax)
 
virtual HRESULT ReadPeek (void *pData, size_t nDataSize)
 
- 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 Attributes

static const size_t kSizeDef = 1024
 
- 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...
 

Additional Inherited Members

- 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
 
- Public Attributes inherited from Gray::cOSHandle
HANDLE m_h
 
- 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

reader is considered the server and must open before the writer. non blocking reads. NON secure. any local app may write to this pipe.

Constructor & Destructor Documentation

◆ cOSPipeServer()

GrayLib::cOSPipeServer::cOSPipeServer ( void  )

◆ ~cOSPipeServer()

GrayLib::cOSPipeServer::~cOSPipeServer ( void  )
virtual

Member Function Documentation

◆ CreatePipe()

HRESULT GrayLib::cOSPipeServer::CreatePipe ( const FILECHAR_t pszPipeName,
size_t  nOutBufferSize = kSizeDef,
TIMESYS_t  waitForClient = cTimeSys::k_FREQ / 2 
)

Create server/reader pipe. Must be created before writers. i am the server. There can only be 1 pipe with this name on the system. linux = http://www.linuxjournal.com/article/2156 _WIN32 = http://msdn.microsoft.com/en-us/library/aa365590.aspx http://www.cplusplus.com/forum/articles/11168/

◆ isConnected()

bool GrayLib::cOSPipeServer::isConnected ( ) const
inlinenoexcept

◆ ReadX()

HRESULT GrayLib::cOSPipeServer::ReadX ( void *  pBuffer,
size_t  nDataSize 
)
overridevirtual

cStreamInput read data on this server/reader pipe.

Returns
HRESULT_WIN32_C(ERROR_PIPE_LISTENING) = non blocking mode failed to read immediately. no client is connected.

Member Data Documentation

◆ kSizeDef

const size_t GrayLib::cOSPipeServer::kSizeDef = 1024
static

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