Pass std::string to add/remove task

By passing strings instead of const char pointers to the task control
functions, we can safely make copies of them knowing that the contents
won't disappear.
This commit is contained in:
Markus Mäkelä
2019-03-26 09:06:32 +02:00
parent f0756cd708
commit 0915487329
2 changed files with 19 additions and 18 deletions

View File

@ -51,8 +51,8 @@ public:
*/
static MainWorker& get();
void add_task(const char* zName, TASKFN func, void* pData, int frequency);
void remove_task(const char* zName);
void add_task(const std::string& name, TASKFN func, void* pData, int frequency);
void remove_task(const std::string& name);
void show_tasks(DCB* pDcb) const;
json_t* tasks_to_json(const char* zhost) const;