This commit also update CS interface (find should return shared_ptr<Data>, CS entry is internal to CS, the design diagrams are corrected too). Change-Id: Ib6377b6d9b8478640ac35d3cfb6c9180cc57c4fe
45 lines
1017 B
C++
45 lines
1017 B
C++
/* -*- 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_CS_HPP
|
|
#define NFD_TABLE_CS_HPP
|
|
|
|
#include "common.hpp"
|
|
#include "cs-entry.hpp"
|
|
|
|
namespace ndn {
|
|
|
|
/** \class Cs
|
|
* \brief represents the ContentStore
|
|
*/
|
|
class Cs : noncopyable
|
|
{
|
|
public:
|
|
Cs();
|
|
|
|
~Cs();
|
|
|
|
/** \brief inserts a Data packet
|
|
* The caller should ensure that this Data packet is admittable,
|
|
* ie. not unsolicited from a untrusted source.
|
|
* This does not guarantee the Data is added to the cache;
|
|
* even if the Data is added, it may be removed anytime in the future.
|
|
* \return{ whether the Data is added }
|
|
*/
|
|
bool
|
|
insert(shared_ptr<Data> data);
|
|
|
|
/** \brief finds the best match Data for an Interest
|
|
* \return{ the best match, if any; otherwise null }
|
|
*/
|
|
shared_ptr<Data>
|
|
find(const Interest& interest);
|
|
};
|
|
|
|
} // namespace ndn
|
|
|
|
#endif // NFD_TABLE_CS_HPP
|