Buteo Synchronization Framework
Public Member Functions | List of all members
Buteo::ProfileFactory Class Reference

ProfileFactory handles creating Profile instances. More...

#include <ProfileFactory.h>

Public Member Functions

 ProfileFactory ()
 Constructor.
 
ProfilecreateProfile (const QString &aName, const QString &aType)
 Creates an empty profile with the given name and type.
 
ProfilecreateProfile (const QDomElement &aRoot)
 Creates a profile from XML.
 

Detailed Description

ProfileFactory handles creating Profile instances.

ProfileFactory knows all the classed derived from the Profile class and creates an instance of a correct class based on the profile type given as a parameter for the create function. By using the ProfileFactory it is possible to create profiles from a component that is not aware of the different derived profile classes, especially from the Profile class itself.

Member Function Documentation

◆ createProfile() [1/2]

Profile * ProfileFactory::createProfile ( const QDomElement & aRoot)

Creates a profile from XML.

An instance of the correct class derived from Profile is created based on the profile type read from XML. If the type is not recognizer as a specific derived class, an instance of the Profile base class is created.

Parameters
aRootRoot element of the profile XML.
Returns
Created profile.

◆ createProfile() [2/2]

Profile * ProfileFactory::createProfile ( const QString & aName,
const QString & aType )

Creates an empty profile with the given name and type.

An instance of the correct class derived from Profile is created based on the given profile type. If the type is not recognizer as a specific derived class, an instance of the Profile base class is created.

Parameters
aNameName of the profile.
aTypeType of the profile.
Returns
The created profile.

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