#include <include/EDoc/ManagedObject.h>
Inheritance diagram for EDoc::ManagedObject:
This stores the StringIdentifiedObject instances and is the ultimate authority of where to find them. This class will be derived by a template class for each dervied varient of StringIdentifiedObject. Namely File, Type, FunctionType and Function.
This class provides basic functionality for creating new StringIdentifiedObject instances and searchif for existing instances.
Definition at line 61 of file ManagedObject.h.
Public Member Functions | |
ManagedObject (Dictionary &dict_in) | |
Constructor. | |
virtual | ~ManagedObject () |
Destructor. | |
ManagedObject & | operator= (const ManagedObject &right) |
Assignment operator. | |
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(). | |
void | EraseAll () |
Rease all StringIdentifiedObject instances referenced by this contains and the data they use. | |
StringIdentifiedObjectPtr | CGet (std::string name) |
Common : get instance from key name. | |
StringIdentifiedObjectPtr | CAlwaysGet (std::string name) |
Common : get instance from key name or create new instance if key does not exist. | |
StringIdentifiedObjectPtr | CAlwaysGet (const StringIdentifiedObject &right) |
Common : get instance equivilant to right or create new instance if no equivilant to right exists in this collection. | |
void | CRemove (StringIdentifiedObjectPtr right) |
Common : Remove instance equivilant to right. | |
void | CAdd (StringIdentifiedObjectPtr right) |
Add given instance to this collection. | |
const StringIdentifiedObjectPtr | CGet (std::string name) const |
See CGet(). | |
virtual StringIdentifiedObjectPtr | New (Dictionary &dict, std::string name)=0 |
Used to create new instance of particular type of StringIdentifiedObject that this collection manages. | |
std::string | ToString (std::string prefix="") const |
Returns a string representing the current object in a user readable manner. | |
Data Fields | |
std::map< std::string, StringIdentifiedObjectPtr > | items |
Maps unique string idenitifcation keys to object instances. | |
Protected Attributes | |
Dictionary & | dict |
A reference to the dictionary this object belongs to. |
EDoc::ManagedObject::ManagedObject | ( | EDoc::Dictionary & | dict_in | ) |
Constructor.
Definition at line 89 of file ManagedObject.cpp.
References EDoc::DictionarySpecific::dict, and EDOC_ASSERT.
EDoc::ManagedObject::~ManagedObject | ( | ) | [inline, virtual] |
EDoc::ManagedObject::operator= | ( | const ManagedObject & | right | ) |
Assignment operator.
Definition at line 145 of file ManagedObject.cpp.
References EDOC_ASSERT.
Referenced by EDoc::SpecificManagedObject< EDoc::Type >::operator=().
EDoc::ManagedObject::ReplaceReferences | ( | EDoc::PStack & | stack, | |
void * | remove, | |||
void * | replace | |||
) | [virtual] |
See DictionarySpecific::ReplaceReferences().
Implements EDoc::DictionarySpecific.
Definition at line 105 of file ManagedObject.cpp.
References EDOC_FOREACH, and items.
EDoc::ManagedObject::Print | ( | std::ostream & | out, | |
std::string | prefix = "" | |||
) | const [virtual] |
See DictionarySpecific::Print().
Implements EDoc::DictionarySpecific.
Definition at line 134 of file ManagedObject.cpp.
References EDOC_FOREACH_CONST, and items.
EDoc::ManagedObject::Validate | ( | EDoc::PStack & | stack, | |
const Dictionary & | dict_in | |||
) | const [virtual] |
See DictionarySpecific::Validate().
Implements EDoc::DictionarySpecific.
Definition at line 117 of file ManagedObject.cpp.
References EDoc::DictionarySpecific::dict, EDOC_ASSERT, EDOC_Finer, EDOC_FOREACH_CONST, and items.
EDoc::ManagedObject::EraseAll | ( | ) |
Rease all StringIdentifiedObject instances referenced by this contains and the data they use.
Definition at line 95 of file ManagedObject.cpp.
References EDOC_FOREACH, EDoc::Erase(), and items.
EDoc::ManagedObject::CGet | ( | std::string | name | ) | [inline] |
Common : get instance from key name.
Definition at line 115 of file ManagedObject.h.
References items.
Referenced by CAlwaysGet(), CGet(), and EDoc::SpecificManagedObject< EDoc::Type >::Get().
EDoc::ManagedObject::CAlwaysGet | ( | std::string | name | ) |
Common : get instance from key name or create new instance if key does not exist.
Definition at line 153 of file ManagedObject.cpp.
References CGet(), EDoc::DictionarySpecific::dict, items, and New().
Referenced by EDoc::SpecificManagedObject< EDoc::Type >::AlwaysGet(), and CAlwaysGet().
EDoc::ManagedObject::CAlwaysGet | ( | const StringIdentifiedObject & | right | ) |
Common : get instance equivilant to right or create new instance if no equivilant to right exists in this collection.
Definition at line 165 of file ManagedObject.cpp.
References CAlwaysGet(), EDoc::DictionarySpecific::dict, and EDoc::StringIdentifiedObject::GetKeyName().
EDoc::ManagedObject::CRemove | ( | StringIdentifiedObjectPtr | right | ) |
Common : Remove instance equivilant to right.
Throws BugException if equivilant to right does not exist in this collection.
Definition at line 179 of file ManagedObject.cpp.
References EDOC_ASSERT, EDoc::StringIdentifiedObject::GetKeyName(), and items.
EDoc::ManagedObject::CAdd | ( | StringIdentifiedObjectPtr | right | ) |
Add given instance to this collection.
If an equivilant to right already exists in collection will throw a BugException.
Definition at line 189 of file ManagedObject.cpp.
References EDOC_ASSERT, EDoc::StringIdentifiedObject::GetKeyName(), and items.
EDoc::ManagedObject::CGet | ( | std::string | name | ) | const [inline] |
See CGet().
Definition at line 158 of file ManagedObject.h.
References CGet().
EDoc::ManagedObject::New | ( | Dictionary & | dict, | |
std::string | name | |||
) | [pure virtual] |
Used to create new instance of particular type of StringIdentifiedObject that this collection manages.
Implemented in EDoc::SpecificManagedObject< T >, EDoc::SpecificManagedObject< EDoc::File >, EDoc::SpecificManagedObject< EDoc::FunctionType >, EDoc::SpecificManagedObject< EDoc::Function >, and EDoc::SpecificManagedObject< EDoc::Type >.
Referenced by CAlwaysGet().
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().
std::map<std::string, StringIdentifiedObjectPtr> EDoc::ManagedObject::items |
Maps unique string idenitifcation keys to object instances.
Definition at line 173 of file ManagedObject.h.
Referenced by CAdd(), CAlwaysGet(), CGet(), CRemove(), EraseAll(), EDoc::SpecificManagedObject< EDoc::Type >::GetItems(), Print(), 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 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(), 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(), 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().