/* -*- 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_INTEREST_TABLE_H
#define SYNC_INTEREST_TABLE_H

#include <ndn-cpp-dev/util/scheduler.hpp>

#include <string>
#include <vector>

#include "sync-digest.h"
#include "sync-interest-container.h"

namespace Sync {

/**
 * \ingroup sync
 * @brief A table to keep unanswered Sync Interest
 * all access operation to the table should grab the 
 * mutex first
 */
class SyncInterestTable
{
public:
  SyncInterestTable (boost::asio::io_service& io, ndn::time::system_clock::Duration lifetime);
  ~SyncInterestTable ();

  /**
   * @brief Insert an interest, if interest already exists, update the
   * timestamp
   */
  bool
  insert (DigestConstPtr interest, const std::string &name, bool unknownState=false);

  /**
   * @brief Remove interest by digest (e.g., when it was satisfied)
   */
  bool
  remove (DigestConstPtr interest);

  /**
   * @brief Remove interest by name (e.g., when it was satisfied)
   */
  bool
  remove (const std::string &name);
  
  /**
   * @brief pop a non-expired Interest from PIT
   */
  Interest
  pop ();

  uint32_t
  size () const;

private:
  /**
   * @brief periodically called to expire Interest
   */
  void
  expireInterests ();

private:
  ndn::time::system_clock::Duration m_entryLifetime;
  InterestContainer m_table;

  ndn::Scheduler m_scheduler;
};

namespace Error {
struct InterestTableIsEmpty : virtual boost::exception, virtual std::exception { };
}

} // Sync

#endif // SYNC_INTEREST_TABLE_H
