blob: f3a713a775ae446b0c782a2c35cb55c8e7e54983 [file] [log] [blame]
Obaid793401d2014-02-27 19:13:49 -06001/* -*- 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 NRD_RIB_HPP
8#define NRD_RIB_HPP
9
10#include "common.hpp"
11
12namespace ndn {
13namespace nrd {
14
15/** \brief represents the RIB
16 */
17class Rib
18{
19public:
20 typedef std::list<PrefixRegOptions> RibTable;
21 typedef RibTable::const_iterator const_iterator;
22
23 Rib();
24
25 ~Rib();
26
27 const_iterator
28 find(const PrefixRegOptions& options) const;
29
30 void
31 insert(const PrefixRegOptions& options);
32
33 void
34 erase(const PrefixRegOptions& options);
35
36 const_iterator
37 begin() const;
38
39 const_iterator
40 end() const;
41
42 size_t
43 size() const;
44
45 size_t
46 empty() const;
47
48private:
49 // Note: Taking a list right now. A Trie will be used later to store
50 // prefixes
51 RibTable m_rib;
52};
53
54inline Rib::const_iterator
55Rib::begin() const
56{
57 return m_rib.begin();
58}
59
60inline Rib::const_iterator
61Rib::end() const
62{
63 return m_rib.end();
64}
65
66inline size_t
67Rib::size() const
68{
69 return m_rib.size();
70}
71
72inline size_t
73Rib::empty() const
74{
75 return m_rib.empty();
76}
77
78} // namespace nrd
79} // namespace ndn
80
81#endif // NRD_RIB_HPP