winss
Public Member Functions | List of all members
winss::InboundPipeInstance Class Reference

A pipe instance for inbound client/server. More...

#include <pipe_instance.hpp>

Inheritance diagram for winss::InboundPipeInstance:
Inheritance graph
[legend]
Collaboration diagram for winss::InboundPipeInstance:
Collaboration graph
[legend]

Public Member Functions

 InboundPipeInstance ()
 Creates a new outbound pipe instance. More...
 
 InboundPipeInstance (const InboundPipeInstance &)=delete
 No copy. More...
 
 InboundPipeInstance (InboundPipeInstance &&instance)
 Create a new inbound pipe instance and move from another. More...
 
bool FinishRead ()
 Finishes reading from the instance. More...
 
void Read ()
 Read from a pipe instance for events and data. More...
 
std::vector< char > SwapBuffer ()
 Swap the read buffer to be used by a listener. More...
 
InboundPipeInstanceoperator= (const InboundPipeInstance &)=delete
 No copy. More...
 
InboundPipeInstanceoperator= (InboundPipeInstance &&instance)
 Move an inbound pipe instance to this instance. More...
 
- Public Member Functions inherited from winss::PipeInstance
 PipeInstance ()
 Creates a new pipe instance. More...
 
 PipeInstance (const PipeInstance &)=delete
 No copy. More...
 
 PipeInstance (PipeInstance &&instance)
 Create a new pipe instance from another. More...
 
virtual bool IsPendingIO () const
 Gets if there is pending IO operations. More...
 
virtual bool IsConnected () const
 Gets if the instance is connected. More...
 
virtual bool IsClosing () const
 Gets if the instance is closing. More...
 
virtual winss::HandleWrapper GetHandle () const
 Gets the event handle for the instance. More...
 
virtual bool SetConnected ()
 Sets the instance to connected state. More...
 
virtual OverlappedResult GetOverlappedResult ()
 Gets the last overlapped result of the instance. More...
 
virtual bool CreateNamedPipe (const winss::PipeName &pipe_name)
 Creates the Windows named pipe server. More...
 
virtual bool CreateFile (const winss::PipeName &pipe_name)
 Creates a Windows named pipe client. More...
 
virtual void Closing ()
 Marks the pipe instance as closing and triggers the event. More...
 
virtual void DisconnectNamedPipe ()
 DIsconnect the client from the pipe server. More...
 
virtual bool Close ()
 Close the pipe connection. More...
 
PipeInstanceoperator= (const PipeInstance &)=delete
 No copy. More...
 
PipeInstanceoperator= (PipeInstance &&instance)
 Move a pipe instance to this instance. More...
 
virtual ~PipeInstance ()
 Default destructor. More...
 

Additional Inherited Members

- Static Public Attributes inherited from winss::PipeInstance
static const DWORD kBufferSize = 4096
 The pipe buffer. More...
 
static const DWORD kTimeout = 5000
 The pipe timeout. More...
 
- Protected Member Functions inherited from winss::PipeInstance
bool CheckError ()
 Checks if error is a real error or pending IO operation. More...
 
- Protected Attributes inherited from winss::PipeInstance
OVERLAPPED overlapped
 The overlapped structure. More...
 
HANDLE handle = nullptr
 The event handle. More...
 
bool connected = false
 Flags if the instance is connected. More...
 
bool pending_io = false
 Flagged if IO event is pending. More...
 
bool close = false
 Flagged if instance is closing. More...
 
std::vector< char > buffer
 The instance byte buffer. More...
 
DWORD bytes = 0
 The bytes read or written. More...
 

Detailed Description

A pipe instance for inbound client/server.

Constructor & Destructor Documentation

winss::InboundPipeInstance::InboundPipeInstance ( )

Creates a new outbound pipe instance.

winss::InboundPipeInstance::InboundPipeInstance ( const InboundPipeInstance )
delete

No copy.

winss::InboundPipeInstance::InboundPipeInstance ( winss::InboundPipeInstance &&  instance)

Create a new inbound pipe instance and move from another.

Parameters
instanceThe inbound pipe instance to move from.

Member Function Documentation

bool winss::InboundPipeInstance::FinishRead ( )

Finishes reading from the instance.

Returns
True if bytes were read otherwise false.

References winss::PipeInstance::bytes, winss::PipeInstance::connected, and winss::PipeInstance::pending_io.

InboundPipeInstance& winss::InboundPipeInstance::operator= ( const InboundPipeInstance )
delete

No copy.

winss::InboundPipeInstance & winss::InboundPipeInstance::operator= ( winss::InboundPipeInstance &&  instance)

Move an inbound pipe instance to this instance.

Parameters
instanceThe inbound pipe instance to move from.
Returns
This inbound pipe instance.

References winss::PipeInstance::operator=().

void winss::InboundPipeInstance::Read ( )
std::vector< char > winss::InboundPipeInstance::SwapBuffer ( )

Swap the read buffer to be used by a listener.

Returns
The old buffer.

References winss::PipeInstance::buffer, winss::PipeInstance::bytes, winss::PipeInstance::connected, and winss::PipeInstance::kBufferSize.


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