/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2012 University of California, Los Angeles
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
 *         Chaoyi Bian <bcy@pku.edu.cn>
 *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
 */

#ifndef SYNC_SCHEDULER_H
#define SYNC_SCHEDULER_H

#include <ns3/nstime.h>
#include <ns3/event-id.h>
#include <list>
#include <map>

#include "sync-event.h"

#define TIME_SECONDS(number) ns3::Seconds(number)
#define TIME_MILLISECONDS(number) ns3::MilliSeconds(number)
typedef ns3::Time TimeDuration;

namespace Sync {

/**
 * @ingroup sync
 * @brief General purpose event scheduler
 *
 * This class internally runs a thread and events can be scheduled by specifying an absolute or relative time of the event
 */
class Scheduler
{
public:
  /**
   * @brief Default constructor. Thread will be created
   */
  Scheduler ();
  /**
   * @brief Destructor. Thread will be nicely stopped
   */
  ~Scheduler ();

  /**
   * @brief Schedule an event at absolute time 'abstime'
   * @param abstime Absolute time
   * @param event function to be called at the time
   * @param label Label for the event
   */
  // void
  // schedule (const boost::system_time &abstime, Event event, uint32_t label);

  /**
   * @brief Schedule an event at relative time 'reltime'
   * @param reltime Relative time
   * @param event function to be called at the time
   * @param label Label for the event
   */
  void
  schedule (const TimeDuration &reltime, Event event, uint32_t label); 

  /**
   * @brief Cancel all events for the label
   * @param label Label of the event that needs to be cancelled
   */
  void
  cancel (uint32_t label);

private:
  static void
  eventWrapper (Event event);

private:
  std::map< uint32_t, std::list< ns3::EventId > > m_labeledEvents;
};
  
}

#endif // SYNC_SCHEDULER_H
