#pragma once

#include "Task.h"
#include <boost/noncopyable.hpp>

class SchedulerTask;

namespace MP
{
  struct TaskEvent
  {
    Task::id_type id;
    std::string name; 
    unsigned int priority;
    DWORD threadID;
    Task::time_point time;
    Task::time_point createTime;

    TaskEvent() : id(0), priority(0), threadID(0), time(0), createTime(0) {}
    TaskEvent(const Task * t) : id(t->getId()), name(t->getName()), priority(t->getPriority()), createTime(t->getCreateTime())
    {
      threadID = ::GetCurrentThreadId();
      time = Task::getCurrentTime();
    }
    TaskEvent(const SchedulerTask * t);
  };

  struct ITaskListener : boost::noncopyable
  {
    virtual void onTaskStarted(const TaskEvent &ev) = 0;
    virtual void onTaskEnded(const TaskEvent &ev) = 0;
    virtual ~ITaskListener() {}
  protected:
    ITaskListener() {}
  };
}