class Stream

An abstract stream class capable of reading and writing. More...

Contains pure virtuals
Full nameTelEngine::Stream
Definition#include <yateclass.h>
Inherited byFile, Socket
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Protected Methods

Protected Members


Detailed Description

Base class for encapsulating system dependent stream capable objects

 ~Stream ()

~Stream

[virtual]

Destructor, terminates the stream

inline int  error ()

error

[const]

Get the error code of the last operation on this stream

Returns: Error code generated by the last operation on this stream

bool  terminate ()

terminate

[pure virtual]

Closes the stream

Returns: True if the stream was (already) closed, false if an error occured

bool  canRetry ()

canRetry

[const virtual]

Check if the last error code indicates a retryable condition

Returns: True if error was temporary and operation should be retried

bool  valid ()

valid

[const pure virtual]

Check if this stream is valid

Returns: True if the stream is valid, false if it's invalid or closed

bool  setBlocking (bool block = true)

setBlocking

[virtual]

Set the blocking or non-blocking operation mode of the stream

Parameters:
blockTrue if I/O operations should block, false for non-blocking

Returns: True if operation was successfull, false if an error occured

int  writeData (const void* buffer, int length)

writeData

[pure virtual]

Write data to a connected stream

Parameters:
bufferBuffer for data transfer
lengthLength of the buffer

Returns: Number of bytes transferred, negative if an error occurred

int  writeData (const char* str)

writeData

Write a C string to a connected stream

Parameters:
strString to send over the stream

Returns: Number of bytes transferred, negative if an error occurred

inline int  writeData (const String& str)

writeData

Write a String to a connected stream

Parameters:
strString to send over the stream

Returns: Number of bytes transferred, negative if an error occurred

inline int  writeData (const DataBlock& buf)

writeData

Write a Data block to a connected stream

Parameters:
bufDataBlock to send over the stream

Returns: Number of bytes transferred, negative if an error occurred

int  readData (void* buffer, int length)

readData

[pure virtual]

Receive data from a connected stream

Parameters:
bufferBuffer for data transfer
lengthLength of the buffer

Returns: Number of bytes transferred, negative if an error occurred

bool  allocPipe (Stream*& reader, Stream*& writer)

allocPipe

[static]

Allocate a new pair of unidirectionally pipe connected streams

Parameters:
readerReference of a pointer receiving the newly allocated reading side of the pipe
writerReference of a pointer receiving the newly allocated writing side of the pipe

Returns: True is the stream pipe was created successfully

bool  allocPair (Stream*& str1, Stream*& str2)

allocPair

[static]

Allocate a new pair of bidirectionally connected streams

Parameters:
str1Reference of a pointer receiving the newly allocated 1st end of the pair
str2Reference of a pointer receiving the newly allocated 2nd end of the pair

Returns: True is the stream pair was created successfully

bool  supportsPipes ()

supportsPipes

[static]

Check if operating system supports unidirectional stream pairs

Returns: True if unidirectional pipes can be created

bool  supportsPairs ()

supportsPairs

[static]

Check if operating system supports bidirectional stream pairs

Returns: True if bidirectional pairs can be created

inline  Stream ()

Stream

[protected]

Default constructor

inline void  clearError ()

clearError

[protected]

Clear the last error code

int m_error

m_error

[protected]


Generated by: root on dragoshel on Sat Apr 14 01:50:50 2007, using kdoc 2.0a54.