/* -*- 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_CONTAINER_H
#define SYNC_INTEREST_CONTAINER_H

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

#include "sync-digest.h"

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/tag.hpp>
// #include <boost/multi_index/ordered_index.hpp>
// #include <boost/multi_index/composite_key.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
// #include <boost/multi_index/random_access_index.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/mem_fun.hpp>

namespace mi = boost::multi_index;

namespace Sync {

struct Interest
{
  Interest (DigestConstPtr digest, const std::string &name, bool unknown=false)
  : m_digest (digest)
  , m_name (name)
  , m_time (ndn::time::now())
  , m_unknown (unknown)
  {
  }
  
  DigestConstPtr   m_digest;
  std::string      m_name;
  ndn::time::Point m_time;
  bool             m_unknown;
};

/// @cond include_hidden 
struct named { };
struct hashed;
struct timed;
/// @endcond

/**
 * \ingroup sync
 * @brief Container for interests (application PIT)
 */
struct InterestContainer : public mi::multi_index_container<
  Interest,
  mi::indexed_by<
    mi::hashed_unique<
      mi::tag<named>,
      BOOST_MULTI_INDEX_MEMBER(Interest, std::string, m_name)
    >
    ,
    
    mi::hashed_non_unique<
      mi::tag<hashed>,
      BOOST_MULTI_INDEX_MEMBER(Interest, DigestConstPtr, m_digest),
      DigestPtrHash,
      DigestPtrEqual
      >
    ,
    
    mi::ordered_non_unique<
      mi::tag<timed>,
      BOOST_MULTI_INDEX_MEMBER(Interest, ndn::time::Point, m_time)
      >
    >
  >
{
};

} // Sync

#endif // SYNC_INTEREST_CONTAINER_H
