YARP  2.3.70.2
Yet Another Robot Platform
yarp::os::MpiBcastStream Class Reference

Implements communication via MPI broadcast. More...

#include <mpi_carrier/include/yarp/os/MpiBcastStream.h>

+ Inheritance diagram for yarp::os::MpiBcastStream:

Public Member Functions

 MpiBcastStream (ConstString name, MpiComm *comm)
 
 ~MpiBcastStream ()
 
ssize_t read (const Bytes &b) override
 Read a block of data from the stream. More...
 
void write (const Bytes &b) override
 Write a block of bytes to the stream. More...
 
void startJoin ()
 
void post ()
 
void close () override
 Terminate the stream. More...
 
void execCmd (int cmd)
 
- Public Member Functions inherited from yarp::os::MpiStream
 MpiStream (ConstString name, MpiComm *comm)
 
virtual ~MpiStream ()
 
virtual bool isOk () override
 Check if the stream is ok or in an error state. More...
 
virtual void interrupt () override
 Interrupt the stream. More...
 
virtual InputStreamgetInputStream () override
 Get an InputStream to read from. More...
 
virtual OutputStreamgetOutputStream () override
 Get an OutputStream to write to. More...
 
virtual const yarp::os::ContactgetLocalAddress () override
 Get the address of the local side of the stream. More...
 
virtual const yarp::os::ContactgetRemoteAddress () override
 Get the address of the remote side of the stream. More...
 
void resetBuffer ()
 
virtual void reset () override
 Reset the stream. More...
 
virtual void beginPacket () override
 Mark the beginning of a logical packet. More...
 
virtual void endPacket () override
 Mark the end of a logical packet (see beginPacket). More...
 
- Public Member Functions inherited from yarp::os::TwoWayStream
virtual ~TwoWayStream ()
 Destructor. More...
 
- 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_SSIZE_T read (const Bytes &b, size_t offset, YARP_SSIZE_T len)
 Read a block of data from the stream. More...
 
virtual YARP_SSIZE_T partialRead (const yarp::os::Bytes &b)
 Like read, but solicit partial responses. More...
 
virtual bool setReadTimeout (double timeout)
 Set activity timeout. More...
 
ConstString readLine (int terminal='\n', bool *success=YARP_NULLPTR)
 Read a block of text terminated with a specific marker (or EOF). More...
 
YARP_SSIZE_T readFull (const Bytes &b)
 Keep reading until buffer is full. More...
 
YARP_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...
 
- Public Member Functions inherited from yarp::os::OutputStream
virtual ~OutputStream ()
 Destructor. More...
 
virtual void write (char ch)
 Write a single byte to the stream. More...
 
virtual void write (const Bytes &b, int offset, int len)
 Write a block of bytes to the stream. More...
 
virtual void flush ()
 Make sure all pending write operations are finished. More...
 
virtual void writeLine (const char *data, int len)
 Write some text followed by a line feed. More...
 
virtual bool setWriteTimeout (double timeout)
 Set activity timeout. More...
 
virtual bool setTypeOfService (int tos)
 
virtual int getTypeOfService ()
 

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...
 
- Protected Attributes inherited from yarp::os::MpiStream
int readAvail
 
int readAt
 
char * readBuffer
 
bool terminate
 
ConstString name
 
yarp::os::MpiCommcomm
 
yarp::os::Contact local
 
yarp::os::Contact remote
 

Detailed Description

Implements communication via MPI broadcast.

Definition at line 27 of file MpiBcastStream.h.

Constructor & Destructor Documentation

◆ MpiBcastStream()

yarp::os::MpiBcastStream::MpiBcastStream ( ConstString  name,
MpiComm comm 
)
inline

Definition at line 30 of file MpiBcastStream.h.

◆ ~MpiBcastStream()

yarp::os::MpiBcastStream::~MpiBcastStream ( )
inline

Definition at line 31 of file MpiBcastStream.h.

Member Function Documentation

◆ close()

void yarp::os::MpiBcastStream::close ( )
inlineoverridevirtual

Terminate the stream.

Implements yarp::os::MpiStream.

Definition at line 46 of file MpiBcastStream.h.

◆ execCmd()

void MpiBcastStream::execCmd ( int  cmd)

Definition at line 23 of file MpiBcastStream.cpp.

◆ post()

void yarp::os::MpiBcastStream::post ( )
inline

Definition at line 43 of file MpiBcastStream.h.

◆ read()

ssize_t MpiBcastStream::read ( const Bytes b)
overridevirtual

Read a block of data from the stream.

Should block and wait for data.

Parameters
bthe block of data to read to
Returns
the number of bytes read, or -1 upon error

Implements yarp::os::MpiStream.

Definition at line 52 of file MpiBcastStream.cpp.

◆ startJoin()

void MpiBcastStream::startJoin ( )

Definition at line 13 of file MpiBcastStream.cpp.

◆ write()

void MpiBcastStream::write ( const Bytes b)
overridevirtual

Write a block of bytes to the stream.

Parameters
bthe bytes to write

Implements yarp::os::MpiStream.

Definition at line 105 of file MpiBcastStream.cpp.


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