PUMA Library Reference Manual
Puma::Pipe Class Reference

#include <Puma/Pipe.h>

+ Inheritance diagram for Puma::Pipe:

Description

Pipe between an input source and an output sink.

Warning
This class is not used and may disappear without notice.

Public Member Functions

 Pipe (int buffer_size)
 
 ~Pipe ()
 
int read (char *dest, int n)
 Read n bytes from the source into the given string buffer. More...
 
int write (const char *dest, int n)
 Write n bytes from the given buffer into the sink. More...
 
int free ()
 
bool full ()
 Check if the output sink is full. More...
 
void dump ()
 
- Public Member Functions inherited from Puma::Source
 Source ()
 Constructs an empty source object. More...
 
virtual ~Source ()
 Destroys the source object. More...
 
virtual int size ()
 Get the size of the source. More...
 
- Public Member Functions inherited from Puma::Sink
virtual ~Sink ()
 Destructor. More...
 

Constructor & Destructor Documentation

Puma::Pipe::Pipe ( int  buffer_size)
Puma::Pipe::~Pipe ( )

Member Function Documentation

void Puma::Pipe::dump ( )
int Puma::Pipe::free ( )
bool Puma::Pipe::full ( )
inlinevirtual

Check if the output sink is full.

Returns
This default implementation always returns false.

Reimplemented from Puma::Sink.

int Puma::Pipe::read ( char *  buffer,
int  n 
)
virtual

Read n bytes from the source into the given string buffer.

Parameters
bufferThe string used as buffer for the bytes read.
nThe number of bytes to read.
Returns
The number of bytes read, or -1 in case of errors.

Implements Puma::Source.

int Puma::Pipe::write ( const char *  buffer,
int  n 
)
virtual

Write n bytes from the given buffer into the sink.

Parameters
bufferThe bytes to write.
nThe number of bytes to write.
Returns
The number of bytes written.

Implements Puma::Sink.