blob: 94040157724556868a70109dac100373188ae278 [file] [log] [blame]
Junxiao Shi0fcb41e2014-01-24 10:29:43 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (C) 2014 Named Data Networking Project
4 * See COPYING for copyright and distribution information.
5 */
6
Alexander Afanasyevb927a3a2014-01-24 10:41:47 -08007#ifndef NFD_TABLE_CS_HPP
8#define NFD_TABLE_CS_HPP
9
10#include "common.hpp"
Junxiao Shi0fcb41e2014-01-24 10:29:43 -070011#include "cs-entry.hpp"
Alexander Afanasyevb927a3a2014-01-24 10:41:47 -080012
Junxiao Shi0fcb41e2014-01-24 10:29:43 -070013namespace ndn {
14
15/** \class Cs
16 * \brief represents the ContentStore
17 */
Alexander Afanasyevb927a3a2014-01-24 10:41:47 -080018class Cs : noncopyable
Junxiao Shi0fcb41e2014-01-24 10:29:43 -070019{
20public:
21 Cs();
22
23 ~Cs();
24
25 /** \brief inserts a Data packet
26 * The caller should ensure that this Data packet is admittable,
27 * ie. not unsolicited from a untrusted source.
28 * This does not guarantee the Data is added to the cache;
29 * even if the Data is added, it may be removed anytime in the future.
30 * \return{ whether the Data is added }
31 */
32 bool
Alexander Afanasyevfd603ee2014-01-26 11:03:03 -080033 insert(const Data& data);
Junxiao Shi0fcb41e2014-01-24 10:29:43 -070034
35 /** \brief finds the best match Data for an Interest
Alexander Afanasyevc9765df2014-01-25 19:24:27 -080036 * \return{ the best match, if any; otherwise 0 }
Junxiao Shi0fcb41e2014-01-24 10:29:43 -070037 */
Alexander Afanasyevc9765df2014-01-25 19:24:27 -080038 const Data*
Junxiao Shi0fcb41e2014-01-24 10:29:43 -070039 find(const Interest& interest);
40};
41
Alexander Afanasyevb927a3a2014-01-24 10:41:47 -080042} // namespace ndn
43
44#endif // NFD_TABLE_CS_HPP