SPH
|
Helper class, allowing to register job into the global list of jobs. More...
#include <Job.h>
Public Member Functions | |
JobRegistrar (std::string className, std::string category, CreateJobFunc func, std::string tooltip) | |
Registers a new job. More... | |
JobRegistrar (std::string className, std::string shortName, std::string category, CreateJobFunc func, std::string tooltip) | |
Registers a new job. More... | |
Helper class, allowing to register job into the global list of jobs.
This is mainly used by UI controls to get the list of all jobs without having to manually specify them. The expected usage is to create a static variable of this type and pass required strings and callbacks in the constructor.
JobRegistrar::JobRegistrar | ( | std::string | className, |
std::string | category, | ||
CreateJobFunc | func, | ||
std::string | tooltip | ||
) |
Registers a new job.
className | Class name of the job, must be the same as returned by IJob::className. |
category | Name of the job category. |
func | Functor returning a new instance of the job. |
tooltip | Optional description of the job |
JobRegistrar::JobRegistrar | ( | std::string | className, |
std::string | shortName, | ||
std::string | category, | ||
CreateJobFunc | func, | ||
std::string | tooltip | ||
) |
Registers a new job.
className | Class name of the job, must be the same as returned by IJob::className. |
shortName | Name used for newly created instances, useful in case the class name is too long. |
category | Name of the job category. |
func | Functor returning a new instance of the job. |
tooltip | Optional description of the job |