/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2012-2014 University of California, Los Angeles
 *
 * This file is part of ChronoSync, synchronization library for distributed realtime
 * applications for NDN.
 *
 * ChronoSync is free software: you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *
 * ChronoSync 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
 * ChronoSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Zhenkai Zhu <http://irl.cs.ucla.edu/~zhenkai/>
 * @author Chaoyi Bian <bcy@pku.edu.cn>
 * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
 */

#ifndef SYNC_INTEREST_TABLE_H
#define SYNC_INTEREST_TABLE_H

#include <ndn-cxx/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
