EDoc::ManagedObject Class Reference

#include <include/EDoc/ManagedObject.h>

Inheritance diagram for EDoc::ManagedObject:

EDoc::DictionarySpecific EDoc::SpecificManagedObject< T >

Detailed Description

Generic representation for a collection of StringIdentifiedObject instances.

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

Protected Attributes

Dictionarydict
 A reference to the dictionary this object belongs to.


Constructor & Destructor Documentation

EDoc::ManagedObject::ManagedObject ( EDoc::Dictionary dict_in  ) 

Constructor.

Note:
EDoc++ data included.

Definition at line 89 of file ManagedObject.cpp.

References EDoc::DictionarySpecific::dict, and EDOC_ASSERT.

EDoc::ManagedObject::~ManagedObject (  )  [inline, virtual]

Destructor.

Note:
EDoc++ data included.

Definition at line 73 of file ManagedObject.h.


Member Function Documentation

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

Assignment operator.

Note:
EDoc++ data included.

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

Note:
EDoc++ data included.

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

Note:
EDoc++ data included.

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

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 items.

EDoc::ManagedObject::EraseAll (  ) 

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 items.

EDoc::ManagedObject::CGet ( std::string  name  )  [inline]

Common : get instance from key name.

Note:
EDoc++ data included.

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.

Note:
EDoc++ data included.

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.

Note:
EDoc++ data included.

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

Note:
EDoc++ data included.

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


Field Documentation

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


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