Files
NFD/daemon/table/pit-face-record.cpp
T
Alexander Afanasyev 18bbf81601 src: Changing namespace ndn to namespace nfd
Also, this commit imports used classes from ::ndn namespace (from
NDN-CPP library) directly to ::nfd namespace.

refs: #1163

Change-Id: I9cc9d72e00af495b4ed0c84e6d418a7c9ba986cb
2014-01-29 14:12:58 -08:00

39 lines
799 B
C++

/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (C) 2014 Named Data Networking Project
* See COPYING for copyright and distribution information.
*/
#include "pit-face-record.hpp"
namespace nfd {
namespace pit {
FaceRecord::FaceRecord(shared_ptr<Face> face)
: m_face(face)
, m_lastNonce(0)
, m_lastRenewed(0)
, m_expiry(0)
{
}
FaceRecord::FaceRecord(const FaceRecord& other)
: m_face(other.m_face)
, m_lastNonce(other.m_lastNonce)
, m_lastRenewed(other.m_lastRenewed)
, m_expiry(other.m_expiry)
{
}
void
FaceRecord::update(const Interest& interest)
{
m_lastNonce = interest.getNonce();
m_lastRenewed = time::now();
m_expiry = m_lastRenewed + time::milliseconds(interest.getInterestLifetime());
}
} // namespace pit
} // namespace nfd