ISLEman
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QCollection Class Referenceabstract

The QCollection class is the base class of all Qt collections. More...

#include <qcollection.h>

Inheritance diagram for QCollection:
QGCache QGDict QGList QGVector QCache< type > QCache< LookupInfo > QAsciiDict< type > QCDict QIntDict< type > QIntDict< char > QIntDict< ClassDef > QIntDict< Definition > QIntDict< MemberDef > QIntDict< MemberGroup > QIntDict< MemberGroupInfo > QIntDict< RefItem > QIntDict< SearchIndexList > QIntDict< T > QIntDict< uint > QIntDict< URL > QIntDict< URLInfo > QPtrDict< type > QInternalList< type > QInternalList< QCacheItem > QInternalList< QGDictIterator > QInternalList< QWaitConditionEvent > QList< type > QList< ActiveRowSpan > QList< AlphaIndexTableCell > QList< AlphaIndexTableRows > QList< Argument > QList< ArgumentList > QList< BaseClassDef > QList< BaseInfo > QList< ClassDef > QList< ConfigOption > QList< Define > QList< DefineName > QList< Definition > QList< DiagramItem > QList< DiagramRow > QList< DirDef > QList< DirEntry > QList< DirRelation > QList< DocNode > QList< DocPara > QList< DotConstString > QList< DotFilePatcher > QList< DotFilePatcher::Map > QList< DotGroupCollaboration::Edge > QList< DotGroupCollaboration::Link > QList< DotNode > QList< DotRunner > QList< DotRunner::CleanupItem > QList< DotWorkerThread > QList< EdgeInfo > QList< Entry > QList< EntryNav > QList< Example > QList< ExprAst > QList< FileDef > QList< FileList > QList< FileName > QList< FilePair > QList< FlowChart > QList< Formula > QList< FTVNode > QList< GenericsCollection > QList< GroupDef > QList< Grouping > QList< GuardedNodes > QList< HtmlAttrib > QList< IncludeEntry > QList< IncludeInfo > QList< IndexField > QList< IndexIntf > QList< LayoutDocEntry > QList< LayoutNavEntry > QList< ListElem > QList< ListItemInfo > QList< Mapping > QList< MemberDef > QList< MemberGroup > QList< MemberInfo > QList< MemberList > QList< MemberName > QList< MemberNameInfo > QList< NamespaceDef > QList< NavIndexEntry > QList< NodeDef > QList< OutputGenerator > QList< PageDef > QList< QCString > QList< QDict< TemplateVariant > > QList< RefItem > QList< SearchDefinitionList > QList< SearchDocEntry > QList< SearchIndexList > QList< SectionInfo > QList< stat > QList< T > QList< TagAnchorInfo > QList< TagClassInfo > QList< TagDirInfo > QList< TagEnumValueInfo > QList< TagFileInfo > QList< TagGroupInfo > QList< TagIncludeInfo > QList< TagMemberInfo > QList< TagNamespaceInfo > QList< TagPackageInfo > QList< TagPageInfo > QList< TemplateNode > QList< TemplateToken > QList< TemplateVariant > QList< uint > QList< void > QQueue< type > QQueue< DotRunner > QStack< type > QStack< bool > QStack< DocNode > QStack< DocStyleChange > QStack< PerlModOutputStream > QStack< State > QStack< TableState > QVector< type > QVector< QList< IndexWord > >

Public Types

typedef void * Item
 

Public Member Functions

bool autoDelete () const
 
void setAutoDelete (bool enable)
 
virtual uint count () const =0
 
virtual void clear ()=0
 

Protected Member Functions

 QCollection ()
 
 QCollection (const QCollection &)
 
virtual ~QCollection ()
 
virtual Item newItem (Item)
 
virtual void deleteItem (Item)
 

Protected Attributes

bool del_item
 

Detailed Description

The QCollection class is the base class of all Qt collections.

The QCollection class is an abstract base class for the Qt collection classes QDict, QList etc. via QGDict, QGList etc.

A QCollection knows only about the number of objects in the collection and the deletion strategy (see setAutoDelete()).

A collection is implemented using the Item (generic collection item) type, which is a void*. The template classes that create the real collections cast the Item to the required type.

See also
Collection Classes

Constructor & Destructor Documentation

§ QCollection() [1/2]

QCollection::QCollection ( )
inlineprotected

Constructs a collection. The constructor is protected because QCollection is an abstract class.

§ QCollection() [2/2]

QCollection::QCollection ( const QCollection source)
inlineprotected

Constructs a copy of source with autoDelete() set to FALSE. The constructor is protected because QCollection is an abstract class.

Note that if source has autoDelete turned on, copying it is a good way to get memory leaks, reading freed memory, or both.

§ ~QCollection()

QCollection::~QCollection ( )
inlineprotectedvirtual

Destroys the collection. The destructor is protected because QCollection is an abstract class.

Member Function Documentation

§ autoDelete()

bool QCollection::autoDelete ( ) const
inline

Returns the setting of the auto-delete option (default is FALSE).

See also
setAutoDelete()

§ clear()

void QCollection::clear ( )
pure virtual

Removes all objects from the collection. The objects will be deleted if auto-delete has been enabled.

See also
setAutoDelete()

Implemented in QGDict, QGList, QCache< type >, QCache< LookupInfo >, QList< type >, QList< MemberName >, QList< MemberNameInfo >, QList< PageDef >, QList< DocNode >, QList< TagFileInfo >, QList< Grouping >, QList< ListItemInfo >, QList< QCString >, QList< Definition >, QList< MemberDef >, QList< TagPackageInfo >, QList< DirRelation >, QList< DotNode >, QList< HtmlAttrib >, QList< TagPageInfo >, QList< Entry >, QList< IndexIntf >, QList< MemberGroup >, QList< DiagramItem >, QList< DotGroupCollaboration::Link >, QList< TagDirInfo >, QList< EntryNav >, QList< IncludeInfo >, QList< DotFilePatcher >, QList< stat >, QList< TagNamespaceInfo >, QList< TemplateVariant >, QList< MemberInfo >, QList< TagGroupInfo >, QList< DotWorkerThread >, QList< ExprAst >, QList< TemplateNode >, QList< NamespaceDef >, QList< T >, QList< void >, QList< OutputGenerator >, QList< QDict< TemplateVariant > >, QList< GroupDef >, QList< IndexField >, QList< ListElem >, QList< DotConstString >, QList< DotRunner::CleanupItem >, QList< Formula >, QList< TemplateToken >, QList< GenericsCollection >, QList< DotGroupCollaboration::Edge >, QList< TagIncludeInfo >, QList< ActiveRowSpan >, QList< FilePair >, QList< ClassDef >, QList< IncludeEntry >, QList< GuardedNodes >, QList< Define >, QList< BaseClassDef >, QList< EdgeInfo >, QList< NodeDef >, QList< TagMemberInfo >, QList< DotRunner >, QList< RefItem >, QList< FileName >, QList< SearchDocEntry >, QList< FlowChart >, QList< SearchDefinitionList >, QList< SectionInfo >, QList< DocPara >, QList< ConfigOption >, QList< LayoutNavEntry >, QList< uint >, QList< AlphaIndexTableCell >, QList< DefineName >, QList< DirEntry >, QList< MemberList >, QList< LayoutDocEntry >, QList< Argument >, QList< TagAnchorInfo >, QList< FileList >, QList< FileDef >, QList< TagClassInfo >, QList< DotFilePatcher::Map >, QList< ArgumentList >, QList< FTVNode >, QList< BaseInfo >, QList< Mapping >, QList< TagEnumValueInfo >, QList< SearchIndexList >, QList< DiagramRow >, QList< AlphaIndexTableRows >, QList< NavIndexEntry >, QList< Example >, QList< DirDef >, QGVector, QInternalList< type >, QInternalList< QGDictIterator >, QInternalList< QWaitConditionEvent >, QInternalList< QCacheItem >, QGCache, QAsciiDict< type >, QIntDict< type >, QPtrDict< type >, QIntDict< MemberDef >, QIntDict< Definition >, QIntDict< MemberGroup >, QIntDict< T >, QIntDict< MemberGroupInfo >, QIntDict< URL >, QIntDict< URLInfo >, QIntDict< ClassDef >, QIntDict< RefItem >, QIntDict< char >, QIntDict< uint >, QIntDict< SearchIndexList >, QVector< type >, QVector< QList< IndexWord > >, QQueue< type >, QStack< type >, QQueue< DotRunner >, QStack< DocNode >, QStack< PerlModOutputStream >, QStack< TableState >, QStack< bool >, QStack< DocStyleChange >, and QStack< State >.

§ count()

uint QCollection::count ( ) const
pure virtual

Returns the number of objects in the collection.

Implemented in QGDict, QCache< type >, QCache< LookupInfo >, QGList, QGCache, QGVector, QList< type >, QList< MemberName >, QList< MemberNameInfo >, QList< PageDef >, QList< DocNode >, QList< TagFileInfo >, QList< Grouping >, QList< ListItemInfo >, QList< QCString >, QList< Definition >, QList< MemberDef >, QList< TagPackageInfo >, QList< DirRelation >, QList< DotNode >, QList< HtmlAttrib >, QList< TagPageInfo >, QList< Entry >, QList< IndexIntf >, QList< MemberGroup >, QList< DiagramItem >, QList< DotGroupCollaboration::Link >, QList< TagDirInfo >, QList< EntryNav >, QList< IncludeInfo >, QList< DotFilePatcher >, QList< stat >, QList< TagNamespaceInfo >, QList< TemplateVariant >, QList< MemberInfo >, QList< TagGroupInfo >, QList< DotWorkerThread >, QList< ExprAst >, QList< TemplateNode >, QList< NamespaceDef >, QList< T >, QList< void >, QList< OutputGenerator >, QList< QDict< TemplateVariant > >, QList< GroupDef >, QList< IndexField >, QList< ListElem >, QList< DotConstString >, QList< DotRunner::CleanupItem >, QList< Formula >, QList< TemplateToken >, QList< GenericsCollection >, QList< DotGroupCollaboration::Edge >, QList< TagIncludeInfo >, QList< ActiveRowSpan >, QList< FilePair >, QList< ClassDef >, QList< IncludeEntry >, QList< GuardedNodes >, QList< Define >, QList< BaseClassDef >, QList< EdgeInfo >, QList< NodeDef >, QList< TagMemberInfo >, QList< DotRunner >, QList< RefItem >, QList< FileName >, QList< SearchDocEntry >, QList< FlowChart >, QList< SearchDefinitionList >, QList< SectionInfo >, QList< DocPara >, QList< ConfigOption >, QList< LayoutNavEntry >, QList< uint >, QList< AlphaIndexTableCell >, QList< DefineName >, QList< DirEntry >, QList< MemberList >, QList< LayoutDocEntry >, QList< Argument >, QList< TagAnchorInfo >, QList< FileList >, QList< FileDef >, QList< TagClassInfo >, QList< DotFilePatcher::Map >, QList< ArgumentList >, QList< FTVNode >, QList< BaseInfo >, QList< Mapping >, QList< TagEnumValueInfo >, QList< SearchIndexList >, QList< DiagramRow >, QList< AlphaIndexTableRows >, QList< NavIndexEntry >, QList< Example >, QList< DirDef >, QVector< type >, QVector< QList< IndexWord > >, QInternalList< type >, QQueue< type >, QStack< type >, QInternalList< QGDictIterator >, QInternalList< QWaitConditionEvent >, QInternalList< QCacheItem >, QQueue< DotRunner >, QStack< DocNode >, QStack< PerlModOutputStream >, QStack< TableState >, QStack< bool >, QStack< DocStyleChange >, QStack< State >, QAsciiDict< type >, QIntDict< type >, QPtrDict< type >, QIntDict< MemberDef >, QIntDict< Definition >, QIntDict< MemberGroup >, QIntDict< T >, QIntDict< MemberGroupInfo >, QIntDict< URL >, QIntDict< URLInfo >, QIntDict< ClassDef >, QIntDict< RefItem >, QIntDict< char >, QIntDict< uint >, QIntDict< SearchIndexList >, and MemberList.

§ deleteItem()

void QCollection::deleteItem ( Item  d)
protectedvirtual

Virtual function that deletes an item that is about to be removed from the collection.

The default implementation deletes d pointer if and only if auto-delete has been enabled.

This function is always reimplemented in the collection template classes.

Warning
If you reimplement this function you must also reimplement the destructor and call the virtual function clear() from your destructor. This is due to the way virtual functions and destructors work in C++: virtual functions in derived classes cannot be called from a destructor. If you do not do this your deleteItem() function will not be called when the container is destructed.
See also
newItem(), setAutoDelete()

§ newItem()

QCollection::Item QCollection::newItem ( Item  d)
protectedvirtual

Virtual function that creates a copy of an object that is about to be inserted into the collection.

The default implementation returns the d pointer, i.e. no copy is made.

This function is seldom reimplemented in the collection template classes. It is not common practice to make a copy of something that is being inserted.

See also
deleteItem()

§ setAutoDelete()

void QCollection::setAutoDelete ( bool  enable)
inline

Sets the auto-delete option of the collection.

Enabling auto-delete (enable is TRUE) will delete objects that are removed from the collection. This can be useful if the collection has the only reference to the objects. (Note that the object can still be copied using the copy constructor - copying such objects is a good way to get memory leaks, reading freed memory or both.)

Disabling auto-delete (enable is FALSE) will not delete objects that are removed from the collection. This is useful if the objects are part of many collections.

The default setting is FALSE.

See also
autoDelete()

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