#include <include/EDoc/FunctionLoc.h>
Inheritance diagram for EDoc::FunctionLoc:
This can be used for a few purposes one of which is to store data for a function call. This way the function that is being called is stored along with the location in the source code from which the call is made for debugging purposes.
Definition at line 42 of file FunctionLoc.h.
Public Member Functions | |
FunctionLoc (Dictionary &dict_in, Function *value_in, const Location &loc_in) | |
Create a new FunctionLoc given the dictionary, a function to reference and the location. | |
FunctionLoc (Dictionary *dict_in=NULL) | |
See CodeBlock::CodeBlock(Dictionary* dict_in=NULL). | |
FunctionLoc (const FunctionLoc &right) | |
See CodeBlock::CodeBlock(const CodeBlock& right). | |
FunctionLoc (const FunctionLoc &right, Dictionary &dict_in) | |
See CodeBlock::CodeBlock(const CodeBlock& right, Dictionary& dict_in). | |
FunctionLoc & | operator= (const FunctionLoc &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 FunctionLoc &right) const |
Equivilance operator (Works across dictionaries). | |
bool | operator< (const FunctionLoc &right) const |
Less than comparison so this can be used for std::map keys. | |
std::string | ToString (std::string prefix="") const |
Returns a string representing the current object in a user readable manner. | |
Data Fields | |
Location | loc |
A location in a source file. | |
Function * | value |
A reference to a Function. | |
bool | possible |
When this object respresents a function call, then this flag is true if the call is a "possible" call and not an explicit call. | |
bool | is_top_level |
USED ONLY FROM Dictionary::CalculatePropogatingExceptions(). | |
Protected Attributes | |
Dictionary & | dict |
A reference to the dictionary this object belongs to. |
EDoc::FunctionLoc::FunctionLoc | ( | EDoc::Dictionary & | dict_in, | |
EDoc::Function * | value_in, | |||
const Location & | loc_in | |||
) |
Create a new FunctionLoc given the dictionary, a function to reference and the location.
Definition at line 34 of file FunctionLoc.cpp.
References EDoc::DictionarySpecific::dict, EDOC_ASSERT, EDoc::Dictionary::functions, EDoc::StringIdentifiedObject::GetKeyName(), and value.
EDoc::FunctionLoc::FunctionLoc | ( | EDoc::Dictionary * | dict_in = NULL |
) |
See CodeBlock::CodeBlock(Dictionary* dict_in=NULL).
Definition at line 46 of file FunctionLoc.cpp.
EDoc::FunctionLoc::FunctionLoc | ( | const FunctionLoc & | right | ) |
See CodeBlock::CodeBlock(const CodeBlock& right).
Definition at line 55 of file FunctionLoc.cpp.
EDoc::FunctionLoc::FunctionLoc | ( | const FunctionLoc & | right, | |
EDoc::Dictionary & | dict_in | |||
) |
See CodeBlock::CodeBlock(const CodeBlock& right, Dictionary& dict_in).
Definition at line 64 of file FunctionLoc.cpp.
References EDoc::DictionarySpecific::dict, EDoc::Dictionary::functions, and value.
EDoc::FunctionLoc::operator= | ( | const FunctionLoc & | right | ) |
Definition at line 77 of file FunctionLoc.cpp.
References EDoc::DictionarySpecific::dict, EDoc::Dictionary::functions, possible, and value.
EDoc::FunctionLoc::Read | ( | EDoc::PersistenceIFace & | file, | |
EDoc::IndexedDictionary & | idict | |||
) |
See CodeBlock::Read().
EDoc::EOFException |
| |
EDoc::FileIOException |
|
Definition at line 94 of file FunctionLoc.cpp.
References EDoc::IndexedDictionary::functions, KEY_FUNCTION, loc, EDoc::Location::Read(), EDoc::PersistenceIFace::ReadUInt32(), and value.
EDoc::FunctionLoc::Write | ( | EDoc::PersistenceIFace & | file | ) | const |
See CodeBlock::Write().
EDoc::FileIOException |
|
Definition at line 102 of file FunctionLoc.cpp.
References EDOC_ASSERT, EDoc::Function::GetDeclaredName(), EDoc::StringIdentifiedObject::GetIndex(), KEY_FUNCTION, loc, value, EDoc::Location::Write(), and EDoc::PersistenceIFace::WriteUInt32Debug().
EDoc::FunctionLoc::ReplaceReferences | ( | EDoc::PStack & | stack, | |
void * | remove, | |||
void * | replace | |||
) | [virtual] |
See DictionarySpecific::ReplaceReferences().
Implements EDoc::DictionarySpecific.
Definition at line 161 of file FunctionLoc.cpp.
References EDOC_REPLACE, loc, EDoc::PStack::Push(), EDoc::Location::ReplaceReferences(), and value.
Referenced by EDoc::PropogatingException::ReplaceReferences().
EDoc::FunctionLoc::Print | ( | std::ostream & | out, | |
std::string | prefix = "" | |||
) | const [virtual] |
See DictionarySpecific::Print().
Implements EDoc::DictionarySpecific.
Definition at line 195 of file FunctionLoc.cpp.
References EDoc::StringIdentifiedObject::GetKeyName(), loc, EDoc::Location::Print(), and value.
Referenced by EDoc::PropogatingException::Print().
EDoc::FunctionLoc::Validate | ( | EDoc::PStack & | stack, | |
const Dictionary & | dict_in | |||
) | const [virtual] |
See DictionarySpecific::Validate().
Implements EDoc::DictionarySpecific.
Definition at line 178 of file FunctionLoc.cpp.
References EDoc::DictionarySpecific::dict, EDOC_ASSERT, loc, EDoc::Function::Validate(), EDoc::Location::Validate(), and value.
Referenced by EDoc::PropogatingException::Validate().
EDoc::FunctionLoc::operator== | ( | const FunctionLoc & | right | ) | const |
Equivilance operator (Works across dictionaries).
Definition at line 113 of file FunctionLoc.cpp.
References EDoc::Function::GetNormalisedName(), loc, and value.
EDoc::FunctionLoc::operator< | ( | const FunctionLoc & | right | ) | const |
Less than comparison so this can be used for std::map keys.
Compares Location first then Function instances.
Definition at line 132 of file FunctionLoc.cpp.
References EDoc::StringIdentifiedObject::GetKeyName(), loc, and value.
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().
A location in a source file.
Definition at line 121 of file FunctionLoc.h.
Referenced by operator<(), operator==(), Print(), EDoc::Dictionary::ProcessCodeBlock(), EDoc::Dictionary::ProcessTryBlock(), Read(), ReplaceReferences(), Validate(), and Write().
A reference to a Function.
Note: As part of a propagating exception instance this value may be NULL indicating that the propagating exception is an originating exception. So remember that this may have at some points a NULL value.
Definition at line 130 of file FunctionLoc.h.
Referenced by FunctionLoc(), operator<(), operator=(), operator==(), Print(), EDoc::Dictionary::ProcessCodeBlock(), EDoc::Dictionary::ProcessFunction(), EDoc::Dictionary::ProcessTryBlock(), Read(), ReplaceReferences(), Validate(), and Write().
When this object respresents a function call, then this flag is true if the call is a "possible" call and not an explicit call.
A possible call is one that results from a function pointer call or a virtual function call.
Definition at line 139 of file FunctionLoc.h.
Referenced by EDoc::AddPException(), EDoc::AddRethrow(), operator=(), and EDoc::PropogatingException::Validate().
USED ONLY FROM Dictionary::CalculatePropogatingExceptions().
Data used by the CalculatePropogatingExceptions in order to determine if a function loc object represents the current function whose exception list is being calculated. This is really just temporary data and does not belong here, but it is the simplest place to put it.
Definition at line 155 of file FunctionLoc.h.
Referenced by EDoc::Dictionary::GenerateExceptions(), EDoc::Dictionary::ProcessFunction(), and EDoc::Dictionary::ProcessTryBlock().
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(), 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=(), 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(), Validate(), EDoc::Function::Validate(), EDoc::File::Validate(), EDoc::Exception::Validate(), EDoc::CodeBlock::Validate(), EDoc::CatchBlock::Validate(), EDoc::Type::Write(), and EDoc::Function::Write().