/*******************************************************
 * Copyright (C) 2017-2020 CENOS Ltd vg@cenos-platform.com
 *
 * This file is part of CENOS.
 *
 * CENOS can not be copied and/or distributed without the express
 * permission of CENOS Ltd
 *******************************************************/
/**
 *  \brief     Worker abstract class.
 *  \details   Used for running module specific commands
 *  \author    vadims
 *  \date      Nov 26, 2019
 *  \copyright CENOS LLC
 */

#ifndef WORKER_HPP_
#define WORKER_HPP_

#include "misc/messageQueue.hpp"
#include "Job.h"

class Worker
{
public:

    /// @brief Constructor
    /// @param job - pointer to job assigned to this worker
    
    
    Worker(std::shared_ptr<Job> job);
    Worker(std::shared_ptr<Job> job, PluginManager m);

    /// @brief Let the worker work! 
    /// @param messageQueue - reference to message queue, where all logging messages are pushed
    virtual messagedata run(MessageQueue_ messageQueue);

    messagedata generateError(std::string);

protected:
    /// @brief Let the worker work! 
    /// @param messageQueue - reference to message queue, where all logging messages are pushed
	std::shared_ptr<Job> assignedJob_;

};

#endif // WORKER_HPP_