EDoc::Function Class Reference

#include <include/EDoc/Function.h>

Inheritance diagram for EDoc::Function:

EDoc::StringIdentifiedObject EDoc::DictionarySpecific

Detailed Description

Represents a function in C/C++ code that has been encounterd during compilation.

The function object stores all information about encountered functions. This includes information about functions that are called which do not have implementations in the translation unit.

Definition at line 50 of file Function.h.

Public Types

typedef void(*) OnProcessedFP (Function &function, void *data)
 Function pointer for callback called after a function has finished having its propogating exceptions calculated.

Public Member Functions

 Function (Dictionary &dict_in, std::string key_name_in)
 See StringIdentifiedObject::(Dictionary& dict_in, std::string key_name_in, bool populated_in=false).
 Function (Dictionary &dict_in, int32_t index_in)
 See StringIdentifiedObject(Dictionary& dict_in, int32_t index_in, bool populated_in=false).
virtual ~Function ()
 Destructor.
Functionoperator= (const Function &right)
 Copies data from another object into this one.
void Read (PersistenceIFace &file, IndexedDictionary &idict)
 See StringIdentifiedObject::Read().
void Write (PersistenceIFace &file) const
 See StringIdentifiedObject::Write().
virtual void Merge (const StringIdentifiedObject &right)
 See StringIdentifiedObject::Merge().
virtual size_t ReplaceReferences (PStack &stack, void *remove, void *replace)
 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().
virtual uint8_t GetRecordType () const
 See StringIdentifiedObject::GetRecordType().
std::string GetDeclaredName () const
 Returns a string with the user text that the function was declared with.
void SetDeclaredName (std::string name_in)
 Sets a string with the user text that the function was declared with.
std::string GetNormalisedName () const
 Returns the unique linker id name (C++ Mangaled name).
std::string GetSpecString () const
 Returns a user readable string with the functions exception restriction specification.
std::string GetRefInFilesString () const
 Returns a user readable string listing all the source files that this function has been referenced from within.
void ExpandCallGraph ()
 See Dictionary::ExpandCallGraph().
std::list< const PropogatingException * > GetVisiblePropExceptions () const
 Returns a list of all exceptions that propogate from this function that have not been suppressed.
bool IsMain () const
 Returns true if this represents the main function.
bool IsStaticInitialiser () const
 Returns true if this function is a "Static initializer".
bool IsDestructor () const
 Returns true if this represents a destructor for a class.
std::list< EDoc::PropogatingException * > GetPropogatingExceptions ()
 Returns a list of pointers to propogating exceptions that can be used by the python wrappers in order to modify the propogating exception objects.
ExceptionGetSubstException ()
 Returns a reference to the subst exception for this function.
void RemoveFromCircular ()
 If this function is part of a circular call graph then this function will remove this instance from the circular set: circular.
bool IsCircular () const
 Returns true if this function participates in a circular callgraph.
const std::set< Function * > & GetCircleSet () const
 Returns true if this function participates in a circular callgraph.
void SetOnProcessed (OnProcessedFP fp, void *data)
 Set a callback function to be called immediatly after the functions set of propogating exceptions have been calculated.
const std::string & GetKeyName () const
 Returns the string key that identifies this object.
ssize_t GetIndex () const
 Returns the integer key that identifies this object.
bool IsPopulated () const
 Returns true if this object has been completely populated from a file source or manually or false if the object is incomplete.
std::string ToString (std::string prefix="") const
 Returns a string representing the current object in a user readable manner.

Data Fields

std::string link_name
 The linker string id used for identifying this function.
std::string full_name
 The name of the function as declared by the user in the source file.
bool is_public
 True if this funciton has public scope or false if it is private to the translation unit it belongs to.
bool is_inline
 True if this function was inlined at compile time.
bool is_implicit
 True if this function was generated implicitly by the compiler and explicitly created by the user.
bool has_exception_spec
 True if an exception specification restriction exists for this function.
std::vector< Type * > exception_spec
 If has_exception_spec is true lists the exception types that are allowed to propogate out this function.
std::vector< Locationaddress_taken
 A list of source code locations where the address of this function was taken for use with a function pointer etc.
FunctionTypefunction_pointer_type
 The function pointer that represents the type of this funciton.
Location loc
 The location in the source files where this functions prototype was declared or its implementation was defined.
bool exceptions_enabled
 True if this function was compiled in a translation unit where exceptions were allowed.
int processed_implementations
 Returns the number of implementations of this function have been processed.
TranslationUnittranslation_unit
 A reference to the unique translation unit instance that this function belongs to.
CodeBlock implementation
 The implementation for this function.
bool calculated_propogating_exceptions
 True if the propogating exceptions for this function have been completely calculated.
std::list< PropogatingExceptionpropogating_exceptions
 A list of all exceptions that may propogate out this function.
std::vector< Function * > derived_virtuals
 A list of functions that may be called as a result of a call to this function due to them being matching virtuals in derived classes.
std::vector< PropogatingExceptionfiltered_exceptions
 Is a list of exceptions that would have propogated out this function had they not been filtered out by the exception spec.
std::list< File * > referenced_in_files
 A list of all source files that this function is used from.
bool visible
 True if this function is visible to the user or false if it will never be displayed to the user.
Exceptionsubst_exception
 The subst exception for this function.
int total_calls
 USED ONLY FROM Dictionary::CalculatePropogatingExceptions().
std::set< Function * > * circular
 USED ONLY FROM.
OnProcessedFP on_processed
 Callback function pointer (See SetOnProcessed()).
void * on_processed_data
 Callback function pointers data (See SetOnProcessed()).

Protected Member Functions

void SetKeyName (std::string key_name_in)
 Used by derived class to set the string key once it is able to determine it.

Protected Attributes

bool populated
 True if this object has been completely populated.
int32_t index
 Set to the integer index used to identify this object or -1 if the key_name is used to identify this object.
std::string key_name
 Set to the string key used to identify this object.
bool writing
 USED ONLY FROM Dictionary::Write().
Dictionarydict
 A reference to the dictionary this object belongs to.


Member Typedef Documentation

typedef void(*) EDoc::Function::OnProcessedFP(Function &function, void *data)

Function pointer for callback called after a function has finished having its propogating exceptions calculated.

Definition at line 488 of file Function.h.


Constructor & Destructor Documentation

EDoc::Function::Function ( EDoc::Dictionary dict_in,
std::string  key_name_in 
)

See StringIdentifiedObject::(Dictionary& dict_in, std::string key_name_in, bool populated_in=false).

Note:
EDoc++ data included.

Definition at line 50 of file Function.cpp.

EDoc::Function::Function ( EDoc::Dictionary dict_in,
int32_t  index_in 
)

See StringIdentifiedObject(Dictionary& dict_in, int32_t index_in, bool populated_in=false).

Note:
EDoc++ data included.

Definition at line 72 of file Function.cpp.

EDoc::Function::~Function (  )  [virtual]

Destructor.

Note:
EDoc++ data included.

Definition at line 94 of file Function.cpp.

References RemoveFromCircular(), and subst_exception.


Member Function Documentation

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

Copies data from another object into this one.

This can be used across different dictionaries and will only copy object data but not identification information used in the StringIdentifiedObject such as the key name.

Definition at line 119 of file Function.cpp.

References address_taken, calculated_propogating_exceptions, derived_virtuals, EDoc::DictionarySpecific::dict, EDOC_Finer, EDOC_FOREACH_CONST, EDoc::Erase(), exception_spec, exceptions_enabled, EDoc::Dictionary::files, full_name, function_pointer_type, EDoc::Dictionary::function_types, EDoc::Dictionary::functions, has_exception_spec, implementation, is_implicit, is_inline, is_public, link_name, loc, EDoc::StringIdentifiedObject::populated, processed_implementations, propogating_exceptions, referenced_in_files, translation_unit, EDoc::Dictionary::types, and visible.

EDoc::Function::Read ( EDoc::PersistenceIFace file,
EDoc::IndexedDictionary idict 
) [virtual]

See StringIdentifiedObject::Read().

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

Implements EDoc::StringIdentifiedObject.

Definition at line 195 of file Function.cpp.

References address_taken, derived_virtuals, EDoc::DictionarySpecific::dict, EDOC_Finer, EDOC_THROW_EXCEPTION, exception_spec, exceptions_enabled, EDoc::IndexedDictionary::files, full_name, function_pointer_type, EDoc::IndexedDictionary::function_types, EDoc::IndexedDictionary::functions, EDoc::TranslationUnit::GetID(), EDoc::Dictionary::GetIndexedTranslationUnit(), EDoc::TranslationUnit::GetName(), has_exception_spec, implementation, is_implicit, is_inline, is_public, KEY_ADDRESS_TAKEN_LS, KEY_DERIVED_VIRT_LI, KEY_DERIVED_VIRT_LS, KEY_EXCEPTION_SPEC_LI, KEY_EXCEPTION_SPEC_LS, KEY_EXCEPTIONS_ENABLED, KEY_FULL_NAME, KEY_FUNCTION_TYPE, KEY_HAS_EXCEPTION_SPEC, KEY_IS_IMPLICIT, KEY_IS_INLINE, KEY_IS_PUBLIC, KEY_LINK_NAME, KEY_PROCESSED_IMPLEMENTATION, KEY_REFERENCE_FILE, KEY_REFERENCE_FILES_LS, KEY_TRANSLATION_UNIT, link_name, loc, EDoc::StringIdentifiedObject::populated, processed_implementations, EDoc::CodeBlock::Read(), EDoc::Location::Read(), EDoc::PersistenceIFace::ReadBoolean(), EDoc::PersistenceIFace::ReadString(), EDoc::PersistenceIFace::ReadUInt32(), referenced_in_files, EDoc::StringIdentifiedObject::SetKeyName(), translation_unit, and EDoc::IndexedDictionary::types.

EDoc::Function::Write ( EDoc::PersistenceIFace file  )  const [virtual]

See StringIdentifiedObject::Write().

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

Implements EDoc::StringIdentifiedObject.

Definition at line 290 of file Function.cpp.

References address_taken, derived_virtuals, EDoc::DictionarySpecific::dict, EDOC_FOREACH_CONST, exception_spec, exceptions_enabled, full_name, function_pointer_type, EDoc::StringIdentifiedObject::GetIndex(), EDoc::StringIdentifiedObject::GetKeyName(), EDoc::TranslationUnit::GetName(), EDoc::Dictionary::GetTranslationUnitIndex(), has_exception_spec, implementation, is_implicit, is_inline, is_public, KEY_ADDRESS_TAKEN_LS, KEY_DERIVED_VIRT_LI, KEY_DERIVED_VIRT_LS, KEY_EXCEPTION_SPEC_LI, KEY_EXCEPTION_SPEC_LS, KEY_EXCEPTIONS_ENABLED, KEY_FULL_NAME, KEY_FUNCTION_TYPE, KEY_HAS_EXCEPTION_SPEC, KEY_IS_IMPLICIT, KEY_IS_INLINE, KEY_IS_PUBLIC, KEY_LINK_NAME, KEY_PROCESSED_IMPLEMENTATION, KEY_REFERENCE_FILE, KEY_REFERENCE_FILES_LS, KEY_TRANSLATION_UNIT, link_name, loc, processed_implementations, referenced_in_files, translation_unit, EDoc::CodeBlock::Write(), EDoc::Location::Write(), EDoc::PersistenceIFace::WriteBoolean(), EDoc::PersistenceIFace::WriteString(), EDoc::PersistenceIFace::WriteUInt32(), and EDoc::PersistenceIFace::WriteUInt32Debug().

EDoc::Function::Merge ( const StringIdentifiedObject right  )  [virtual]

See StringIdentifiedObject::Merge().

Merging two functions can occur in a few ways:

  1. One function has an implementation the other does not. This is simple to resolve and behaves like standard linking in that it keeps the implementation that exists.

  1. Both functions have no implementations. The merge will only import a small amount of data like additional locations where its address may have been taken from etc.

  1. Both functions have implementations but both implementations are the same. The merge will only import a small amount of data like additional locations where its address may have been taken from etc. This is normal occurance with functions like template functions that have "vague linkage".

  1. Both functions have implementations but the implementations differ in a resolvable but unrealistic way. This should not occur, but may do so due to bad inputs or the user using certain features of the linker that are not advisable. In this case we merge the implementations such that it is the most restrictive union between the two implementations an we emit an error.

  1. Both functions have implementations but the implementations differ in a way in which they can not be merged. This should never occur.

Implements EDoc::StringIdentifiedObject.

Definition at line 475 of file Function.cpp.

References address_taken, derived_virtuals, EDoc::DictionarySpecific::dict, EDOC_Finer, EDOC_FOREACH_CONST, EDOC_MERGE_ERROR, EDOC_NOTIFICATION, EDOC_Warning, exception_spec, exceptions_enabled, EDoc::Location::file, EDoc::Dictionary::files, full_name, function_pointer_type, EDoc::Dictionary::function_types, EDoc::Dictionary::functions, GetDeclaredName(), EDoc::StringIdentifiedObject::GetKeyName(), GetRefInFilesString(), GetSpecString(), has_exception_spec, implementation, is_implicit, is_inline, is_public, EDoc::Location::line, link_name, loc, EDoc::CodeBlock::Merge(), EDoc::StringIdentifiedObject::populated, processed_implementations, EDoc::PushBackUnique(), referenced_in_files, translation_unit, EDoc::WDIFF_IMPL, and EDoc::WDIFF_THROW.

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

DictionarySpecific::ReplaceReferences().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 889 of file Function.cpp.

References address_taken, circular, derived_virtuals, EDOC_ASSERT, EDOC_FOREACH, EDOC_REPLACE, exception_spec, filtered_exceptions, function_pointer_type, implementation, loc, processed_implementations, propogating_exceptions, EDoc::PStack::Push(), referenced_in_files, EDoc::CodeBlock::ReplaceReferences(), and EDoc::Location::ReplaceReferences().

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

See DictionarySpecific::Print().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 354 of file Function.cpp.

References address_taken, calculated_propogating_exceptions, circular, derived_virtuals, EDOC_FOREACH_CONST, exceptions_enabled, full_name, function_pointer_type, GetDeclaredName(), EDoc::StringIdentifiedObject::GetKeyName(), GetSpecString(), has_exception_spec, implementation, EDoc::INDENT_STR, is_implicit, is_inline, is_public, link_name, loc, EDoc::CodeBlock::Print(), EDoc::Location::Print(), processed_implementations, propogating_exceptions, and total_calls.

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

See DictionarySpecific::Validate().

Note:
EDoc++ data included.

Implements EDoc::DictionarySpecific.

Definition at line 952 of file Function.cpp.

References address_taken, circular, derived_virtuals, EDoc::DictionarySpecific::dict, EDOC_ASSERT, EDOC_FOREACH_CONST, exception_spec, filtered_exceptions, function_pointer_type, EDoc::Dictionary::functions, EDoc::StringIdentifiedObject::GetKeyName(), implementation, EDoc::StringIdentifiedObject::index, EDoc::StringIdentifiedObject::key_name, loc, EDoc::StringIdentifiedObject::populated, propogating_exceptions, referenced_in_files, translation_unit, EDoc::CodeBlock::Validate(), EDoc::Location::Validate(), and EDoc::FunctionType::Validate().

Referenced by EDoc::FunctionLoc::Validate(), and EDoc::Exception::Validate().

EDoc::Function::GetRecordType (  )  const [virtual]

See StringIdentifiedObject::GetRecordType().

Note:
EDoc++ data included.

Implements EDoc::StringIdentifiedObject.

Definition at line 45 of file Function.cpp.

References VALUE_RECORD_TYPE_FUNCTION.

EDoc::Function::GetDeclaredName (  )  const [inline]

Returns a string with the user text that the function was declared with.

Note:
EDoc++ data included.

Definition at line 159 of file Function.h.

References full_name.

Referenced by Merge(), Print(), EDoc::Dictionary::ProcessCodeBlock(), EDoc::Dictionary::ProcessFunction(), EDoc::Dictionary::ProcessTryBlock(), and EDoc::FunctionLoc::Write().

EDoc::Function::SetDeclaredName ( std::string  name_in  )  [inline]

Sets a string with the user text that the function was declared with.

Note:
EDoc++ data included.

Definition at line 168 of file Function.h.

References full_name.

EDoc::Function::GetNormalisedName (  )  const [inline]

Returns the unique linker id name (C++ Mangaled name).

Note:
EDoc++ data included.

Definition at line 176 of file Function.h.

References link_name.

Referenced by EDoc::FunctionLoc::operator==().

EDoc::Function::GetSpecString (  )  const

Returns a user readable string with the functions exception restriction specification.

This is the throw () string after the function prototype.

Definition at line 783 of file Function.cpp.

References exception_spec, has_exception_spec, and EDoc::StringIdentifiedObject::IsPopulated().

Referenced by Merge(), and Print().

EDoc::Function::GetRefInFilesString (  )  const

Returns a user readable string listing all the source files that this function has been referenced from within.

Useful for debugging.

Definition at line 1066 of file Function.cpp.

References EDOC_FOREACH_CONST, and referenced_in_files.

Referenced by Merge().

EDoc::Function::ExpandCallGraph (  ) 

See Dictionary::ExpandCallGraph().

Note:
EDoc++ data included.

Definition at line 812 of file Function.cpp.

References EDoc::CodeBlock::AddPossCall(), derived_virtuals, EDoc::DictionarySpecific::dict, EDOC_Finer, EDoc::CodeBlock::ExpandCallGraph(), EDoc::StringIdentifiedObject::GetKeyName(), implementation, processed_implementations, and EDoc::Dictionary::UNKNOWN_LOCATION.

EDoc::Function::GetVisiblePropExceptions (  )  const

Returns a list of all exceptions that propogate from this function that have not been suppressed.

Must be called after Dictionary::CalculatePropogatingExceptions()

Definition at line 830 of file Function.cpp.

References EDOC_FOREACH_CONST, EDOC_Info, and propogating_exceptions.

EDoc::Function::IsMain (  )  const

Returns true if this represents the main function.

Note:
EDoc++ data included.

Definition at line 863 of file Function.cpp.

References link_name.

EDoc::Function::IsStaticInitialiser (  )  const

Returns true if this function is a "Static initializer".

A static initializer function is used to initialize complex static data in a translation unit. This called before the main function.

Definition at line 868 of file Function.cpp.

References link_name.

EDoc::Function::IsDestructor (  )  const

Returns true if this represents a destructor for a class.

Note:
EDoc++ data included.

Definition at line 879 of file Function.cpp.

References full_name.

EDoc::Function::GetPropogatingExceptions (  ) 

Returns a list of pointers to propogating exceptions that can be used by the python wrappers in order to modify the propogating exception objects.

Note:
EDoc++ data included.

Definition at line 1079 of file Function.cpp.

References EDOC_FOREACH, and propogating_exceptions.

EDoc::Function::GetSubstException (  ) 

Returns a reference to the subst exception for this function.

The special "substitution" exception is used to represent all exceptions that may propagate out of a function. It is used in particular cases where the list of known exceptions can not be known or calculated until a later date. So when the list of exceptions can be determined this exception instance is replaced with that complete list.

This is primarily used in the calculation of propagating exceptions in recursive functions.

Definition at line 1090 of file Function.cpp.

References EDoc::DictionarySpecific::dict, EDoc::Exception::function, EDoc::TypeLoc::loc, subst_exception, EDoc::Dictionary::SUBSTITUTION_EXCEPTION_TYPE, EDoc::Exception::type, EDoc::Dictionary::UNKNOWN_LOCATION, EDoc::TypeLoc::value, and EDoc::Exception::visible.

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

EDoc::Function::RemoveFromCircular (  ) 

If this function is part of a circular call graph then this function will remove this instance from the circular set: circular.

This is primarily just used for cleaning up on destruction. The circular parameter is generally only created by the Dictionary::CalculatePropagatingExceptions()

See "private" member circular

Definition at line 101 of file Function.cpp.

References circular, and EDOC_ASSERT.

Referenced by ~Function().

EDoc::Function::IsCircular (  )  const [inline]

Returns true if this function participates in a circular callgraph.

Note:
EDoc++ data included.

Definition at line 268 of file Function.h.

References circular.

EDoc::Function::GetCircleSet (  )  const [inline]

Returns true if this function participates in a circular callgraph.

Note:
EDoc++ data included.

Definition at line 274 of file Function.h.

References circular, and EDOC_ASSERT.

void EDoc::Function::SetOnProcessed ( OnProcessedFP  fp,
void *  data 
) [inline]

Set a callback function to be called immediatly after the functions set of propogating exceptions have been calculated.

This is generally used for suppressing any exceptions that propogate from this function by making the exceptions invisible, without removing them entirely. This feature is used by the default suppressions.

Parameters:
fp Pointer to function to be called.
data Some data to be passed to the function pointer when it is called.

Definition at line 503 of file Function.h.

References on_processed, and on_processed_data.

EDoc::StringIdentifiedObject::GetKeyName (  )  const [inherited]

Returns the string key that identifies this object.

Will assert if the object has not yet been populated OR it currently uses an integer identifier not a string identifier.

Definition at line 51 of file StringIdentifiedObject.cpp.

References EDOC_ASSERT, EDoc::StringIdentifiedObject::index, EDoc::StringIdentifiedObject::key_name, and EDoc::StringIdentifiedObject::writing.

Referenced by EDoc::ManagedObject::CAdd(), EDoc::ManagedObject::CAlwaysGet(), EDoc::ManagedObject::CRemove(), ExpandCallGraph(), EDoc::FunctionLoc::FunctionLoc(), EDoc::Type::GetBestName(), EDoc::Type::IsEquivilant(), EDoc::Type::Merge(), EDoc::Location::Merge(), EDoc::FunctionType::Merge(), Merge(), EDoc::FunctionLoc::operator<(), EDoc::TypeLoc::Print(), EDoc::PropogatingException::Print(), EDoc::FunctionTypeLoc::Print(), EDoc::FunctionLoc::Print(), Print(), EDoc::Exception::Print(), EDoc::CatchBlock::Print(), EDoc::Dictionary::ProcessCodeBlock(), EDoc::Dictionary::ProcessFunction(), EDoc::StdErrFunctionProgress::Progress(), EDoc::Dictionary::Read(), EDoc::Dictionary::UpdateFunctionAddressLists(), EDoc::Type::Validate(), EDoc::FunctionType::Validate(), Validate(), EDoc::File::Validate(), EDoc::Dictionary::Validate(), EDoc::CatchBlock::Validate(), and Write().

EDoc::StringIdentifiedObject::GetIndex (  )  const [inline, inherited]

Returns the integer key that identifies this object.

Note:
EDoc++ data included.

Definition at line 142 of file StringIdentifiedObject.h.

References EDoc::StringIdentifiedObject::index.

Referenced by EDoc::TypeLoc::Write(), EDoc::Type::Write(), EDoc::FunctionTypeLoc::Write(), EDoc::FunctionType::Write(), EDoc::FunctionLoc::Write(), and Write().

EDoc::StringIdentifiedObject::IsPopulated (  )  const [inline, inherited]

Returns true if this object has been completely populated from a file source or manually or false if the object is incomplete.

Note:
EDoc++ data included.

Definition at line 151 of file StringIdentifiedObject.h.

References EDoc::StringIdentifiedObject::populated.

Referenced by EDoc::Dictionary::GeneratePredefined(), EDoc::Type::GetBestName(), EDoc::FunctionType::GetSpecString(), GetSpecString(), and EDoc::Dictionary::Read().

EDoc::StringIdentifiedObject::SetKeyName ( std::string  key_name_in  )  [protected, inherited]

Used by derived class to set the string key once it is able to determine it.

Usually an instance is created with an integer index and then data is loaded into the object and once it has loaded it is able to determine what its string index should be. Then it will call this function which sets the integer index to -1 and sets the string key to the given value.

Definition at line 57 of file StringIdentifiedObject.cpp.

References EDOC_ASSERT, EDoc::StringIdentifiedObject::index, and EDoc::StringIdentifiedObject::key_name.

Referenced by EDoc::Type::Read(), EDoc::FunctionType::Read(), Read(), and EDoc::File::Read().

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

std::string EDoc::Function::link_name

The linker string id used for identifying this function.

When in C++ this is the mangled function name.

Definition at line 292 of file Function.h.

Referenced by GetNormalisedName(), IsMain(), IsStaticInitialiser(), Merge(), operator=(), Print(), Read(), and Write().

std::string EDoc::Function::full_name

The name of the function as declared by the user in the source file.

Definition at line 298 of file Function.h.

Referenced by GetDeclaredName(), IsDestructor(), Merge(), operator=(), Print(), Read(), SetDeclaredName(), and Write().

bool EDoc::Function::is_public

True if this funciton has public scope or false if it is private to the translation unit it belongs to.

Definition at line 304 of file Function.h.

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

bool EDoc::Function::is_inline

True if this function was inlined at compile time.

Note: Inlined functions are treated a littlelike static functions. They can safely have implementation variations between tanslation units.

Definition at line 312 of file Function.h.

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

bool EDoc::Function::is_implicit

True if this function was generated implicitly by the compiler and explicitly created by the user.

An example of an implicit function is a Default Constructor created when no other constructors are provided.

Definition at line 321 of file Function.h.

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

bool EDoc::Function::has_exception_spec

True if an exception specification restriction exists for this function.

Definition at line 327 of file Function.h.

Referenced by GetSpecString(), Merge(), operator=(), EDoc::Dictionary::PostProcessExceptions(), Print(), Read(), and Write().

std::vector<Type*> EDoc::Function::exception_spec

If has_exception_spec is true lists the exception types that are allowed to propogate out this function.

Definition at line 334 of file Function.h.

Referenced by GetSpecString(), Merge(), operator=(), EDoc::Dictionary::PostProcessExceptions(), Read(), ReplaceReferences(), Validate(), and Write().

std::vector<Location> EDoc::Function::address_taken

A list of source code locations where the address of this function was taken for use with a function pointer etc.

Definition at line 341 of file Function.h.

Referenced by Merge(), operator=(), Print(), Read(), ReplaceReferences(), EDoc::Dictionary::UpdateFunctionAddressLists(), Validate(), and Write().

FunctionType* EDoc::Function::function_pointer_type

The function pointer that represents the type of this funciton.

This is used for matching function pointer calls to functions. See FunctionType for more information.

Definition at line 349 of file Function.h.

Referenced by Merge(), operator=(), Print(), Read(), ReplaceReferences(), EDoc::Dictionary::UpdateFunctionAddressLists(), Validate(), and Write().

Location EDoc::Function::loc

The location in the source files where this functions prototype was declared or its implementation was defined.

Definition at line 355 of file Function.h.

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

bool EDoc::Function::exceptions_enabled

True if this function was compiled in a translation unit where exceptions were allowed.

This is true when -fno-exceptions was not specified in C++ or -fexceptions was specified for C. If false then any exceptions that enter or exit this function will cause a program abort.

Definition at line 365 of file Function.h.

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

int EDoc::Function::processed_implementations

Returns the number of implementations of this function have been processed.

For most normal functions this should be 1. However for vague linkage functions like template functions this may be more than 1. If 0 however then there should be no valid data in the implementation member.

Definition at line 375 of file Function.h.

Referenced by ExpandCallGraph(), Merge(), operator=(), Print(), EDoc::Dictionary::ProcessFunction(), Read(), ReplaceReferences(), and Write().

TranslationUnit* EDoc::Function::translation_unit

A reference to the unique translation unit instance that this function belongs to.

Definition at line 381 of file Function.h.

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

CodeBlock EDoc::Function::implementation

The implementation for this function.

The CodeBlock describes in a heirarchial format all function calls, function pointer calls, and try/catch blocks that make up this functions implementation.

This member is not valid unless processed_implementations is not zero.

Definition at line 392 of file Function.h.

Referenced by EDoc::CalculateTotalFunctionCalls(), ExpandCallGraph(), Merge(), operator=(), Print(), EDoc::Dictionary::ProcessFunction(), Read(), ReplaceReferences(), Validate(), and Write().

bool EDoc::Function::calculated_propogating_exceptions

True if the propogating exceptions for this function have been completely calculated.

Definition at line 404 of file Function.h.

Referenced by EDoc::Dictionary::GenerateExceptions(), operator=(), Print(), and EDoc::Dictionary::ProcessFunction().

std::list<PropogatingException> EDoc::Function::propogating_exceptions

A list of all exceptions that may propogate out this function.

Definition at line 409 of file Function.h.

Referenced by GetPropogatingExceptions(), GetVisiblePropExceptions(), operator=(), EDoc::Dictionary::PostProcessExceptions(), Print(), EDoc::Dictionary::ProcessFunction(), ReplaceReferences(), and Validate().

std::vector<Function*> EDoc::Function::derived_virtuals

A list of functions that may be called as a result of a call to this function due to them being matching virtuals in derived classes.

List of functions that when this function is called it could result in any of the functions in this list being called as they belong in derived children and this function is virtual.

See also:
See also virt_func_fallthrough

Definition at line 421 of file Function.h.

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

std::vector<PropogatingException> EDoc::Function::filtered_exceptions

Is a list of exceptions that would have propogated out this function had they not been filtered out by the exception spec.

This is a list of exceptions that would be filterested out by the throw() specs. There should be an error emitted for each filtered exception encountered. They do not propogate.

See also:
See also exception_spec and has_exception_spec

Definition at line 433 of file Function.h.

Referenced by EDoc::Dictionary::PostProcessExceptions(), EDoc::Dictionary::ProcessFunction(), ReplaceReferences(), and Validate().

std::list<File*> EDoc::Function::referenced_in_files

A list of all source files that this function is used from.

Definition at line 438 of file Function.h.

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

bool EDoc::Function::visible

True if this function is visible to the user or false if it will never be displayed to the user.

This is used for suppressions.

Definition at line 447 of file Function.h.

Referenced by operator=().

Exception* EDoc::Function::subst_exception

The subst exception for this function.

See also:
GetSubstException()

Definition at line 454 of file Function.h.

Referenced by GetSubstException(), and ~Function().

int EDoc::Function::total_calls

USED ONLY FROM Dictionary::CalculatePropogatingExceptions().

This is used as temporary storage while determining the callgraph complexity of all functions. Realistically this data does not belong here and should be placed elsewhere but as a speed optimisation it is placed here.

Definition at line 466 of file Function.h.

Referenced by EDoc::LessThanCallComplexity(), and Print().

std::set<Function*>* EDoc::Function::circular

USED ONLY FROM.

This is used as a temporary cache of information and is calculated at the same time as total_calls. If it has a reference to a instance then this function is marked as being part of a circular call-graph.

The memory for the instance of the std::set is shared among all Function instances that are part of the circle. Thus when the last of the function instances is deleted then the std::set instance is also deleted.

See RemoveFromCircular()

Definition at line 482 of file Function.h.

Referenced by EDoc::CalculateTotalFunctionCalls(), EDoc::Dictionary::GenerateExceptions(), GetCircleSet(), EDoc::Dictionary::HandleCircularCallgraph(), IsCircular(), EDoc::LessThanCallComplexity(), Print(), EDoc::Dictionary::ProcessFunction(), RemoveFromCircular(), ReplaceReferences(), and Validate().

OnProcessedFP EDoc::Function::on_processed

Callback function pointer (See SetOnProcessed()).

Definition at line 512 of file Function.h.

Referenced by SetOnProcessed().

void* EDoc::Function::on_processed_data

Callback function pointers data (See SetOnProcessed()).

Definition at line 517 of file Function.h.

Referenced by SetOnProcessed().

bool EDoc::StringIdentifiedObject::populated [protected, inherited]

True if this object has been completely populated.

Definition at line 176 of file StringIdentifiedObject.h.

Referenced by EDoc::Dictionary::GeneratePredefined(), EDoc::StringIdentifiedObject::IsPopulated(), EDoc::Type::Merge(), EDoc::FunctionType::Merge(), Merge(), EDoc::File::Merge(), EDoc::Type::operator=(), EDoc::FunctionType::operator=(), operator=(), EDoc::Type::Read(), EDoc::FunctionType::Read(), Read(), EDoc::File::Read(), EDoc::Type::Validate(), EDoc::FunctionType::Validate(), and Validate().

int32_t EDoc::StringIdentifiedObject::index [mutable, protected, inherited]

Set to the integer index used to identify this object or -1 if the key_name is used to identify this object.

Definition at line 182 of file StringIdentifiedObject.h.

Referenced by EDoc::IndexedObject::CAdd(), EDoc::Dictionary::GeneratePredefined(), EDoc::StringIdentifiedObject::GetIndex(), EDoc::StringIdentifiedObject::GetKeyName(), EDoc::StringIdentifiedObject::SetKeyName(), EDoc::Type::Validate(), EDoc::FunctionType::Validate(), Validate(), and EDoc::File::Validate().

std::string EDoc::StringIdentifiedObject::key_name [protected, inherited]

Set to the string key used to identify this object.

Definition at line 187 of file StringIdentifiedObject.h.

Referenced by EDoc::Dictionary::GeneratePredefined(), EDoc::StringIdentifiedObject::GetKeyName(), EDoc::StringIdentifiedObject::SetKeyName(), EDoc::Type::Validate(), EDoc::FunctionType::Validate(), Validate(), and EDoc::File::Validate().

bool EDoc::StringIdentifiedObject::writing [mutable, protected, inherited]

USED ONLY FROM Dictionary::Write().

While writing an object to file it is possible to use both the objects integer and string keys. This is the only time that is allowable and this flag is used to determine that.

Definition at line 204 of file StringIdentifiedObject.h.

Referenced by EDoc::StringIdentifiedObject::GetKeyName().

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(), ExpandCallGraph(), EDoc::CodeBlock::ExpandCallGraph(), EDoc::FunctionLoc::FunctionLoc(), EDoc::FunctionTypeLoc::FunctionTypeLoc(), GetSubstException(), EDoc::Location::Location(), EDoc::ManagedObject::ManagedObject(), EDoc::Type::Merge(), EDoc::Location::Merge(), 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=(), operator=(), EDoc::Exception::operator=(), EDoc::CodeBlock::operator=(), EDoc::PropogatingException::PropogatingException(), EDoc::TryBlock::Read(), 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(), Validate(), EDoc::File::Validate(), EDoc::Exception::Validate(), EDoc::CodeBlock::Validate(), EDoc::CatchBlock::Validate(), EDoc::Type::Write(), and 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