SAGA C++ API 1.6
saga::stream::stream Class Reference

This is the ob ject that encapsulates all client stream ob jects. More...

#include <stream.hpp>

Inheritance diagram for saga::stream::stream:

List of all members.

Public Member Functions

 stream (session const &s, saga::url url=saga::url())
 Initializes a client client stream, for later connection to an server.
 stream (saga::url url)
 Initializes a client client stream, for later connection to an server.
 stream ()
 Initializes a client client stream, for later connection to an server.
 stream (saga::object const &o)
 Initializes a client client stream, for later connection to an server.
 ~stream (void)
 Destroys an stream object.
streamoperator= (saga::object const &o)
 Brief description starts here.
saga::url get_url () const
 Get the URL used for creating this stream.
saga::context get_context () const
 Return remote authorization info.
void connect (double timeout=-1.0)
 Establishes a connection to the target defined during the construction of the stream.
saga::stream::activity wait (saga::stream::activity what, double timeout=-1.0)
 Check if stream is ready for reading/writing, or if it has entered an error state.
void close (double timeout=0.0)
 Closes an active connection.
saga::ssize_t read (saga::mutable_buffer buffer, saga::ssize_t length=0)
 Read a raw buffer from stream.
saga::ssize_t write (saga::const_buffer buffer, saga::ssize_t length=0)
 Write a raw buffer to stream.

Static Public Member Functions

static stream create (session const &s, saga::url name=saga::url())
 Factory function resembling stream(session, url) constructor.
static stream create (saga::url name=saga::url())
 Factory function resembling stream(url) constructor.
template<typename Tag >
static saga::task create (saga::url name=saga::url())

Detailed Description

This is the ob ject that encapsulates all client stream ob jects.

Definition at line 121 of file packages/stream/stream.hpp.


Constructor & Destructor Documentation

saga::stream::stream::stream ( session const &  s,
saga::url  url = saga::url() 
) [explicit]

Initializes a client client stream, for later connection to an server.

Definition at line 101 of file stream.cpp.

saga::stream::stream::stream ( saga::url  url) [explicit]

Initializes a client client stream, for later connection to an server.

Definition at line 109 of file stream.cpp.

saga::stream::stream::stream ( void  )

Initializes a client client stream, for later connection to an server.

Definition at line 177 of file stream.cpp.

saga::stream::stream::stream ( saga::object const &  o) [explicit]

Initializes a client client stream, for later connection to an server.

Definition at line 189 of file stream.cpp.

References saga::BadParameter, saga::object::get_type(), and saga::object::Stream.

saga::stream::stream::~stream ( void  )

Destroys an stream object.

Definition at line 184 of file stream.cpp.


Member Function Documentation

static stream saga::stream::stream::create ( session const &  s,
saga::url  name = saga::url() 
) [inline, static]

Factory function resembling stream(session, url) constructor.

Definition at line 207 of file packages/stream/stream.hpp.

static stream saga::stream::stream::create ( saga::url  name = saga::url()) [inline, static]

Factory function resembling stream(url) constructor.

Definition at line 217 of file packages/stream/stream.hpp.

template<typename Tag >
static saga::task saga::stream::stream::create ( saga::url  name = saga::url()) [inline, static]

Definition at line 222 of file packages/stream/stream.hpp.

stream & saga::stream::stream::operator= ( saga::object const &  o)

Brief description starts here.

Definition at line 198 of file stream.cpp.

saga::url saga::stream::stream::get_url ( ) const [inline]

Get the URL used for creating this stream.

Returns:
String containing the URL of the connection.

Definition at line 239 of file packages/stream/stream.hpp.

References saga::task::get_result().

saga::context saga::stream::stream::get_context ( ) const [inline]

Return remote authorization info.

Returns:
Remote context

Definition at line 252 of file packages/stream/stream.hpp.

References saga::task::get_result().

void saga::stream::stream::connect ( double  timeout = -1.0) [inline]

Establishes a connection to the target defined during the construction of the stream.

Definition at line 265 of file packages/stream/stream.hpp.

References saga::task::get_result().

saga::stream::activity saga::stream::stream::wait ( saga::stream::activity  what,
double  timeout = -1.0 
) [inline]

Check if stream is ready for reading/writing, or if it has entered an error state.

Parameters:
whatParameter list of activity types to wait for
timeoutNumber of seconds to wait
Returns:
activity type causing the call to return

Definition at line 282 of file packages/stream/stream.hpp.

References saga::task::get_result().

void saga::stream::stream::close ( double  timeout = 0.0) [inline]

Closes an active connection.

Definition at line 294 of file packages/stream/stream.hpp.

References saga::task::get_result().

saga::ssize_t saga::stream::stream::read ( saga::mutable_buffer  buffer,
saga::ssize_t  length = 0 
) [inline]

Read a raw buffer from stream.

Parameters:
lengthMaximum number of bytes that can be copied in to the buffer.
bufferEmpty buffer passed in to get filled
Returns:
Number of bytes read, if successful. (0 is also valid)

Definition at line 309 of file packages/stream/stream.hpp.

References saga::task::get_result().

saga::ssize_t saga::stream::stream::write ( saga::const_buffer  buffer,
saga::ssize_t  length = 0 
) [inline]

Write a raw buffer to stream.

Parameters:
lengthNumber of bytes of data in the buffer
bufferRaw array containing data that will be sent out via socket
Returns:
Bytes written if successful

Definition at line 324 of file packages/stream/stream.hpp.

References saga::task::get_result().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines