Public Member Functions | Private Attributes | List of all members
GenericsSDict Class Reference

#include <classlist.h>

Public Member Functions

 GenericsSDict ()
 
 ~GenericsSDict ()
 
void insert (const QCString &key, ClassDef *cd)
 
ClassDeffind (const QCString &key)
 

Private Attributes

SDict< GenericsCollectionm_dict
 

Detailed Description

Definition at line 76 of file classlist.h.

Constructor & Destructor Documentation

GenericsSDict::GenericsSDict ( )
inline

Definition at line 79 of file classlist.h.

79 : m_dict(17) { m_dict.setAutoDelete(TRUE); }
SDict< GenericsCollection > m_dict
Definition: classlist.h:84
void setAutoDelete(bool val)
Definition: sortdict.h:222
const bool TRUE
Definition: qglobal.h:371
GenericsSDict::~GenericsSDict ( )
inline

Definition at line 80 of file classlist.h.

80 {}

Member Function Documentation

ClassDef * GenericsSDict::find ( const QCString key)

Definition at line 183 of file classlist.cpp.

184 {
185  int i=key.find('<');
186  if (i==-1)
187  {
188  GenericsCollection *collection = m_dict.find(key);
189  if (collection && collection->count()==1)
190  {
191  QIntDictIterator<ClassDef> it(*collection);
192  return it.current();
193  }
194  }
195  else
196  {
197  GenericsCollection *collection = m_dict.find(key.left(i));
198  if (collection)
199  {
200  ArgumentList argList;
201  stringToArgumentList(key.mid(i),&argList);
202  int c = argList.count();
203  return collection->find(c);
204  }
205  }
206  return 0;
207 }
uint count() const
Definition: qintdict.h:54
This class represents an function or template argument list.
Definition: arguments.h:82
SDict< GenericsCollection > m_dict
Definition: classlist.h:84
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
uint count() const
Definition: qlist.h:66
void stringToArgumentList(const char *argsString, ArgumentList *al, QCString *extraTypeChars)
Definition: defargs.cpp:2922
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
T * find(const char *key)
Definition: sortdict.h:232
type * find(long k) const
Definition: qintdict.h:63
void GenericsSDict::insert ( const QCString key,
ClassDef cd 
)

Definition at line 163 of file classlist.cpp.

164 {
165  int i=key.find('<');
166  if (i==-1) return;
167  ArgumentList argList;
168  stringToArgumentList(key.mid(i),&argList);
169  int c = argList.count();
170  if (c==0) return;
171  GenericsCollection *collection = m_dict.find(key.left(i));
172  if (collection==0) // new name
173  {
174  collection = new GenericsCollection;
175  m_dict.append(key.left(i),collection);
176  }
177  if (collection->find(c)==0) // should always be 0!
178  {
179  collection->insert(c,cd);
180  }
181 }
This class represents an function or template argument list.
Definition: arguments.h:82
SDict< GenericsCollection > m_dict
Definition: classlist.h:84
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
void append(const char *key, const T *d)
Definition: sortdict.h:135
uint count() const
Definition: qlist.h:66
void insert(long k, const type *d)
Definition: qintdict.h:57
void stringToArgumentList(const char *argsString, ArgumentList *al, QCString *extraTypeChars)
Definition: defargs.cpp:2922
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
T * find(const char *key)
Definition: sortdict.h:232
type * find(long k) const
Definition: qintdict.h:63

Member Data Documentation

SDict<GenericsCollection> GenericsSDict::m_dict
private

Definition at line 84 of file classlist.h.


The documentation for this class was generated from the following files: