table: mock PIT
refs #1128
Change-Id: I8943ad07d93422dc456fd051b2e4c0d5f38bc227
diff --git a/daemon/table/pit.hpp b/daemon/table/pit.hpp
new file mode 100644
index 0000000..44dc252
--- /dev/null
+++ b/daemon/table/pit.hpp
@@ -0,0 +1,57 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (C) 2014 Named Data Networking Project
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NFD_TABLE_PIT_HPP
+#define NFD_TABLE_PIT_HPP
+
+#include "pit-entry.hpp"
+namespace ndn {
+namespace pit {
+
+/** \class DataMatchResult
+ * \brief an unordered iterable of all PIT entries matching Data
+ * This type shall support:
+ * iterator<shared_ptr<pit::Entry>> begin()
+ * iterator<shared_ptr<pit::Entry>> end()
+ */
+typedef std::vector<shared_ptr<pit::Entry> > DataMatchResult;
+
+} // namespace pit
+
+/** \class Pit
+ * \brief represents the PIT
+ */
+class Pit : noncopyable
+{
+public:
+ Pit();
+
+ ~Pit();
+
+ /** \brief inserts a FIB entry for prefix
+ * If an entry for exact same prefix exists, that entry is returned.
+ * \return{ the entry, and true for new entry, false for existing entry }
+ */
+ std::pair<shared_ptr<pit::Entry>, bool>
+ insert(const Interest& interest);
+
+ /** \brief performs a Data match
+ * \return{ an iterable of all PIT entries matching data }
+ */
+ shared_ptr<pit::DataMatchResult>
+ findAllDataMatches(const Data& data) const;
+
+ /// removes a PIT entry
+ void
+ remove(shared_ptr<pit::Entry> pitEntry);
+
+private:
+ std::list<shared_ptr<pit::Entry> > m_table;
+};
+
+} // namespace ndn
+
+#endif // NFD_TABLE_PIT_HPP