#include <sortdict.h>
Public Member Functions | |
SDict (int size) | |
virtual | ~SDict () |
void | append (const char *key, const T *d) |
void | prepend (const char *key, const T *d) |
bool | remove (const char *key) |
T * | take (const char *key) |
void | sort () |
void | inSort (const char *key, const T *d) |
void | setAutoDelete (bool val) |
T * | find (const char *key) |
T * | find (const QCString &key) |
T * | find (const QString &key) |
T * | operator[] (const char *key) const |
T * | at (uint i) |
virtual int | compareItems (GCI item1, GCI item2) |
void | clear () |
int | count () const |
Friends | |
class | Iterator |
class | IteratorDict |
Classes | |
class | Iterator |
class | IteratorDict |
Definition at line 98 of file sortdict.h.
Create an ordered dictionary.
size | The size of the dictionary. Should be a prime number for best distribution of elements. |
Definition at line 110 of file sortdict.h.
Destroys the dictionary
Definition at line 122 of file sortdict.h.
void SDict< T >::append | ( | const char * | key, | |
const T * | d | |||
) | [inline] |
Appends an element to the dictionary. The element is owned by the dictionary.
key | The unique key to use to quicky find the item later on. | |
d | The compound to add. |
Definition at line 134 of file sortdict.h.
Referenced by GroupDef::addClass(), addDefine(), GroupDef::addExample(), DocSets::addIndexItem(), PageDef::addInnerCompound(), NamespaceDef::addInnerCompound(), ClassDef::addMembersToTemplateInstance(), GroupDef::addNamespace(), GroupDef::addPage(), addRelatedPage(), NamespaceDef::addUsingDeclaration(), FileDef::addUsingDeclaration(), NamespaceDef::addUsingDirective(), FileDef::addUsingDirective(), PyVariableContext::addVariable(), VariableContext::addVariable(), NamespaceDef::insertClass(), FileDef::insertClass(), GroupDef::insertMember(), NamespaceDef::insertNamespace(), FileDef::insertNamespace(), ClassDef::mergeCategory(), ClassDef::mergeMembers(), MemberDef::setSectionList(), unmarshalMemberLists(), writeDotDirDepGraph(), and VhdlDocGen::writePlainVHDLDeclarations().
void SDict< T >::prepend | ( | const char * | key, | |
const T * | d | |||
) | [inline] |
Prepends an element to the dictionary. The element is owned by the dictionary.
key | The unique key to use to quicky find the item later on. | |
d | The compound to add. |
Definition at line 152 of file sortdict.h.
Referenced by FileDef::addIncludedUsingDirectives().
bool SDict< T >::remove | ( | const char * | key | ) | [inline] |
Remove an item from the dictionary
Definition at line 165 of file sortdict.h.
Referenced by endUseScope(), and GroupDef::removeMember().
T* SDict< T >::take | ( | const char * | key | ) | [inline] |
Take an item out of the dictionary without deleting it
Definition at line 172 of file sortdict.h.
void SDict< T >::sort | ( | ) | [inline] |
Sorts the members of the dictionary. First appending a number of members and then sorting them is faster (O(NlogN) than using inSort() for each member (O(N^2)).
Definition at line 187 of file sortdict.h.
Referenced by parseInput(), and writeGroupHierarchy().
void SDict< T >::inSort | ( | const char * | key, | |
const T * | d | |||
) | [inline] |
Inserts a compound into the dictionary in a sorted way.
key | The unique key to use to quicky find the item later on. | |
d | The compound to add. |
Definition at line 196 of file sortdict.h.
Referenced by GroupDef::addClass(), MemberDef::addExample(), ClassDef::addExample(), UsedDir::addFileDep(), ClassDef::addInnerCompound(), GroupDef::addNamespace(), Definition::addSourceReferencedBy(), Definition::addSourceReferences(), NamespaceDef::insertClass(), FileDef::insertClass(), NamespaceDef::insertNamespace(), FileDef::insertNamespace(), unmarshalExampleSDict(), and unmarshalMemberSDict().
void SDict< T >::setAutoDelete | ( | bool | val | ) | [inline] |
Indicates whether or not the dictionary owns its elements
Definition at line 209 of file sortdict.h.
Referenced by ClassDef::addExample(), ClassDef::mergeMembers(), parseInput(), and UsedDir::UsedDir().
T* SDict< T >::find | ( | const char * | key | ) | [inline] |
Looks up a compound given its key.
key | The key to identify this element. |
Definition at line 219 of file sortdict.h.
Referenced by accessibleViaUsingNamespace(), GroupDef::addClass(), addClassToGroups(), addDefine(), addDirToGroups(), MemberDef::addExample(), ClassDef::addExample(), addExampleToGroups(), addGroupToGroups(), FileDef::addIncludedUsingDirectives(), DocSets::addIndexItem(), ClassDef::addMembersToTemplateInstance(), addMemberToGroups(), GroupDef::addNamespace(), addNamespaceToGroups(), Definition::addSourceReferencedBy(), Definition::addSourceReferences(), NamespaceDef::addUsingDeclaration(), FileDef::addUsingDeclaration(), NamespaceDef::addUsingDirective(), FileDef::addUsingDirective(), VariableContext::addVariable(), buildDirectories(), DotNode::deleteNode(), UsedDir::findFilePair(), NamespaceDef::findInnerCompound(), ClassDef::findInnerCompound(), PyVariableContext::findVariable(), VariableContext::findVariable(), VhdlDocGen::getClass(), getClass(), getDefs(), ClassDef::getMemberByName(), getResolvedNamespace(), MemberDef::getSectionList(), getTemplateArgumentsFromName(), NamespaceDef::insertClass(), NamespaceDef::insertNamespace(), FileDef::insertNamespace(), ClassDef::mergeCategory(), ClassDef::mergeMembers(), GroupDef::removeMember(), resolveRef(), resolveTypeDef(), and VhdlDocGen::writePlainVHDLDeclarations().
T* SDict< T >::find | ( | const QCString & | key | ) | [inline] |
Definition at line 223 of file sortdict.h.
T* SDict< T >::find | ( | const QString & | key | ) | [inline] |
Definition at line 227 of file sortdict.h.
T* SDict< T >::operator[] | ( | const char * | key | ) | const [inline] |
Equavalent to find().
Definition at line 233 of file sortdict.h.
T* SDict< T >::at | ( | uint | i | ) | [inline] |
Returns the item at position i in the sorted dictionary
Definition at line 239 of file sortdict.h.
Referenced by writeExample().
virtual int SDict< T >::compareItems | ( | GCI | item1, | |
GCI | item2 | |||
) | [inline, virtual] |
Function that is used to compare two items when sorting. Overload this to properly sort items.
Reimplemented in ClassSDict, FilePairDict, DirSDict, ExampleSDict, GroupSDict, MemberSDict, MemberNameSDict, MemberNameInfoSDict, NamespaceSDict, and PageSDict.
Definition at line 248 of file sortdict.h.
void SDict< T >::clear | ( | ) | [inline] |
Clears the dictionary. Will delete items if setAutoDelete() was set to TRUE
.
Definition at line 257 of file sortdict.h.
Referenced by PyVariableContext::clear(), VariableContext::clear(), clearAll(), and VhdlDocGen::writePlainVHDLDeclarations().
int SDict< T >::count | ( | ) | const [inline] |
Returns the number of items stored in the dictionary
Definition at line 265 of file sortdict.h.
Referenced by DotGroupCollaboration::buildGraph(), NamespaceDef::countMembers(), GroupDef::countMembers(), getResolvedClassRec(), MemberDef::hasExamples(), ClassDef::hasExamples(), PageDef::hasSubPages(), marshalExampleSDict(), marshalMemberLists(), marshalMemberSDict(), GroupDef::writeDetailedDocumentation(), FileDef::writeDocumentation(), writeDotDirDepGraph(), writeExample(), and writeGroupTreeNode().
friend class Iterator [friend] |
Definition at line 270 of file sortdict.h.
friend class IteratorDict [friend] |
Definition at line 334 of file sortdict.h.