EDoc::CatchBlock Class Reference

#include <include/EDoc/CatchBlock.h>

Inheritance diagram for EDoc::CatchBlock:

EDoc::DictionarySpecific

Detailed Description

Represents a catch statement in a block of code.

Every catch block should be asssociated with a try block. It contains information about the catch type, and stores a CodeBlock instance that contains the code executed if an exception is encountered which matches the catch_type.

The following code will produce 2 CatchBlock instances one for the catch(int) and the other for the catch(...)

 try
 {
    ...code...
 }
 catch(int i)
 {
    ...code...
 }
 catch(...)
 {
    ...code...
 }

Definition at line 70 of file CatchBlock.h.

Public Member Functions

 CatchBlock (Dictionary *dict_in=NULL)
 See CodeBlock::CodeBlock(Dictionary* dict_in=NULL).
 CatchBlock (const CatchBlock &right)
 See CodeBlock::CodeBlock(const CodeBlock& right).
 CatchBlock (const CatchBlock &right, Dictionary &dict_in)
 See CodeBlock::CodeBlock(const CodeBlock& right, Dictionary& dict_in).
CatchBlockoperator= (const CatchBlock &right)
 See CodeBlock::operator=().
 ~CatchBlock ()
 Destructor.
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 CatchBlock &right) const
 Equivilance operator (Works across dictionaries).
void ExpandCallGraph (Function &function)
 See CodeBlock::ExpandCallGraph() as this is just a wrapper that calls that in order to improve code readability.
std::string ToString (std::string prefix="") const
 Returns a string representing the current object in a user readable manner.

Data Fields

TypeLoc catch_type
 The type of exception this object will catch.
CodeBlockPtr catch_code
 The code that is executed upon this catch block handling an exception.

Protected Attributes

Dictionarydict
 A reference to the dictionary this object belongs to.


Constructor & Destructor Documentation

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

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

Note:
EDoc++ data included.

Definition at line 31 of file CatchBlock.cpp.

References catch_code.

EDoc::CatchBlock::CatchBlock ( const CatchBlock right  ) 

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

Note:
EDoc++ data included.

Definition at line 39 of file CatchBlock.cpp.

References catch_code.

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

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

Note:
EDoc++ data included.

Definition at line 47 of file CatchBlock.cpp.

References catch_code, and EDoc::DictionarySpecific::dict.

EDoc::CatchBlock::~CatchBlock (  ) 

Destructor.

Note:
EDoc++ data included.

Definition at line 55 of file CatchBlock.cpp.

References catch_code.


Member Function Documentation

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

See CodeBlock::operator=().

Note:
EDoc++ data included.

Definition at line 61 of file CatchBlock.cpp.

References catch_code, and catch_type.

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

See CodeBlock::Read().

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

Definition at line 74 of file CatchBlock.cpp.

References catch_code, catch_type, EDoc::CodeBlock::Read(), and EDoc::TypeLoc::Read().

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

See CodeBlock::Write().

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

Definition at line 80 of file CatchBlock.cpp.

References catch_code, catch_type, EDoc::CodeBlock::Write(), and EDoc::TypeLoc::Write().

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

See DictionarySpecific::ReplaceReferences().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 91 of file CatchBlock.cpp.

References catch_code, catch_type, EDoc::PStack::Push(), EDoc::CodeBlock::ReplaceReferences(), and EDoc::TypeLoc::ReplaceReferences().

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

See DictionarySpecific::Print().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 106 of file CatchBlock.cpp.

References catch_code, catch_type, EDoc::StringIdentifiedObject::GetKeyName(), EDoc::CodeBlock::Print(), and EDoc::TypeLoc::value.

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

See DictionarySpecific::Validate().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 118 of file CatchBlock.cpp.

References catch_code, catch_type, EDoc::DictionarySpecific::dict, EDOC_ASSERT, EDoc::Type::external_linkage, EDoc::StringIdentifiedObject::GetKeyName(), EDoc::Type::throw_type, EDoc::CodeBlock::Validate(), EDoc::TypeLoc::Validate(), and EDoc::TypeLoc::value.

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

Equivilance operator (Works across dictionaries).

Note:
EDoc++ data included.

Definition at line 86 of file CatchBlock.cpp.

References catch_code, and catch_type.

EDoc::CatchBlock::ExpandCallGraph ( EDoc::Function function  ) 

See CodeBlock::ExpandCallGraph() as this is just a wrapper that calls that in order to improve code readability.

Note:
EDoc++ data included.

Definition at line 113 of file CatchBlock.cpp.

References catch_code, and EDoc::CodeBlock::ExpandCallGraph().

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().


Field Documentation

TypeLoc EDoc::CatchBlock::catch_type

The type of exception this object will catch.

This is the type "..." for a catch all.

Definition at line 152 of file CatchBlock.h.

Referenced by operator=(), operator==(), Print(), Read(), ReplaceReferences(), Validate(), and Write().

CodeBlockPtr EDoc::CatchBlock::catch_code

The code that is executed upon this catch block handling an exception.

Note: This is a pointer so we can have circular dependencies. It is simplest to break the circular include chain by making CodeBlock an incomplete type in both the CatchBlock and TryBlock classes.

Definition at line 162 of file CatchBlock.h.

Referenced by CatchBlock(), ExpandCallGraph(), operator=(), operator==(), Print(), Read(), ReplaceReferences(), Validate(), Write(), and ~CatchBlock().

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(), CatchBlock(), EDoc::Exception::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=(), EDoc::Exception::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(), EDoc::Exception::Validate(), EDoc::CodeBlock::Validate(), 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