#include <include/EDoc/SpecificManagedObject.h>
Inheritance diagram for EDoc::SpecificManagedObject< T >:
Where ManagedObject is a generic container for StringIdentifiedObject's this class is a container providing the same functionality but for specific class types that derive from StringIdentifiedObject. For example this is can contain types: File, Type, FunctionType, Function.
Definition at line 38 of file SpecificManagedObject.h.
Public Member Functions | |
SpecificManagedObject (Dictionary &dict_in) | |
See ManagedObject::ManagedObject(). | |
SpecificManagedObject & | operator= (const SpecificManagedObject &right) |
See ManagedObject::operator=(). | |
virtual StringIdentifiedObjectPtr | New (Dictionary &dict, std::string name) |
Creates a new instance of the particular derived type that this container manages. | |
T * | Get (std::string name) |
See ManagedObject::CGet(). | |
const T * | Get (std::string name) const |
See ManagedObject::CGet(). | |
T * | AlwaysGet (std::string name) |
See ManagedObject::CAlwaysGet(). | |
T * | AlwaysGet (const T &right) |
See ManagedObject::CAlwaysGet(). | |
std::map< std::string, T * > | GetItems () |
Gets a map of the objects using their derived type. | |
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. | |
const StringIdentifiedObjectPtr | CGet (std::string name) const |
See CGet(). | |
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. | |
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::SpecificManagedObject< T >::SpecificManagedObject | ( | Dictionary & | dict_in | ) | [inline] |
SpecificManagedObject& EDoc::SpecificManagedObject< T >::operator= | ( | const SpecificManagedObject< T > & | right | ) | [inline] |
EDoc::SpecificManagedObject< T >::New | ( | Dictionary & | dict, | |
std::string | name | |||
) | [inline, virtual] |
Creates a new instance of the particular derived type that this container manages.
Implements EDoc::ManagedObject.
Definition at line 63 of file SpecificManagedObject.h.
EDoc::SpecificManagedObject< T >::Get | ( | std::string | name | ) | [inline] |
const T* EDoc::SpecificManagedObject< T >::Get | ( | std::string | name | ) | const [inline] |
EDoc::SpecificManagedObject< T >::AlwaysGet | ( | std::string | name | ) | [inline] |
See ManagedObject::CAlwaysGet().
Definition at line 90 of file SpecificManagedObject.h.
EDoc::SpecificManagedObject< T >::AlwaysGet | ( | const T & | right | ) | [inline] |
See ManagedObject::CAlwaysGet().
Definition at line 98 of file SpecificManagedObject.h.
std::map<std::string, T*> EDoc::SpecificManagedObject< T >::GetItems | ( | ) | [inline] |
Gets a map of the objects using their derived type.
NOTE: Was specifically created for use from python.
This is not efficient, but will do. Changes made to the resulting map will not change the internal map only changes made to the objects themselves will have any lasting effect.
This means that from python erasing items from this map will not remove them from the resulting SpecificManagedObject instance.
Definition at line 115 of file SpecificManagedObject.h.
EDoc::ManagedObject::ReplaceReferences | ( | EDoc::PStack & | stack, | |
void * | remove, | |||
void * | replace | |||
) | [virtual, inherited] |
See DictionarySpecific::ReplaceReferences().
Implements EDoc::DictionarySpecific.
Definition at line 105 of file ManagedObject.cpp.
References EDOC_FOREACH, and EDoc::ManagedObject::items.
EDoc::ManagedObject::Print | ( | std::ostream & | out, | |
std::string | prefix = "" | |||
) | const [virtual, inherited] |
See DictionarySpecific::Print().
Implements EDoc::DictionarySpecific.
Definition at line 134 of file ManagedObject.cpp.
References EDOC_FOREACH_CONST, and EDoc::ManagedObject::items.
EDoc::ManagedObject::Validate | ( | EDoc::PStack & | stack, | |
const Dictionary & | dict_in | |||
) | const [virtual, inherited] |
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 EDoc::ManagedObject::items.
EDoc::ManagedObject::EraseAll | ( | ) | [inherited] |
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 EDoc::ManagedObject::items.
EDoc::ManagedObject::CGet | ( | std::string | name | ) | [inline, inherited] |
Common : get instance from key name.
Definition at line 115 of file ManagedObject.h.
References EDoc::ManagedObject::items.
Referenced by EDoc::ManagedObject::CAlwaysGet(), EDoc::ManagedObject::CGet(), and EDoc::SpecificManagedObject< EDoc::Type >::Get().
EDoc::ManagedObject::CGet | ( | std::string | name | ) | const [inline, inherited] |
See CGet().
Definition at line 158 of file ManagedObject.h.
References EDoc::ManagedObject::CGet().
EDoc::ManagedObject::CAlwaysGet | ( | std::string | name | ) | [inherited] |
Common : get instance from key name or create new instance if key does not exist.
Definition at line 153 of file ManagedObject.cpp.
References EDoc::ManagedObject::CGet(), EDoc::DictionarySpecific::dict, EDoc::ManagedObject::items, and EDoc::ManagedObject::New().
Referenced by EDoc::SpecificManagedObject< EDoc::Type >::AlwaysGet(), and EDoc::ManagedObject::CAlwaysGet().
EDoc::ManagedObject::CAlwaysGet | ( | const StringIdentifiedObject & | right | ) | [inherited] |
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 EDoc::ManagedObject::CAlwaysGet(), EDoc::DictionarySpecific::dict, and EDoc::StringIdentifiedObject::GetKeyName().
EDoc::ManagedObject::CRemove | ( | StringIdentifiedObjectPtr | right | ) | [inherited] |
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 EDoc::ManagedObject::items.
EDoc::ManagedObject::CAdd | ( | StringIdentifiedObjectPtr | right | ) | [inherited] |
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 EDoc::ManagedObject::items.
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 [inherited] |
Maps unique string idenitifcation keys to object instances.
Definition at line 173 of file ManagedObject.h.
Referenced by EDoc::ManagedObject::CAdd(), EDoc::ManagedObject::CAlwaysGet(), EDoc::ManagedObject::CGet(), EDoc::ManagedObject::CRemove(), EDoc::ManagedObject::EraseAll(), EDoc::SpecificManagedObject< EDoc::Type >::GetItems(), EDoc::ManagedObject::Print(), EDoc::ManagedObject::ReplaceReferences(), and EDoc::ManagedObject::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 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=(), 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(), EDoc::CatchBlock::Validate(), EDoc::Type::Write(), and EDoc::Function::Write().