blob: 0216bd290566f1f21fd01705d68cf8287e184514 [file] [log] [blame]
Jeff Thompsonfa306642013-06-17 15:06:57 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Alexander Afanasyev
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
9 */
10
11#include "content.h"
12#include "ndn-cpp/error.h"
13
14namespace ndn
15{
16
17const name::Component Content::noFinalBlock = name::Component ();
18const TimeInterval Content::noFreshness;
19const TimeInterval Content::maxFreshness = time::Seconds (2147);
20
21Content::Content ()
22{
23}
24
25Content::Content (const void *buffer, size_t size,
26 const Time &timestamp,
27 Type type/* = DATA*/,
28 const TimeInterval &freshness/* = maxFreshness*/,
29 const name::Component &finalBlock/* = noFinalBlock*/)
30 : m_timestamp (timestamp)
31 , m_type (type)
32 , m_freshness (freshness)
33 , m_finalBlockId (finalBlock)
34
35 , m_content (buffer, size)
36{
37}
38
39Content::Content (const void *buffer, size_t size,
40 Type type/* = DATA*/,
41 const TimeInterval &freshness/* = maxFreshness*/,
42 const name::Component &finalBlock/* = noFinalBlock*/)
43 : m_timestamp (time::Now ())
44 , m_type (type)
45 , m_freshness (freshness)
46 , m_finalBlockId (finalBlock)
47
48 , m_content (buffer, size)
49{
50}
51
52
53} // ndn