Junxiao Shi | 0fcb41e | 2014-01-24 10:29:43 -0700 | [diff] [blame] | 1 | /* -*- 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 Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 7 | #ifndef NFD_TABLE_CS_HPP |
| 8 | #define NFD_TABLE_CS_HPP |
| 9 | |
| 10 | #include "common.hpp" |
Junxiao Shi | 0fcb41e | 2014-01-24 10:29:43 -0700 | [diff] [blame] | 11 | #include "cs-entry.hpp" |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 12 | |
Junxiao Shi | 0fcb41e | 2014-01-24 10:29:43 -0700 | [diff] [blame] | 13 | namespace ndn { |
| 14 | |
| 15 | /** \class Cs |
| 16 | * \brief represents the ContentStore |
| 17 | */ |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 18 | class Cs : noncopyable |
Junxiao Shi | 0fcb41e | 2014-01-24 10:29:43 -0700 | [diff] [blame] | 19 | { |
| 20 | public: |
| 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 Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 33 | insert(shared_ptr<Data> data); |
Junxiao Shi | 0fcb41e | 2014-01-24 10:29:43 -0700 | [diff] [blame] | 34 | |
| 35 | /** \brief finds the best match Data for an Interest |
| 36 | * \return{ the best match, if any; otherwise null } |
| 37 | */ |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 38 | shared_ptr<Data> |
Junxiao Shi | 0fcb41e | 2014-01-24 10:29:43 -0700 | [diff] [blame] | 39 | find(const Interest& interest); |
| 40 | }; |
| 41 | |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 42 | } // namespace ndn |
| 43 | |
| 44 | #endif // NFD_TABLE_CS_HPP |