w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Retro::RlinkPort Class Referenceabstract

FIXME_docs. More...

#include <RlinkPort.hpp>

Inheritance diagram for Retro::RlinkPort:
[legend]
Collaboration diagram for Retro::RlinkPort:
[legend]

Public Types

enum  stats {
  kStatNPortWrite = 0 , kStatNPortRead , kStatNPortTxByt , kStatNPortRxByt ,
  kStatNPortRawWrite , kStatNPortRawRead , kDimStat
}
 
typedef std::unique_ptr< RlinkPortport_uptr_t
 

Public Member Functions

 RlinkPort ()
 Default constructor.
 
virtual ~RlinkPort ()
 Destructor.
 
 RlinkPort (const RlinkPort &)=delete
 
RlinkPortoperator= (const RlinkPort &)=delete
 
virtual bool Open (const std::string &url, RerrMsg &emsg)=0
 
virtual void Close ()
 FIXME_docs.
 
virtual int Read (uint8_t *buf, size_t size, const Rtime &timeout, RerrMsg &emsg)
 FIXME_docs.
 
virtual int Write (const uint8_t *buf, size_t size, RerrMsg &emsg)
 FIXME_docs.
 
virtual bool PollRead (const Rtime &timeout)
 FIXME_docs.
 
int RawRead (uint8_t *buf, size_t size, bool exactsize, const Rtime &timeout, Rtime &tused, RerrMsg &emsg)
 FIXME_docs.
 
int RawWrite (const uint8_t *buf, size_t size, RerrMsg &emsg)
 FIXME_docs.
 
bool IsOpen () const
 FIXME_docs.
 
const RparseUrlUrl () const
 FIXME_docs.
 
bool XonEnable () const
 FIXME_docs.
 
int FdRead () const
 FIXME_docs.
 
int FdWrite () const
 FIXME_docs.
 
void SetLogFile (const std::shared_ptr< RlogFile > &splog)
 FIXME_docs.
 
void SetTraceLevel (uint32_t level)
 FIXME_docs.
 
uint32_t TraceLevel () const
 FIXME_docs.
 
RstatsStats ()
 FIXME_docs.
 
virtual void Dump (std::ostream &os, int ind=0, const char *text=0, int detail=0) const
 FIXME_docs.
 

Static Public Attributes

static const int kEof = 0
 return code: end-of-file
 
static const int kTout = -1
 return code: time out
 
static const int kErr = -2
 return code: IO error
 

Protected Member Functions

void CloseFd (int &fd)
 FIXME_docs.
 

Protected Attributes

bool fIsOpen
 is open flag
 
RparseUrl fUrl
 parsed url
 
bool fXon
 xon attribute set
 
int fFdRead
 fd for read
 
int fFdWrite
 fd for write
 
std::shared_ptr< RlogFilefspLog
 log file ptr
 
uint32_t fTraceLevel
 trace level
 
Rtime fTsLastRead
 time stamp last write
 
Rtime fTsLastWrite
 time stamp last write
 
Rstats fStats
 statistics
 

Detailed Description

FIXME_docs.

Definition at line 45 of file RlinkPort.hpp.

Member Typedef Documentation

◆ port_uptr_t

typedef std::unique_ptr<RlinkPort> Retro::RlinkPort::port_uptr_t

Definition at line 47 of file RlinkPort.hpp.

Member Enumeration Documentation

◆ stats

Enumerator
kStatNPortWrite 
kStatNPortRead 
kStatNPortTxByt 
kStatNPortRxByt 
kStatNPortRawWrite 
kStatNPortRawRead 
kDimStat 

Definition at line 91 of file RlinkPort.hpp.

Constructor & Destructor Documentation

◆ RlinkPort() [1/2]

Retro::RlinkPort::RlinkPort ( )

◆ ~RlinkPort()

Retro::RlinkPort::~RlinkPort ( )
virtual

Destructor.

Definition at line 90 of file RlinkPort.cpp.

References Close(), and IsOpen().

◆ RlinkPort() [2/2]

Retro::RlinkPort::RlinkPort ( const RlinkPort )
delete

Member Function Documentation

◆ operator=()

RlinkPort & Retro::RlinkPort::operator= ( const RlinkPort )
delete

◆ Open()

virtual bool Retro::RlinkPort::Open ( const std::string &  url,
RerrMsg emsg 
)
pure virtual

◆ Close()

void Retro::RlinkPort::Close ( )
virtual

◆ Read()

int Retro::RlinkPort::Read ( uint8_t *  buf,
size_t  size,
const Rtime timeout,
RerrMsg emsg 
)
virtual

◆ Write()

◆ PollRead()

bool Retro::RlinkPort::PollRead ( const Rtime timeout)
virtual

FIXME_docs.

Definition at line 218 of file RlinkPort.cpp.

References fFdRead, Retro::Rtime::IsNegative(), IsOpen(), and Retro::Rtime::ToMSec().

Referenced by Read().

◆ RawRead()

int Retro::RlinkPort::RawRead ( uint8_t *  buf,
size_t  size,
bool  exactsize,
const Rtime timeout,
Rtime tused,
RerrMsg emsg 
)

◆ RawWrite()

int Retro::RlinkPort::RawWrite ( const uint8_t *  buf,
size_t  size,
RerrMsg emsg 
)

FIXME_docs.

Definition at line 279 of file RlinkPort.cpp.

References fStats, Retro::Rstats::Inc(), kStatNPortRawWrite, and Write().

Referenced by Retro::RtclRlinkPort::DoRawWblk().

◆ IsOpen()

◆ Url()

const Retro::RparseUrl & Retro::RlinkPort::Url ( ) const
inline

FIXME_docs.

Definition at line 35 of file RlinkPort.ipp.

References fUrl.

Referenced by Retro::RtclRlinkConnect::M_open().

◆ XonEnable()

bool Retro::RlinkPort::XonEnable ( ) const
inline

FIXME_docs.

Definition at line 43 of file RlinkPort.ipp.

References fXon.

◆ FdRead()

int Retro::RlinkPort::FdRead ( ) const
inline

FIXME_docs.

Definition at line 51 of file RlinkPort.ipp.

References fFdRead.

◆ FdWrite()

int Retro::RlinkPort::FdWrite ( ) const
inline

FIXME_docs.

Definition at line 59 of file RlinkPort.ipp.

References fFdWrite.

◆ SetLogFile()

void Retro::RlinkPort::SetLogFile ( const std::shared_ptr< RlogFile > &  splog)
inline

FIXME_docs.

Definition at line 67 of file RlinkPort.ipp.

References fspLog.

Referenced by Retro::RlinkConnect::Open().

◆ SetTraceLevel()

void Retro::RlinkPort::SetTraceLevel ( uint32_t  level)
inline

◆ TraceLevel()

uint32_t Retro::RlinkPort::TraceLevel ( ) const
inline

FIXME_docs.

Definition at line 85 of file RlinkPort.ipp.

References fTraceLevel.

Referenced by Retro::RtclRlinkPort::SetupGetSet().

◆ Stats()

Rstats & Retro::RlinkPort::Stats ( )
inline

FIXME_docs.

Definition at line 93 of file RlinkPort.ipp.

References fStats.

◆ Dump()

void Retro::RlinkPort::Dump ( std::ostream &  os,
int  ind = 0,
const char *  text = 0,
int  detail = 0 
) const
virtual

◆ CloseFd()

void Retro::RlinkPort::CloseFd ( int &  fd)
protected

FIXME_docs.

Definition at line 310 of file RlinkPort.cpp.

Referenced by Retro::RlinkPortCuff::Cleanup(), and Close().

Member Data Documentation

◆ kEof

const int Retro::RlinkPort::kEof = 0
static

return code: end-of-file

Definition at line 86 of file RlinkPort.hpp.

Referenced by Retro::RtclRlinkPort::DoRawRblk(), Retro::RtclRlinkPort::DoRawRead(), and Retro::RlinkPacketBufRcv::ReadData().

◆ kTout

const int Retro::RlinkPort::kTout = -1
static

◆ kErr

const int Retro::RlinkPort::kErr = -2
static

return code: IO error

Definition at line 88 of file RlinkPort.hpp.

Referenced by Read(), Retro::RlinkConnect::WaitAttn(), and Write().

◆ fIsOpen

bool Retro::RlinkPort::fIsOpen
protected

◆ fUrl

RparseUrl Retro::RlinkPort::fUrl
protected

◆ fXon

bool Retro::RlinkPort::fXon
protected

xon attribute set

Definition at line 107 of file RlinkPort.hpp.

Referenced by Dump(), Retro::RlinkPortFifo::Open(), Retro::RlinkPortTerm::Open(), and XonEnable().

◆ fFdRead

int Retro::RlinkPort::fFdRead
protected

◆ fFdWrite

◆ fspLog

std::shared_ptr<RlogFile> Retro::RlinkPort::fspLog
protected

log file ptr

Definition at line 110 of file RlinkPort.hpp.

Referenced by Dump(), Read(), SetLogFile(), and Write().

◆ fTraceLevel

uint32_t Retro::RlinkPort::fTraceLevel
protected

trace level

Definition at line 111 of file RlinkPort.hpp.

Referenced by Dump(), Read(), SetTraceLevel(), TraceLevel(), and Write().

◆ fTsLastRead

Rtime Retro::RlinkPort::fTsLastRead
protected

time stamp last write

Definition at line 112 of file RlinkPort.hpp.

Referenced by Dump(), Read(), and Write().

◆ fTsLastWrite

Rtime Retro::RlinkPort::fTsLastWrite
protected

time stamp last write

Definition at line 113 of file RlinkPort.hpp.

Referenced by Dump(), Read(), and Write().

◆ fStats


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