Jeff Thompson | fa30664 | 2013-06-17 15:06:57 -0700 | [diff] [blame] | 1 | /* -*- 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 | |
| 14 | namespace ndn |
| 15 | { |
| 16 | |
| 17 | const name::Component Content::noFinalBlock = name::Component (); |
| 18 | const TimeInterval Content::noFreshness; |
| 19 | const TimeInterval Content::maxFreshness = time::Seconds (2147); |
| 20 | |
| 21 | Content::Content () |
| 22 | { |
| 23 | } |
| 24 | |
| 25 | Content::Content (const void *buffer, size_t size, |
| 26 | const Time ×tamp, |
| 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 | |
| 39 | Content::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 |