/*
 * SPDX-FileCopyrightText: 2004 Copyright contributors to the cppTango project
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#ifndef TANGO_CLIENT_CALLBACKTHREAD_H
#define TANGO_CLIENT_CALLBACKTHREAD_H

#include <tango/common/omnithread_wrapper.h>

namespace Tango
{
class AsynReq;

//=============================================================================
//
//            The CallBackThread class
//
// description :    Class to store all the necessary information for the
//            polling thread. It's run() method is the thread code
//
//=============================================================================

// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor)
class CallBackThread : public omni_thread
{
  public:
    explicit CallBackThread(AsynReq *as) :
        asyn_ptr(as)
    {
    }

    void *run_undetached(void *) override;

    void start()
    {
        start_undetached();
    }

    AsynReq *asyn_ptr;

  private:
    ~CallBackThread() override = default;
};

} // namespace Tango

#endif // TANGO_CLIENT_CALLBACKTHREAD_H
