blob: 020a0ef5adb39fea6f058032dbdd651cc794ef35 [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 * Zhenkai Zhu
6 *
7 * BSD license, See the LICENSE file for more information
8 *
9 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
10 * Zhenkai Zhu <zhenkai@cs.ucla.edu>
11 */
12
13#include "interest.h"
14#include <boost/lexical_cast.hpp>
15
16using namespace std;
17
18namespace ndn {
19
20Interest::Interest ()
21 // m_name
22 : m_maxSuffixComponents (Interest::ncomps)
23 , m_minSuffixComponents (Interest::ncomps)
24 , m_answerOriginKind (AOK_DEFAULT)
25 , m_interestLifetime (time::Seconds (-1.0))
26 , m_scope (NO_SCOPE)
27 , m_childSelector (CHILD_DEFAULT)
28 // m_publisherKeyDigest
29{
30}
31
32Interest::Interest (const Name &name)
33 : m_name (name)
34 , m_maxSuffixComponents (Interest::ncomps)
35 , m_minSuffixComponents (Interest::ncomps)
36 , m_answerOriginKind(AOK_DEFAULT)
37 , m_interestLifetime (time::Seconds (-1.0))
38 , m_scope (NO_SCOPE)
39 , m_childSelector (CHILD_DEFAULT)
40 // m_publisherKeyDigest
41{
42}
43
44Interest::Interest (const Interest &other)
45{
46 m_name = other.m_name;
47 m_maxSuffixComponents = other.m_maxSuffixComponents;
48 m_minSuffixComponents = other.m_minSuffixComponents;
49 m_answerOriginKind = other.m_answerOriginKind;
50 m_interestLifetime = other.m_interestLifetime;
51 m_scope = other.m_scope;
52 m_childSelector = other.m_childSelector;
53 m_publisherPublicKeyDigest = other.m_publisherPublicKeyDigest;
54}
55
Jeff Thompsonfa306642013-06-17 15:06:57 -070056bool
57Interest::operator == (const Interest &other)
58{
59 return
60 m_name == other.m_name
61 && m_maxSuffixComponents == other.m_maxSuffixComponents
62 && m_minSuffixComponents == other.m_minSuffixComponents
63 && m_answerOriginKind == other.m_answerOriginKind
64 && m_interestLifetime == other.m_interestLifetime
65 && m_scope == other.m_scope
66 && m_childSelector == other.m_childSelector;
67}
68
69} // ndn