NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
prefix-announcement.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013-2018 Regents of the University of California.
4  *
5  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6  *
7  * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License as published by the Free Software
9  * Foundation, either version 3 of the License, or (at your option) any later version.
10  *
11  * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13  * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14  *
15  * You should have received copies of the GNU General Public License and GNU Lesser
16  * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17  * <http://www.gnu.org/licenses/>.
18  *
19  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20  *
21  * @author Teng Liang <philoliang@email.arizona.edu>
22  */
23 
24 #ifndef NDN_CXX_LP_PREFIX_ANNOUNCEMENT_HPP
25 #define NDN_CXX_LP_PREFIX_ANNOUNCEMENT_HPP
26 
27 #include "../data.hpp"
28 #include "../name.hpp"
29 
30 namespace ndn {
31 namespace lp {
32 
41 {
42 public:
43  class Error : public ndn::tlv::Error
44  {
45  public:
46  explicit
47  Error(const std::string& what)
48  : ndn::tlv::Error(what)
49  {
50  }
51  };
52 
54 
55  explicit
56  PrefixAnnouncement(const Block& block);
57 
58  explicit
59  PrefixAnnouncement(shared_ptr<const Data> data);
60 
61  template<encoding::Tag TAG>
62  size_t
63  wireEncode(EncodingImpl<TAG>& encoder) const;
64 
65  void
66  wireDecode(const Block& wire);
67 
71  Name
72  getAnnouncedName() const;
73 
74  shared_ptr<const Data>
75  getData() const
76  {
77  return m_data;
78  }
79 
81  setData(shared_ptr<const Data> data);
82 
83 private:
84  shared_ptr<const Data> m_data;
85 };
86 
88 
89 } // namespace lp
90 } // namespace ndn
91 
92 #endif // NDN_CXX_LP_PREFIX_ANNOUNCEMENT_HPP
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(CachePolicy)
Copyright (c) 2011-2015 Regents of the University of California.
Represents a TLV element of NDN packet format.
Definition: block.hpp:42
PrefixAnnouncement & setData(shared_ptr< const Data > data)
void wireDecode(const Block &wire)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Represents an absolute name.
Definition: name.hpp:42
represents a Prefix Announcement
Name getAnnouncedName() const
Get announced name.
shared_ptr< const Data > getData() const
represents an error in TLV encoding or decoding
Definition: tlv.hpp:50