xl7::io::AutoClose Class Reference

#include <AutoClose.h>

List of all members.

Public Member Functions

 AutoClose (void)
 AutoClose (IRom *rom)
 AutoClose (AutoClose &rhs)
AutoCloseoperator= (AutoClose &rhs)
 ~AutoClose (void)
const IRomget () const
const IRomoperator-> () const
const IRomoperator* () const
IRomget ()
IRomoperator-> ()
IRomoperator* ()
void reset (IRom *rom)
void destruct ()
void decontrol ()
void swap (AutoClose &rhs)

Detailed Description

An object wrapper that closes the (readonly) file on destruction. It additionally holds a flag specifying whether the wrapper is responsible for the file to close. Only one wrapper should be responsible for the closing operation. If a wrapper is created through the copy constructor or the copy assignment operator, the new wrapper becomes responsible (if the source wrapper was responsible at all). This class works very similar to std::auto_ptr.


Constructor & Destructor Documentation

xl7::io::AutoClose::AutoClose ( void   )  [inline]

Default constructor.

xl7::io::AutoClose::AutoClose ( IRom rom  )  [inline, explicit]

Explicit constructor.

xl7::io::AutoClose::AutoClose ( AutoClose rhs  )  [inline]

Copy constructor.

xl7::io::AutoClose::~AutoClose ( void   )  [inline]

Destructor.


Member Function Documentation

void xl7::io::AutoClose::decontrol (  )  [inline]

Forces the wrapper to lose responsibility for the closing operation.

void xl7::io::AutoClose::destruct (  )  [inline]

Closes the file (if responsible).

IRom* xl7::io::AutoClose::get (  )  [inline]

Returns the pointer to the file.

const IRom* xl7::io::AutoClose::get (  )  const [inline]

Returns the pointer to the file.

IRom& xl7::io::AutoClose::operator* (  )  [inline]

Returns the file.

const IRom& xl7::io::AutoClose::operator* (  )  const [inline]

Returns the file.

IRom* xl7::io::AutoClose::operator-> (  )  [inline]

Returns the pointer to the file.

const IRom* xl7::io::AutoClose::operator-> (  )  const [inline]

Returns the pointer to the file.

AutoClose& xl7::io::AutoClose::operator= ( AutoClose rhs  )  [inline]

Copy assignment operator.

void xl7::io::AutoClose::reset ( IRom rom  )  [inline]

Replaces the file by another one. The current file will be closed if the wrapper is responsible. The wrapper will be responsible for the newly set file.

void xl7::io::AutoClose::swap ( AutoClose rhs  )  [inline]

Swaps the contents of two wrappers.


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

Generated on Tue Dec 1 13:21:19 2009 for flange77: Cyber E-Razor rockt die Galaxis by  doxygen 1.6.1