STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
List of all members | Public Member Functions | Public Types
stapl::stream< Stream > Struct Template Reference

A wrapper around a stream whose instances can be kept as data members of work functions. The wrapper allows work functions to access to the stream any location to which they may be sent via RMI invocation. More...

Public Member Functions

 stream (char const *const name)
 Construct the stream and attempt to associate it with the file specified. More...
 
 stream (char const *const name, std::ios_base::openmode mode)
 Construct the stream and attempt to associate it with the file specified using the specified mode. More...
 
 stream (stream const &other)
 Create a copy of the stream that does not take ownership of the underlying stream_wrapper_impl instance. More...
 
void open (char const *const name)
 Associate the stream with the named file. More...
 
void open (char const *const name, std::ios_base::openmode mode)
 Associate the stream with the named file. More...
 
void close (void)
 Close the file associated with the stream and disassociate the stream from it.
 
template<typename T >
void read (T &val)
 
void read (char_type *s, std::streamsize count)
 Perform an unformatted read of count characters from the stream and store the characters in the buffer s.
 
void getline (char_type *s, std::streamsize count, char_type delim=char_type('\n'))
 Reads characters from the stream until the delimiter delim is encountered or count characters are read and store the results in the buffer s.
 
template<typename T >
void write (T &val)
 
void write (char_type *s, std::streamsize count)
 Perform an unformatted write of count characters from the buffer s to the stream.
 
void endl (void)
 Method invoked when std::endl is written to the stream.
 
bool is_open (void) const
 Checks if the stream has an associated file.
 

Public Types

typedef Stream::char_type char_type
 

Detailed Description

template<typename Stream>
struct stapl::stream< Stream >

A wrapper around a stream whose instances can be kept as data members of work functions. The wrapper allows work functions to access to the stream any location to which they may be sent via RMI invocation.

Instances of this struct may be copied. All copies refer to the same underlying stream_wrapper_impl. Methods of this struct forward requests to the stream_wrapper_impl instance where they are processed.

Constructor & Destructor Documentation

◆ stream() [1/3]

template<typename Stream >
stapl::stream< Stream >::stream ( char const *const  name)

Construct the stream and attempt to associate it with the file specified.

Parameters
namefile with which the stream should be associated.

◆ stream() [2/3]

template<typename Stream >
stapl::stream< Stream >::stream ( char const *const  name,
std::ios_base::openmode  mode 
)

Construct the stream and attempt to associate it with the file specified using the specified mode.

Parameters
namefile with which the stream should be associated.
modeflags specifying the mode in which the file should be opened

◆ stream() [3/3]

template<typename Stream >
stapl::stream< Stream >::stream ( stream< Stream > const &  other)

Create a copy of the stream that does not take ownership of the underlying stream_wrapper_impl instance.

Parameters
otheroriginal stream instance to copy

Member Function Documentation

◆ open() [1/2]

template<typename Stream >
void stapl::stream< Stream >::open ( char const *const  name)

Associate the stream with the named file.

Parameters
namefile to be opened

◆ open() [2/2]

template<typename Stream >
void stapl::stream< Stream >::open ( char const *const  name,
std::ios_base::openmode  mode 
)

Associate the stream with the named file.

Parameters
namefile to be opened
modeflags specifying the mode in which the file should be opened

The documentation for this struct was generated from the following file: