Exiv2
|
#include <actions.hpp>
Public Member Functions | |
void | cleanup () |
Destructor. | |
Task::AutoPtr | create (TaskType type) |
Create a task. More... | |
void | registerTask (TaskType type, Task::AutoPtr task) |
Register a task prototype together with its type. More... | |
Static Public Member Functions | |
static TaskFactory & | instance () |
Get access to the task factory. More... | |
Task factory.
Creates an instance of the task of the requested type. The factory is implemented as a singleton, which can be accessed only through the static member function instance().
Task::AutoPtr Action::TaskFactory::create | ( | TaskType | type | ) |
Create a task.
type | Identifies the type of task to create. |
References Action::Task::clone().
|
static |
Get access to the task factory.
Clients access the task factory exclusively through this method.
void Action::TaskFactory::registerTask | ( | TaskType | type, |
Task::AutoPtr | task | ||
) |
Register a task prototype together with its type.
The task factory creates new tasks of a given type by cloning its associated prototype. Additional tasks can be registered. If called for a type which already exists in the list, the corresponding prototype is replaced.
type | Task type. |
task | Pointer to the prototype. Ownership is transfered to the task factory. That's what the auto pointer indicates. |