lp: Nack abstraction
refs #2878
Change-Id: Id36c9f066ccc2e9e1807e37dc0bf6e308645f556
diff --git a/src/lp/nack.hpp b/src/lp/nack.hpp
new file mode 100644
index 0000000..9512749
--- /dev/null
+++ b/src/lp/nack.hpp
@@ -0,0 +1,112 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2015 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ *
+ * @author Eric Newberry <enewberry@email.arizona.edu>
+ */
+
+#ifndef NDN_CXX_LP_NACK_HPP
+#define NDN_CXX_LP_NACK_HPP
+
+#include "../common.hpp"
+#include "../tag-host.hpp"
+#include "../interest.hpp"
+
+#include "nack-header.hpp"
+
+namespace ndn {
+namespace lp {
+
+/**
+ * \brief represents a Network NACK
+ * \detail This type binds a NackHeader and an Interest, and is intended for use in network layer.
+ */
+class Nack : public TagHost
+{
+public:
+ Nack() = default;
+
+ explicit
+ Nack(const Interest& interest);
+
+ explicit
+ Nack(Interest&& interest);
+
+public: // getter/setter
+ const Interest&
+ getInterest() const
+ {
+ return m_interest;
+ }
+
+ Interest&
+ getInterest()
+ {
+ return m_interest;
+ }
+
+ const NackHeader&
+ getHeader() const
+ {
+ return m_header;
+ }
+
+ NackHeader&
+ getHeader()
+ {
+ return m_header;
+ }
+
+ Nack&
+ setHeader(const NackHeader& header)
+ {
+ m_header = header;
+ return *this;
+ }
+
+ Nack&
+ setHeader(NackHeader&& header)
+ {
+ m_header = header;
+ return *this;
+ }
+
+public: // NackHeader proxy
+ NackReason
+ getReason() const
+ {
+ return m_header.getReason();
+ }
+
+ Nack&
+ setReason(NackReason reason)
+ {
+ m_header.setReason(reason);
+ return *this;
+ }
+
+private:
+ Interest m_interest;
+ NackHeader m_header;
+};
+
+} // namespace lp
+} // namespace ndn
+
+#endif // NDN_CXX_LP_NACK_HPP
\ No newline at end of file