DiagramElementFactory Class Reference

The DiagramElementFactory class creates AbstractDiagramElement objects for ElementDoc objects. More...

#include <diagramelementfactory.h>

List of all members.

Static Public Member Functions

static AbstractDiagramElementcreate (MvcDiagram::ElementType type, qint32 instanceId, ElementDoc *parent)
static AbstractDiagramElementcreate (MvcDiagram::ElementType type, ElementDoc *parent)
static AbstractDiagramElementcreate (const QByteArray &key, qint32 instanceId, ElementDoc *parent)
static AbstractDiagramElementcreate (const QByteArray &key, ElementDoc *parent)
static const QList< QByteArray > & keys ()
static int type (const QByteArray &key)
static const QString & title (const QByteArray &key)


Detailed Description

The DiagramElementFactory class creates AbstractDiagramElement objects for ElementDoc objects.

Note that QByteArray is more than enough for keys. There is no need for QString, and we definitely don't want the keys to be language dependant.

Also on the topic of QByteArray, from the Qt 4.0.0 documentation: "Using QByteArray is much more convenient than using const char *. Behind the scenes, it always ensures that the data is followed by a '\0' terminator, and uses implicit sharing (copy-on-write) to reduce memory usage and avoid needless copying of data."


Member Function Documentation

AbstractDiagramElement * DiagramElementFactory::create ( MvcDiagram::ElementType  type,
qint32  instanceId,
ElementDoc parent 
) [static]

AbstractDiagramElement * DiagramElementFactory::create ( MvcDiagram::ElementType  type,
ElementDoc parent 
) [static]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

The new element's instance ID will be automatically generated using ElementDoc::genElementInstanceId().

Asserts that parent is non-null.

AbstractDiagramElement * DiagramElementFactory::create ( const QByteArray &  key,
qint32  instanceId,
ElementDoc parent 
) [static]

Note: This method is (intentionally) NOT case sensitive when it performs the key matching.

AbstractDiagramElement * DiagramElementFactory::create ( const QByteArray &  key,
ElementDoc parent 
) [static]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

The new element's instance ID will be automatically generated using ElementDoc::genElementInstanceId().

Asserts that parent is non-null.

const QList< QByteArray > & DiagramElementFactory::keys (  )  [static]

Warning! This method is not thread-safe until it returns from the first call.

int DiagramElementFactory::type ( const QByteArray &  key  )  [static]

const QString & DiagramElementFactory::title ( const QByteArray &  key  )  [static]


The documentation for this class was generated from the following files:
Generated on Mon Jul 30 09:46:52 2007 for Digest by  doxygen 1.5.2