Buteo Synchronization Framework
|
ProfileFactory handles creating Profile instances. More...
#include <ProfileFactory.h>
Public Member Functions | |
ProfileFactory () | |
Constructor. | |
Profile * | createProfile (const QString &aName, const QString &aType) |
Creates an empty profile with the given name and type. | |
Profile * | createProfile (const QDomElement &aRoot) |
Creates a profile from XML. | |
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.
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.
aRoot | Root element of the profile XML. |
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.
aName | Name of the profile. |
aType | Type of the profile. |