Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

Public Member Functions | Private Member Functions | Private Attributes
OutputDevice Class Reference

Writes data to a MAT-file. More...

#include <OutputDevice.hh>

Collaboration diagram for OutputDevice:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void close ()
 Closes the file.
 OutputDevice (const std::string &filename)
 Constructor.
template<typename charT >
void setDescription (const std::basic_string< charT > &descr)
 Sets the description of the file.
template<class WrapperClass >
void writeArray (const std::string &name, const WrapperClass &wrapper)
 Writes a matrix to the file.
 ~OutputDevice ()
 Destructor.

Private Member Functions

void setDescription ()

Private Attributes

bool descriptionIsSet_
bool fileIsOpen_
std::string fname_
std::ofstream fs_

Detailed Description

Writes data to a MAT-file.

This is the class for outputting matrices. The basic_OutputDevice performs all the operations on a file. You will probably use the specialized OutputDevice class.

See also:
OutputDevice

Definition at line 33 of file OutputDevice.hh.


Constructor & Destructor Documentation

OutputDevice::OutputDevice ( const std::string &  filename) [inline]

Constructor.

Parameters:
filenameA string representing the name of the output file. Please make sure that the name ends with the extension .mat! This constructor won't perform any control, in order to allow non-standard extensions, too.

Definition at line 46 of file OutputDevice.hh.

OutputDevice::~OutputDevice ( ) [inline]

Destructor.

Controls whether the file is open. If it is the case, the destructor closes the stream.

Definition at line 56 of file OutputDevice.hh.


Member Function Documentation

void OutputDevice::close ( ) [inline]

Closes the file.

Closes the stream. No other operation will be possible after this function is called.

Definition at line 66 of file OutputDevice.hh.

void OutputDevice::setDescription ( ) [inline, private]

Definition at line 112 of file OutputDevice.hh.

template<typename charT >
void OutputDevice::setDescription ( const std::basic_string< charT > &  descr)

Sets the description of the file.

Every MATfile begins with a short (116 byte) description. You can write a personalized description before you write the first matrix. If you do not write any description, the class will write a standard one containing information about date and time.

When called after the first write operation, this function doesn't do anything.

Parameters:
descrThe description. Only the first 116 byte are written. If the description is longer, it will be truncated; if it is shorter, spaces will be added.

Definition at line 125 of file OutputDevice.hh.

template<class WrapperClass >
void OutputDevice::writeArray ( const std::string &  name,
const WrapperClass &  wrapper 
) [inline]

Writes a matrix to the file.

This is the most important method, since it performs the write operations. For every matrix you want to write to the file, you will have to call this method giving the name of the matrix and the wrapper you have put it into.

Parameters:
nameThe name of the matrix as seen from Matlab.
wrapperThe wrapper containing the informations about the matrix.

Definition at line 97 of file OutputDevice.hh.

Here is the call graph for this function:


Member Data Documentation

Definition at line 106 of file OutputDevice.hh.

bool OutputDevice::fileIsOpen_ [private]

Definition at line 105 of file OutputDevice.hh.

std::string OutputDevice::fname_ [private]

Definition at line 103 of file OutputDevice.hh.

std::ofstream OutputDevice::fs_ [private]

Definition at line 104 of file OutputDevice.hh.


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

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)