Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

context::ContException Class Reference

An Exception that remembers the context it was thrown from. More...

#include <context.h>

Collaboration diagram for context::ContException:

Collaboration graph
[legend]
List of all members.

Public Methods

 ContException ()
 Constructs the ConstException, using the current ContextStack.

 ContException (const string &argmsg)
 Constructs the ConstExceptions, using the current ContextStack.

void print ()
 Prints the message, its (partial) context, and the current context (which should be a subset of the context it was thrown from).


Detailed Description

An Exception that remembers the context it was thrown from.


Constructor & Destructor Documentation

ContException::ContException  
 

Constructs the ConstException, using the current ContextStack.

00166    :
00167 thrContext(ContextStack::getInstanceOf().makeSVector())
00168 {}

ContException::ContException const string &    argmsg
 

Constructs the ConstExceptions, using the current ContextStack.

Parameters:
argmsg  The message this object should represent

00175    :
00176 thrContext(ContextStack::getInstanceOf().makeSVector()), msg(argmsg)
00177 {}


Member Function Documentation

void ContException::print  
 

Prints the message, its (partial) context, and the current context (which should be a subset of the context it was thrown from).

00184 {
00185    auto_ptr <vector <string> > 
00186       prContext(ContextStack::getInstanceOf().makeSVector());
00187    // Delay setting context until the string vector is produced, since
00188    // ConstException::print does not belong in the output
00189    Context cx("ContException::print");
00190    cout << msg << "\n";
00191    cout << "Thrown in context:\n";
00192    Context::print(*thrContext, prContext->size(), thrContext->size());
00193    cout << "Printed in context:\n";
00194    Context::print(*prContext);
00195 }


The documentation for this class was generated from the following files:
Generated on Mon Apr 7 19:44:12 2003 for DuTree by doxygen1.2.18