blob: c1c3e37b560048cc170bcbddd630a3a685650192 [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 Afanasyevb927a3a2014-01-24 10:41:47 -080033 insert(shared_ptr<Data> data);
Junxiao Shi0fcb41e2014-01-24 10:29:43 -070034
35 /** \brief finds the best match Data for an Interest
36 * \return{ the best match, if any; otherwise null }
37 */
Alexander Afanasyevb927a3a2014-01-24 10:41:47 -080038 shared_ptr<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