Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JNET::JSocketStatus Class Reference

Auxiliary class for non-blocking socket I/O. More...

#include <JSocketStatus.hh>

Inheritance diagram for JNET::JSocketStatus:
JNET::JSocketBuffer< JElement_t > JNET::JSocketNonblockingReader JNET::JSocketNonblockingWriter JNET::JSocketInputChannel< JPrefix_t > JNET::JSocketOutputChannel< JPrefix_t >

Public Types

enum  JStatus_t { IO_RESET = -1 , IO_READY = 0 , IO_BUSY = +1 }
 

Public Member Functions

 JSocketStatus ()
 Default constructor.
 
JStatus_t getStatus () const
 Get status of I/O.
 
bool isReset () const
 Check reset status.
 
bool isBusy () const
 Check busy status.
 
bool isReady () const
 Check ready status.
 
int getCounter () const
 Get number of I/O attempts.
 
void reset ()
 Reset.
 

Protected Member Functions

void setStatus (const JStatus_t status)
 Set status of I/O.
 

Protected Attributes

JStatus_t status
 
int counter
 

Detailed Description

Auxiliary class for non-blocking socket I/O.

Definition at line 22 of file JSocketStatus.hh.

Member Enumeration Documentation

◆ JStatus_t

Enumerator
IO_RESET 
IO_READY 
IO_BUSY 

Definition at line 26 of file JSocketStatus.hh.

Constructor & Destructor Documentation

◆ JSocketStatus()

JNET::JSocketStatus::JSocketStatus ( )
inline

Default constructor.

Definition at line 32 of file JSocketStatus.hh.

32 :
34 counter(0)
35 {}

Member Function Documentation

◆ getStatus()

JStatus_t JNET::JSocketStatus::getStatus ( ) const
inline

Get status of I/O.

Returns
status

Definition at line 43 of file JSocketStatus.hh.

44 {
45 return status;
46 }

◆ isReset()

bool JNET::JSocketStatus::isReset ( ) const
inline

Check reset status.

Returns
true if reset; else false

Definition at line 54 of file JSocketStatus.hh.

55 {
56 return status == IO_RESET;
57 }

◆ isBusy()

bool JNET::JSocketStatus::isBusy ( ) const
inline

Check busy status.

Returns
true if busy; else false

Definition at line 65 of file JSocketStatus.hh.

66 {
67 return status == IO_BUSY;
68 }

◆ isReady()

bool JNET::JSocketStatus::isReady ( ) const
inline

Check ready status.

Returns
true if ready; else false

Definition at line 76 of file JSocketStatus.hh.

77 {
78 return status == IO_READY;
79 }

◆ getCounter()

int JNET::JSocketStatus::getCounter ( ) const
inline

Get number of I/O attempts.

Returns
number of I/O attempts

Definition at line 87 of file JSocketStatus.hh.

88 {
89 return counter;
90 }

◆ reset()

void JNET::JSocketStatus::reset ( )
inline

Reset.

Definition at line 96 of file JSocketStatus.hh.

97 {
99 counter = 0;
100 }

◆ setStatus()

void JNET::JSocketStatus::setStatus ( const JStatus_t status)
inlineprotected

Set status of I/O.

Parameters
statusstatus

Definition at line 109 of file JSocketStatus.hh.

110 {
111 this->status = status;
112 }

Member Data Documentation

◆ status

JStatus_t JNET::JSocketStatus::status
protected

Definition at line 115 of file JSocketStatus.hh.

◆ counter

int JNET::JSocketStatus::counter
protected

Definition at line 116 of file JSocketStatus.hh.


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