blob: 80f7e09766038944bea573e82e9416b8b9c63559 [file] [log] [blame]
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
21#ifndef _CCNX_PIT_ENTRY_INCOMING_FACE_H_
22#define _CCNX_PIT_ENTRY_INCOMING_FACE_H_
23
24#include "ns3/nstime.h"
25#include "ns3/ptr.h"
26
27#include "ccnx-face.h"
28// #include <iostream>
29
30namespace ns3 {
31
32/**
33 * \ingroup ccnx
34 * \brief PIT state component for each incoming interest (not including duplicates)
35 */
36struct CcnxPitEntryIncomingFace
37{
38 Ptr<CcnxFace> m_face; ///< \brief face of the incoming Interest
39 Time m_arrivalTime; ///< \brief arrival time of the incoming Interest
40
41public:
42 /**
43 * \brief Constructor
44 * \param face face of the incoming interest
45 * \param lifetime lifetime of the incoming interest
46 */
47 CcnxPitEntryIncomingFace (Ptr<CcnxFace> face);
48
49 bool operator== (const CcnxPitEntryIncomingFace &dst) { return *m_face==*(dst.m_face); }
50 bool operator== (Ptr<CcnxFace> face) { return *m_face==*face; }
51
52 /**
53 * \brief Comparison operator used by boost::multi_index::identity<>
54 */
55 bool
56 operator< (const CcnxPitEntryIncomingFace &m) const { return *m_face < *(m.m_face); } // return identity of the face
57};
58
59
60} // namespace ns3
61
62#endif /* CCNX_PIT_ENTRY_INCOMING_FACE_H */