Buteo Synchronization Framework: Buteo::ProfileFactory Class Reference

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.
Profile * | createProfile (const QString &aName, const QString &aType)
| Creates an empty profile with the given name and type. More...
Profile * | createProfile (const QDomElement &aRoot)
| Creates a profile from XML. More...

## 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

  aRoot | Root 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

  aName | Name of the profile.
  aType | Type of the profile.

Returns
  The created profile.

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

- ProfileFactory.h
- ProfileFactory.cpp