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

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

#include <pipe_instance.hpp>

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

Public Member Functions

 OutboundPipeInstance ()
 Creates an outbound pipe instance. More...
 
 OutboundPipeInstance (const OutboundPipeInstance &)=delete
 No copy. More...
 
 OutboundPipeInstance (OutboundPipeInstance &&instance)
 Create a new outbound pipe instance and move from another. More...
 
bool Queue (const std::vector< char > &data)
 Queue the data to be sent. More...
 
bool HasMessages () const
 Get if the instance has messages to send. More...
 
bool IsWriting () const
 Get if the instance is currently writing data. More...
 
bool FinishWrite ()
 Complete writing data. More...
 
bool Write ()
 Write the data. More...
 
void Read ()
 Read for write responses. More...
 
OutboundPipeInstanceoperator= (const OutboundPipeInstance &)=delete
 No copy. More...
 
OutboundPipeInstanceoperator= (OutboundPipeInstance &&instance)
 Move an outbound 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 outbound client/server.

Constructor & Destructor Documentation

winss::OutboundPipeInstance::OutboundPipeInstance ( )

Creates an outbound pipe instance.

winss::OutboundPipeInstance::OutboundPipeInstance ( const OutboundPipeInstance )
delete

No copy.

winss::OutboundPipeInstance::OutboundPipeInstance ( winss::OutboundPipeInstance &&  instance)

Create a new outbound pipe instance and move from another.

Parameters
instanceThe outbound pipe instance to move from.

Member Function Documentation

bool winss::OutboundPipeInstance::FinishWrite ( )

Complete writing data.

Returns
True if there is more data to send otherwise false.

References winss::PipeInstance::connected.

bool winss::OutboundPipeInstance::HasMessages ( ) const

Get if the instance has messages to send.

Returns
True if there is messages to send otherwise false.
bool winss::OutboundPipeInstance::IsWriting ( ) const

Get if the instance is currently writing data.

Returns
True if writing data to the client otherwise false.
OutboundPipeInstance& winss::OutboundPipeInstance::operator= ( const OutboundPipeInstance )
delete

No copy.

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

Move an outbound pipe instance to this instance.

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

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

bool winss::OutboundPipeInstance::Queue ( const std::vector< char > &  data)

Queue the data to be sent.

Parameters
dataThe data to queue.

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

void winss::OutboundPipeInstance::Read ( )
bool winss::OutboundPipeInstance::Write ( )

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