YARP
Yet Another Robot Platform
yarp::wire_rep_utils::WireTwiddlerReader Class Reference

#include <yarp/wire_rep_utils/WireTwiddler.h>

+ Inheritance diagram for yarp::wire_rep_utils::WireTwiddlerReader:

Public Member Functions

 WireTwiddlerReader (yarp::os::InputStream &is, WireTwiddler &twiddler)
 
void reset ()
 
virtual ~WireTwiddlerReader ()
 
yarp::conf::ssize_t read (yarp::os::Bytes &b) override
 Read a block of data from the stream. More...
 
void close () override
 Terminate the stream. More...
 
bool isOk () const override
 Check if the stream is ok or in an error state. More...
 
yarp::conf::ssize_t readMapped (yarp::os::InputStream &is, yarp::os::Bytes &b, const WireTwiddlerGap &gap)
 
void compute (const WireTwiddlerGap &gap)
 
- Public Member Functions inherited from yarp::os::InputStream
 InputStream ()
 Constructor. More...
 
virtual ~InputStream ()
 Destructor. More...
 
virtual void check ()
 Perform maintenance actions, if needed. More...
 
virtual int read ()
 Read and return a single byte. More...
 
virtual yarp::conf::ssize_t read (Bytes &b, size_t offset, yarp::conf::ssize_t len)
 Read a block of data from the stream. More...
 
virtual yarp::conf::ssize_t partialRead (yarp::os::Bytes &b)
 Like read, but solicit partial responses. More...
 
virtual void interrupt ()
 Interrupt the stream. More...
 
virtual bool setReadTimeout (double timeout)
 Set activity timeout. More...
 
std::string readLine (const char terminal='\n', bool *success=nullptr)
 Read a block of text terminated with a specific marker (or EOF). More...
 
yarp::conf::ssize_t readFull (Bytes &b)
 Keep reading until buffer is full. More...
 
yarp::conf::ssize_t readDiscard (size_t len)
 Read and discard a fixed number of bytes. More...
 
virtual bool setReadEnvelopeCallback (readEnvelopeCallbackType callback, void *data)
 Install a callback that the InputStream will have to call when the envelope is read from a message in carriers that cannot be escaped. More...
 

Additional Inherited Members

- Public Types inherited from yarp::os::InputStream
typedef void(* readEnvelopeCallbackType) (void *, const yarp::os::Bytes &envelope)
 Callback type for setting the envelope from a message in carriers that cannot be escaped. More...
 

Detailed Description

Definition at line 141 of file WireTwiddler.h.

Constructor & Destructor Documentation

◆ WireTwiddlerReader()

yarp::wire_rep_utils::WireTwiddlerReader::WireTwiddlerReader ( yarp::os::InputStream is,
WireTwiddler twiddler 
)
inline

Definition at line 161 of file WireTwiddler.h.

◆ ~WireTwiddlerReader()

virtual yarp::wire_rep_utils::WireTwiddlerReader::~WireTwiddlerReader ( )
inlinevirtual

Definition at line 181 of file WireTwiddler.h.

Member Function Documentation

◆ close()

void yarp::wire_rep_utils::WireTwiddlerReader::close ( )
inlineoverridevirtual

Terminate the stream.

Implements yarp::os::InputStream.

Definition at line 186 of file WireTwiddler.h.

◆ compute()

void WireTwiddlerReader::compute ( const WireTwiddlerGap gap)

Definition at line 425 of file WireTwiddler.cpp.

◆ isOk()

bool yarp::wire_rep_utils::WireTwiddlerReader::isOk ( ) const
inlineoverridevirtual

Check if the stream is ok or in an error state.

Returns
true iff the stream is ok

Implements yarp::os::InputStream.

Definition at line 188 of file WireTwiddler.h.

◆ read()

yarp::conf::ssize_t WireTwiddlerReader::read ( yarp::os::Bytes b)
overridevirtual

Read a block of data from the stream.

Should block and wait for data.

Parameters
b[out]the block of data to read to
Returns
the number of bytes read, or -1 upon error

Implements yarp::os::InputStream.

Definition at line 506 of file WireTwiddler.cpp.

◆ readMapped()

yarp::conf::ssize_t WireTwiddlerReader::readMapped ( yarp::os::InputStream is,
yarp::os::Bytes b,
const WireTwiddlerGap gap 
)

Definition at line 986 of file WireTwiddler.cpp.

◆ reset()

void yarp::wire_rep_utils::WireTwiddlerReader::reset ( )
inline

Definition at line 167 of file WireTwiddler.h.


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