Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

BinaryFileAdaptor< T > Class Template Reference
[Operating system support]

Helper class for data conversion. More...

#include <file.h>

List of all members.

Public Member Functions

Constructors and destructor
 BinaryFileAdaptor () throw ()
 Default constructor.
 BinaryFileAdaptor (const T &data) throw ()
 Detailed constructor.
Accessors
void setData (const T &data) throw ()
 Sets the member data to the desired value.
const T & getData () const throw ()
 Returns a const reference to the data stored in the adaptor.
T & getData () throw ()
 Returns a mutable reference to the data stored in the adaptor.

Protected Attributes

data_


Detailed Description

template<typename T>
class BinaryFileAdaptor< T >

Helper class for data conversion.

BinaryFileAdaptors are used to read and write binary data from and to streams. This is done by reading the member data as a byte stream through an explicit cast and utilizing the stream read() and write() functions.

Caveat: This concept relies on the C++ memory layout and thus is highly non-portable!


Member Function Documentation

template<typename T>
void BinaryFileAdaptor< T >::setData const T &  data  )  throw ()
 

Sets the member data to the desired value.

Parameters:
data data of type T