Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

GenericException.h File Reference

#include <stlib/Object.h>

Include dependency graph for GenericException.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Core

Defines

#define MAXSTACKSIZE   64
#define _ensure(guardedBlock, ensureBlock)
 This is stand-alone implementation of finally construct as seen in Java.


Define Documentation

#define _ensure guardedBlock,
ensureBlock   ) 
 

Value:

GenericException *_catched_exception = nil; \
    try { guardedBlock ; } \
    catch (GenericException *ex) { _catched_exception = ex; } \
    ensureBlock ; \
    if (_catched_exception != nil) _catched_exception->pass()
This is stand-alone implementation of finally construct as seen in Java.

If you need to do something whenever exception raised or not, you may want to use this macro. The only drawback is syntax.
Example:

	Stream *stream = whatever; // Open stream that needs explicit close.
	_ensure (
	    // Part that operates the stream
	    do_something(stream)
	    ,
	    // Part that must be evaluated whenever an execetion is raised or not
	    stream->close()
	);
    

Definition at line 119 of file GenericException.h.

Referenced by Tools::Filename::contentOfEntireFile(), Core::ByteCharacterEncoder::loadFrom(), Tools::Filename::privateCopy(), and Tools::ConfigurationReader::readConfiguration().

#define MAXSTACKSIZE   64
 

Definition at line 29 of file GenericException.h.

Referenced by Core::GenericException::getExecutionStack().


Generated on Mon Nov 27 09:49:14 2006 for Smalltalk like C++ Class Library by  doxygen 1.4.2