Junxiao Shi | 65d0072 | 2014-02-17 10:50:20 -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 | |
| 7 | #ifndef NFD_TABLE_MEASUREMENTS_ENTRY_HPP |
| 8 | #define NFD_TABLE_MEASUREMENTS_ENTRY_HPP |
| 9 | |
| 10 | #include "common.hpp" |
| 11 | #include "strategy-info-host.hpp" |
| 12 | #include "core/scheduler.hpp" |
| 13 | |
| 14 | namespace nfd { |
| 15 | |
HangZhang | cb4fc83 | 2014-03-11 16:57:11 +0800 | [diff] [blame] | 16 | class NameTree; |
| 17 | |
| 18 | namespace name_tree { |
| 19 | class Entry; |
| 20 | } |
| 21 | |
Junxiao Shi | 65d0072 | 2014-02-17 10:50:20 -0700 | [diff] [blame] | 22 | class Measurements; |
| 23 | |
| 24 | namespace measurements { |
| 25 | |
| 26 | /** \class Entry |
| 27 | * \brief represents a Measurements entry |
| 28 | */ |
| 29 | class Entry : public StrategyInfoHost, noncopyable |
| 30 | { |
| 31 | public: |
| 32 | explicit |
| 33 | Entry(const Name& name); |
| 34 | |
| 35 | const Name& |
| 36 | getName() const; |
| 37 | |
| 38 | private: |
| 39 | Name m_name; |
| 40 | |
| 41 | private: // lifetime |
Alexander Afanasyev | eb3197f | 2014-03-17 19:28:18 -0700 | [diff] [blame^] | 42 | time::steady_clock::TimePoint m_expiry; |
Junxiao Shi | 65d0072 | 2014-02-17 10:50:20 -0700 | [diff] [blame] | 43 | EventId m_cleanup; |
HangZhang | cb4fc83 | 2014-03-11 16:57:11 +0800 | [diff] [blame] | 44 | shared_ptr<name_tree::Entry> m_nameTreeEntry; |
Junxiao Shi | 65d0072 | 2014-02-17 10:50:20 -0700 | [diff] [blame] | 45 | |
HangZhang | cb4fc83 | 2014-03-11 16:57:11 +0800 | [diff] [blame] | 46 | friend class nfd::NameTree; |
| 47 | friend class nfd::name_tree::Entry; |
| 48 | friend class nfd::Measurements; |
Junxiao Shi | 65d0072 | 2014-02-17 10:50:20 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | inline const Name& |
| 52 | Entry::getName() const |
| 53 | { |
| 54 | return m_name; |
| 55 | } |
| 56 | |
| 57 | } // namespace measurements |
| 58 | } // namespace nfd |
| 59 | |
| 60 | #endif // NFD_TABLE_MEASUREMENTS_ENTRY_HPP |