EDoc::TryBlock Class Reference

#include <include/EDoc/TryBlock.h>

Inheritance diagram for EDoc::TryBlock:

EDoc::DictionarySpecific

Detailed Description

Represents a try block in C++ code.

An instance of this class is created for every try block encountered in C++ code. It is also created for certain other constructs like a special cases where no exceptions are allowed. This is a special usage of the try block.

In normal usage a TryBlock has a number of associated CatchBlock's in the catch_blocks list. When an exception occurs in the try block it can be handled in one of the catch blocks. A special usage of this however is when the catch_blocks list is empty. This is used to represent a block of code that MUST NOT THROW ANY EXCEPTIONS. This is a special construct defined internally to GCC for certain situations.

Definition at line 54 of file TryBlock.h.

Public Member Functions

 TryBlock (Dictionary *dict_in=NULL)
 See CodeBlock::CodeBlock(Dictionary* dict_in=NULL).
 TryBlock (const TryBlock &right)
 See CodeBlock::CodeBlock(const CodeBlock& right).
 TryBlock (const TryBlock &right, Dictionary &dict_in)
 See CodeBlock::CodeBlock(const CodeBlock& right, Dictionary& dict_in).
TryBlockoperator= (const TryBlock &right)
 See CodeBlock::operator=().
 ~TryBlock ()
 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 TryBlock &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

CodeBlocktry_block
 A reference to the block of code executed inside the try block.
std::vector< CatchBlockcatch_blocks
 A list of catch blocks in the order in which they are defined in the C++ code.

Protected Attributes

Dictionarydict
 A reference to the dictionary this object belongs to.


Constructor & Destructor Documentation

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

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

Note:
EDoc++ data included.

Definition at line 35 of file TryBlock.cpp.

References try_block.

EDoc::TryBlock::TryBlock ( const TryBlock right  ) 

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

Note:
EDoc++ data included.

Definition at line 42 of file TryBlock.cpp.

References catch_blocks, and try_block.

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

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

Note:
EDoc++ data included.

Definition at line 50 of file TryBlock.cpp.

References catch_blocks, EDoc::DictionarySpecific::dict, and try_block.

EDoc::TryBlock::~TryBlock (  ) 

Destructor.

Note:
EDoc++ data included.

Definition at line 62 of file TryBlock.cpp.

References try_block.


Member Function Documentation

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

See CodeBlock::operator=().

Note:
EDoc++ data included.

Definition at line 68 of file TryBlock.cpp.

References catch_blocks, EDoc::DictionarySpecific::dict, EDoc::Erase(), and try_block.

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

See CodeBlock::Read().

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

Definition at line 86 of file TryBlock.cpp.

References catch_blocks, EDoc::DictionarySpecific::dict, EDoc::Erase(), KEY_CATCH_BLOCKS_LS, EDoc::CodeBlock::Read(), EDoc::PersistenceIFace::ReadUInt32(), and try_block.

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

See CodeBlock::Write().

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

Definition at line 101 of file TryBlock.cpp.

References catch_blocks, KEY_CATCH_BLOCKS_LS, try_block, EDoc::CodeBlock::Write(), and EDoc::PersistenceIFace::WriteUInt32().

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

See DictionarySpecific::ReplaceReferences().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 160 of file TryBlock.cpp.

References catch_blocks, EDoc::PStack::Push(), EDoc::CodeBlock::ReplaceReferences(), and try_block.

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

See DictionarySpecific::Print().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 148 of file TryBlock.cpp.

References catch_blocks, EDoc::CodeBlock::Print(), and try_block.

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

See DictionarySpecific::Validate().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 188 of file TryBlock.cpp.

References catch_blocks, EDoc::DictionarySpecific::dict, EDOC_ASSERT, try_block, and EDoc::CodeBlock::Validate().

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

Equivilance operator (Works across dictionaries).

Note:
EDoc++ data included.

Definition at line 112 of file TryBlock.cpp.

References catch_blocks, and try_block.

EDoc::TryBlock::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 178 of file TryBlock.cpp.

References catch_blocks, EDoc::CodeBlock::ExpandCallGraph(), and try_block.

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

CodeBlock* EDoc::TryBlock::try_block

A reference to the block of code executed inside the try block.

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 136 of file TryBlock.h.

Referenced by ExpandCallGraph(), operator=(), operator==(), Print(), EDoc::Dictionary::ProcessTryBlock(), Read(), ReplaceReferences(), TryBlock(), Validate(), Write(), and ~TryBlock().

std::vector<CatchBlock> EDoc::TryBlock::catch_blocks

A list of catch blocks in the order in which they are defined in the C++ code.

Definition at line 142 of file TryBlock.h.

Referenced by ExpandCallGraph(), operator=(), operator==(), Print(), EDoc::Dictionary::ProcessTryBlock(), Read(), ReplaceReferences(), TryBlock(), Validate(), and Write().

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(), 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=(), 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(), Read(), EDoc::Function::Read(), EDoc::CodeBlock::Read(), TryBlock(), EDoc::TypeLoc::TypeLoc(), EDoc::TypeLoc::Validate(), EDoc::Type::Validate(), 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(), 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:09 2009 for EDoc-0.2.1 by  doxygen 1.5.1