blob: f1b8c7a751a4923982963ec06d4f8024fab971f7 [file] [log] [blame]
Junxiao Shibb5105f2014-03-03 12:06:45 -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
7#ifndef NFD_TABLE_STRATEGY_CHOICE_ENTRY_HPP
8#define NFD_TABLE_STRATEGY_CHOICE_ENTRY_HPP
9
10#include "common.hpp"
11
12namespace nfd {
13
14class NameTree;
15namespace name_tree {
16class Entry;
17}
18namespace fw {
19class Strategy;
20}
21
22namespace strategy_choice {
23
24/** \brief represents a Strategy Choice entry
25 */
26class Entry : noncopyable
27{
28public:
29 Entry(const Name& prefix);
30
31 const Name&
32 getPrefix() const;
33
34 fw::Strategy&
35 getStrategy() const;
36
37 void
38 setStrategy(shared_ptr<fw::Strategy> strategy);
39
40private:
41 Name m_prefix;
42 shared_ptr<fw::Strategy> m_strategy;
43
44 shared_ptr<name_tree::Entry> m_nameTreeEntry;
45 friend class nfd::NameTree;
46 friend class nfd::name_tree::Entry;
47};
48
49
50inline const Name&
51Entry::getPrefix() const
52{
53 return m_prefix;
54}
55
56inline fw::Strategy&
57Entry::getStrategy() const
58{
59 BOOST_ASSERT(static_cast<bool>(m_strategy));
60 return *m_strategy;
61}
62
63} // namespace strategy_choice
64} // namespace nfd
65
66#endif // NFD_TABLE_STRATEGY_CHOICE_ENTRY_HPP