blob: 2e6c151e7044ea3f0c917363ff1297d0d0516475 [file] [log] [blame]
Alexander Afanasyeva4e74282013-07-11 15:23:20 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Alexander Afanasyev
5 *
6 * GNU v3.0 license, See the LICENSE file for more information
7 *
8 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
9 */
10
11#ifndef NDN_NDNCXX_DETAIL_REGISTERED_PREFIX_CONTAINER_H
12#define NDN_NDNCXX_DETAIL_REGISTERED_PREFIX_CONTAINER_H
13
14#include <ns3/ndnSIM/utils/trie/trie-with-policy.h>
15#include <ns3/ndnSIM/utils/trie/counting-policy.h>
16
17namespace ns3 {
18namespace ndn {
19namespace detail {
20
21struct RegisteredPrefixEntry : public SimpleRefCount< RegisteredPrefixEntry >
22{
23public:
24 RegisteredPrefixEntry (Ptr<const Name> prefix)
25 : m_prefix (prefix)
26 { }
27
28 void
29 AddCallback (ApiFace::InterestCallback callback)
30 {
31 m_callback = callback;
32 }
33
34 void
35 ClearCallback ()
36 {
37 m_callback = ApiFace::InterestCallback ();
38 }
39
40 Ptr<const Name>
41 GetPrefix () const
42 {
43 return m_prefix;
44 }
45
46public:
47 ApiFace::InterestCallback m_callback;
48 Ptr<const Name> m_prefix;
49};
50
51
52struct RegisteredPrefixContainer :
53 public ndnSIM::trie_with_policy<Name,
54 ndnSIM::smart_pointer_payload_traits< RegisteredPrefixEntry >,
55 ndnSIM::counting_policy_traits>
56{
57};
58
59} // detail
60} // ndn
61} // ns3
62
63#endif // NDN_NDNCXX_DETAIL_REGISTERED_PREFIX_CONTAINER_H