deskflow/src/lib/base/FunctionJob.h
2025-04-28 11:27:33 +01:00

29 lines
607 B
C++

/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
#pragma once
#include "base/IJob.h"
//! Use a function as a job
/*!
A job class that invokes a function.
*/
class FunctionJob : public IJob
{
public:
//! run() invokes \c func(arg)
FunctionJob(void (*func)(void *), void *arg = NULL);
~FunctionJob() override;
// IJob overrides
void run() override;
private:
void (*m_func)(void *);
void *m_arg;
};