NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
regex-backref-manager.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
24
#ifndef NDN_UTIL_REGEX_REGEX_BACKREF_MANAGER_HPP
25
#define NDN_UTIL_REGEX_REGEX_BACKREF_MANAGER_HPP
26
27
#include "../../common.hpp"
28
29
#include <vector>
30
31
namespace
ndn
{
32
33
class
RegexMatcher;
34
35
class
RegexBackrefManager
36
{
37
public
:
38
size_t
39
pushRef
(
const
shared_ptr<RegexMatcher>& matcher);
40
41
void
42
popRef
();
43
44
size_t
45
size
()
const
;
46
47
shared_ptr<RegexMatcher>
48
getBackref
(
size_t
i)
const
;
49
50
private
:
51
std::vector<weak_ptr<RegexMatcher>> m_backrefs;
52
};
53
54
55
inline
size_t
56
RegexBackrefManager::pushRef
(
const
shared_ptr<RegexMatcher>& matcher)
57
{
58
size_t
last = m_backrefs.size();
59
m_backrefs.push_back(matcher);
60
61
return
last;
62
}
63
64
inline
void
65
RegexBackrefManager::popRef
()
66
{
67
m_backrefs.pop_back();
68
}
69
70
inline
size_t
71
RegexBackrefManager::size
()
const
72
{
73
return
m_backrefs.size();
74
}
75
76
inline
shared_ptr<RegexMatcher>
77
RegexBackrefManager::getBackref
(
size_t
i)
const
78
{
79
auto
backref = m_backrefs[i].lock();
80
BOOST_ASSERT(backref !=
nullptr
);
81
return
backref;
82
}
83
84
}
// namespace ndn
85
86
#endif // NDN_UTIL_REGEX_REGEX_BACKREF_MANAGER_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::RegexBackrefManager::getBackref
shared_ptr< RegexMatcher > getBackref(size_t i) const
Definition:
regex-backref-manager.hpp:77
ndn::RegexBackrefManager::size
size_t size() const
Definition:
regex-backref-manager.hpp:71
ndn::RegexBackrefManager::popRef
void popRef()
Definition:
regex-backref-manager.hpp:65
ndn::RegexBackrefManager::pushRef
size_t pushRef(const shared_ptr< RegexMatcher > &matcher)
Definition:
regex-backref-manager.hpp:56
ndn::RegexBackrefManager
Definition:
regex-backref-manager.hpp:35
ndnSIM
ndn-cxx
src
util
regex
regex-backref-manager.hpp
Generated on Thu Nov 2 2017 03:30:29 for ndnSIM by
1.8.11