EDoc::SpecificManagedObject< T > Class Template Reference

#include <include/EDoc/SpecificManagedObject.h>

Inheritance diagram for EDoc::SpecificManagedObject< T >:

EDoc::ManagedObject EDoc::DictionarySpecific

Detailed Description

template<typename T>
class EDoc::SpecificManagedObject< T >

Provides a managed container for types that are specifically derived from StringIdentifiedObject.

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().
SpecificManagedObjectoperator= (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, StringIdentifiedObjectPtritems
 Maps unique string idenitifcation keys to object instances.

Protected Attributes

Dictionarydict
 A reference to the dictionary this object belongs to.


Constructor & Destructor Documentation

template<typename T>
EDoc::SpecificManagedObject< T >::SpecificManagedObject ( Dictionary dict_in  )  [inline]

See ManagedObject::ManagedObject().

Definition at line 45 of file SpecificManagedObject.h.


Member Function Documentation

template<typename T>
SpecificManagedObject& EDoc::SpecificManagedObject< T >::operator= ( const SpecificManagedObject< T > &  right  )  [inline]

See ManagedObject::operator=().

Definition at line 53 of file SpecificManagedObject.h.

template<typename T>
EDoc::SpecificManagedObject< T >::New ( Dictionary dict,
std::string  name 
) [inline, virtual]

Creates a new instance of the particular derived type that this container manages.

Note:
EDoc++ data included.

Implements EDoc::ManagedObject.

Definition at line 63 of file SpecificManagedObject.h.

template<typename T>
EDoc::SpecificManagedObject< T >::Get ( std::string  name  )  [inline]

See ManagedObject::CGet().

Note:
EDoc++ data included.

Definition at line 74 of file SpecificManagedObject.h.

template<typename T>
const T* EDoc::SpecificManagedObject< T >::Get ( std::string  name  )  const [inline]

See ManagedObject::CGet().

Definition at line 82 of file SpecificManagedObject.h.

template<typename T>
EDoc::SpecificManagedObject< T >::AlwaysGet ( std::string  name  )  [inline]

See ManagedObject::CAlwaysGet().

Note:
EDoc++ data included.

Definition at line 90 of file SpecificManagedObject.h.

template<typename T>
EDoc::SpecificManagedObject< T >::AlwaysGet ( const T &  right  )  [inline]

See ManagedObject::CAlwaysGet().

Note:
EDoc++ data included.

Definition at line 98 of file SpecificManagedObject.h.

template<typename T>
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().

Note:
EDoc++ data included.

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().

Note:
EDoc++ data included.

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().

Note:
EDoc++ data included.

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.

Note:
EDoc++ data included.

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.

Note:
EDoc++ data included.

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().

Note:
EDoc++ data included.

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.

Note:
EDoc++ data included.

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.

Note:
EDoc++ data included.

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().


Field Documentation

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().


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