SPH
Public Member Functions | List of all members
JobRegistrar Struct Reference

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

Detailed Description

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.

Definition at line 203 of file Job.h.

Constructor & Destructor Documentation

◆ JobRegistrar() [1/2]

JobRegistrar::JobRegistrar ( std::string  className,
std::string  category,
CreateJobFunc  func,
std::string  tooltip 
)

Registers a new job.

Parameters
classNameClass name of the job, must be the same as returned by IJob::className.
categoryName of the job category.
funcFunctor returning a new instance of the job.
tooltipOptional description of the job

Definition at line 98 of file Job.cpp.

◆ JobRegistrar() [2/2]

JobRegistrar::JobRegistrar ( std::string  className,
std::string  shortName,
std::string  category,
CreateJobFunc  func,
std::string  tooltip 
)

Registers a new job.

Parameters
classNameClass name of the job, must be the same as returned by IJob::className.
shortNameName used for newly created instances, useful in case the class name is too long.
categoryName of the job category.
funcFunctor returning a new instance of the job.
tooltipOptional description of the job

Definition at line 49 of file Job.cpp.


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