EDoc::Exception Class Reference

#include <include/EDoc/Exception.h>

Inheritance diagram for EDoc::Exception:

EDoc::DictionarySpecific

Detailed Description

Represents a throw statement in C++ code.

This exception object is generated for any code that contains a throw statement. Rethrows are also represented with this class using a type with name "...".

All throw statements that generate a new exception are also called "Originating Exceptions". Originating exceptions are the source of propogating exceptions, this terminology is important to remember when reading code or documentation about EDoc.

An exception instance will include primary data about the type in a TypeLoc instance called type. This stores a reference to the type of the exception being thrown ("..." type for rethrow exceptions) and location information indicating at what line and in which source file this throw statement can be found.

Definition at line 51 of file Exception.h.

Public Member Functions

 Exception (Dictionary *dict_in=NULL)
 See CodeBlock::CodeBlock(Dictionary* dict_in=NULL).
 Exception (const Exception &right)
 See CodeBlock::CodeBlock(const CodeBlock& right).
 Exception (const Exception &right, Dictionary &dict_in)
 See CodeBlock::CodeBlock(const CodeBlock& right, Dictionary& dict_in).
Exceptionoperator= (const Exception &right)
 See CodeBlock::operator=().
void Read (PersistenceIFace &file, IndexedDictionary &idict)
 See CodeBlock::Read().
void Write (PersistenceIFace &file) const
 See CodeBlock::Write().
virtual size_t ReplaceReferences (PStack &stack, void *remove, void *replace)
 See DictionarySpecific::ReplaceReferences().
virtual std::ostream & Print (std::ostream &out, std::string prefix="") const
 See DictionarySpecific::Print().
virtual void Validate (PStack &stack, const Dictionary &dict_in) const
 See DictionarySpecific::Validate().
bool operator== (const Exception &right) const
 Equivilance operator (Works across dictionaries).
std::string ToString (std::string prefix="") const
 Returns a string representing the current object in a user readable manner.

Data Fields

TypeLoc type
 Stores the type and location in the source from which it is thrown.
bool visible
 True if this exception is visible to the user or false if this exception will never be shown to the user.
bool auto_throw_spec
 True if this exception was created automatically by EDoc++ as a throw spec exception.
Functionfunction
 Function from which exception originates.

Protected Attributes

Dictionarydict
 A reference to the dictionary this object belongs to.

Friends

class PropogatingException


Constructor & Destructor Documentation

EDoc::Exception::Exception ( EDoc::Dictionary dict_in = NULL  ) 

See CodeBlock::CodeBlock(Dictionary* dict_in=NULL).

Note:
EDoc++ data included.

Definition at line 32 of file Exception.cpp.

EDoc::Exception::Exception ( const Exception right  ) 

See CodeBlock::CodeBlock(const CodeBlock& right).

Note:
EDoc++ data included.

Definition at line 41 of file Exception.cpp.

EDoc::Exception::Exception ( const Exception right,
EDoc::Dictionary dict_in 
)

See CodeBlock::CodeBlock(const CodeBlock& right, Dictionary& dict_in).

Note:
EDoc++ data included.

Definition at line 50 of file Exception.cpp.

References EDoc::DictionarySpecific::dict, function, and EDoc::Dictionary::functions.


Member Function Documentation

EDoc::Exception::operator= ( const Exception right  ) 

See CodeBlock::operator=().

Note:
EDoc++ data included.

Definition at line 63 of file Exception.cpp.

References auto_throw_spec, EDoc::DictionarySpecific::dict, function, EDoc::Dictionary::functions, type, and visible.

EDoc::Exception::Read ( EDoc::PersistenceIFace file,
EDoc::IndexedDictionary idict 
)

See CodeBlock::Read().

Note:
EDoc++ data included.
Exceptions:
EDoc::EOFException 
EDoc::FileIOException 

Definition at line 99 of file Exception.cpp.

References EDoc::TypeLoc::Read(), and type.

EDoc::Exception::Write ( EDoc::PersistenceIFace file  )  const

See CodeBlock::Write().

Note:
EDoc++ data included.
Exceptions:
EDoc::FileIOException 

Definition at line 104 of file Exception.cpp.

References auto_throw_spec, EDOC_ASSERT, type, and EDoc::TypeLoc::Write().

EDoc::Exception::ReplaceReferences ( EDoc::PStack stack,
void *  remove,
void *  replace 
) [virtual]

See DictionarySpecific::ReplaceReferences().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 122 of file Exception.cpp.

References EDOC_REPLACE, function, EDoc::PStack::Push(), EDoc::TypeLoc::ReplaceReferences(), and type.

Referenced by EDoc::PropogatingException::ReplaceReferences().

EDoc::Exception::Print ( std::ostream &  out,
std::string  prefix = "" 
) const [virtual]

See DictionarySpecific::Print().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 138 of file Exception.cpp.

References auto_throw_spec, EDoc::StringIdentifiedObject::GetKeyName(), EDoc::INDENT_STR, EDoc::TypeLoc::loc, EDoc::Location::Print(), type, EDoc::TypeLoc::value, and visible.

Referenced by EDoc::PropogatingException::Print().

EDoc::Exception::Validate ( EDoc::PStack stack,
const Dictionary dict_in 
) const [virtual]

See DictionarySpecific::Validate().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 81 of file Exception.cpp.

References EDoc::DictionarySpecific::dict, EDOC_ASSERT, function, type, EDoc::TypeLoc::Validate(), and EDoc::Function::Validate().

Referenced by EDoc::PropogatingException::Validate().

EDoc::Exception::operator== ( const Exception right  )  const

Equivilance operator (Works across dictionaries).

Returns:
Returns true if the type being thrown is the same and the location it is being thrown from is also the same.

Definition at line 111 of file Exception.cpp.

References auto_throw_spec, EDOC_Finer, function, and type.

EDoc::DictionarySpecific::ToString ( std::string  prefix = ""  )  const [inherited]

Returns a string representing the current object in a user readable manner.

This will return as a string exactly what Print() would display. This is primarily here for use from within python and for debugging.

Definition at line 34 of file DictionarySpecific.cpp.

References EDoc::DictionarySpecific::Print().

Referenced by EDoc::Dictionary::Read().


Friends And Related Function Documentation

friend class PropogatingException [friend]

Definition at line 53 of file Exception.h.


Field Documentation

TypeLoc EDoc::Exception::type

Stores the type and location in the source from which it is thrown.

Definition at line 123 of file Exception.h.

Referenced by EDoc::AddPException(), EDoc::AddRethrow(), EDoc::Function::GetSubstException(), EDoc::PropogatingException::IsVisible(), operator=(), operator==(), EDoc::PropogatingException::Print(), Print(), Read(), ReplaceReferences(), EDoc::PropogatingException::Validate(), Validate(), and Write().

bool EDoc::Exception::visible

True if this exception is visible to the user or false if this exception will never be shown to the user.

This is used for suppressions.

Definition at line 137 of file Exception.h.

Referenced by EDoc::Function::GetSubstException(), EDoc::PropogatingException::IsVisible(), operator=(), and Print().

bool EDoc::Exception::auto_throw_spec

True if this exception was created automatically by EDoc++ as a throw spec exception.

I.e. This is an exception that does not actually exist in the code but represents wnat is possible based on the functions specifiers.

Definition at line 146 of file Exception.h.

Referenced by operator=(), operator==(), Print(), and Write().

Function* EDoc::Exception::function

Function from which exception originates.

This is populated by Dictionary::CalculatePropogatingExceptions() but NULL before then.

Definition at line 158 of file Exception.h.

Referenced by Exception(), EDoc::Function::GetSubstException(), operator=(), operator==(), ReplaceReferences(), and Validate().

Dictionary& EDoc::DictionarySpecific::dict [protected, inherited]

A reference to the dictionary this object belongs to.

Definition at line 150 of file DictionarySpecific.h.

Referenced by EDoc::ManagedObject::CAlwaysGet(), EDoc::CatchBlock::CatchBlock(), Exception(), EDoc::Function::ExpandCallGraph(), EDoc::CodeBlock::ExpandCallGraph(), EDoc::FunctionLoc::FunctionLoc(), EDoc::FunctionTypeLoc::FunctionTypeLoc(), EDoc::Function::GetSubstException(), EDoc::Location::Location(), EDoc::ManagedObject::ManagedObject(), EDoc::Type::Merge(), EDoc::Location::Merge(), EDoc::Function::Merge(), EDoc::SpecificManagedObject< EDoc::Type >::New(), EDoc::TypeLoc::operator=(), EDoc::Type::operator=(), EDoc::TryBlock::operator=(), EDoc::PropogatingException::operator=(), EDoc::Location::operator=(), EDoc::FunctionTypeLoc::operator=(), EDoc::FunctionType::operator=(), EDoc::FunctionLoc::operator=(), EDoc::Function::operator=(), operator=(), EDoc::CodeBlock::operator=(), EDoc::PropogatingException::PropogatingException(), EDoc::TryBlock::Read(), EDoc::Function::Read(), EDoc::CodeBlock::Read(), EDoc::TryBlock::TryBlock(), EDoc::TypeLoc::TypeLoc(), EDoc::TypeLoc::Validate(), EDoc::Type::Validate(), EDoc::TryBlock::Validate(), EDoc::PropogatingException::Validate(), EDoc::ManagedObject::Validate(), EDoc::Location::Validate(), EDoc::FunctionTypeLoc::Validate(), EDoc::FunctionType::Validate(), EDoc::FunctionLoc::Validate(), EDoc::Function::Validate(), EDoc::File::Validate(), Validate(), EDoc::CodeBlock::Validate(), EDoc::CatchBlock::Validate(), EDoc::Type::Write(), and EDoc::Function::Write().


The documentation for this class was generated from the following files:
Generated on Tue Jan 20 18:26:08 2009 for EDoc-0.2.1 by  doxygen 1.5.1