NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
regex-backref-matcher.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_MATCHER_HPP
25
#define NDN_UTIL_REGEX_REGEX_BACKREF_MATCHER_HPP
26
27
#include "../../common.hpp"
28
29
#include "
regex-matcher.hpp
"
30
31
namespace
ndn
{
32
33
class
RegexBackrefMatcher
:
public
RegexMatcher
34
{
35
public
:
36
RegexBackrefMatcher
(
const
std::string& expr, shared_ptr<RegexBackrefManager> backrefManager);
37
38
virtual
39
~RegexBackrefMatcher
()
40
{
41
}
42
43
void
44
lateCompile
()
45
{
46
compile
();
47
}
48
49
protected
:
50
virtual
void
51
compile
();
52
};
53
54
}
// namespace ndn
55
56
#include "
regex-pattern-list-matcher.hpp
"
57
58
namespace
ndn
{
59
60
inline
61
RegexBackrefMatcher::RegexBackrefMatcher
(
const
std::string& expr,
62
shared_ptr<RegexBackrefManager> backrefManager)
63
:
RegexMatcher
(expr,
EXPR_BACKREF
, backrefManager)
64
{
65
// compile();
66
}
67
68
inline
void
69
RegexBackrefMatcher::compile
()
70
{
71
if
(
m_expr
.size() < 2)
72
BOOST_THROW_EXCEPTION(
RegexMatcher::Error
(
"Unrecognized format: "
+
m_expr
));
73
74
size_t
lastIndex =
m_expr
.size() - 1;
75
if
(
'('
==
m_expr
[0] &&
')'
==
m_expr
[lastIndex]) {
76
// m_backRefManager->pushRef(this);
77
78
shared_ptr<RegexMatcher> matcher(
new
RegexPatternListMatcher
(
m_expr
.substr(1, lastIndex - 1),
79
m_backrefManager
));
80
m_matchers
.push_back(matcher);
81
}
82
else
83
BOOST_THROW_EXCEPTION(
RegexMatcher::Error
(
"Unrecognized format: "
+
m_expr
));
84
}
85
86
87
}
// namespace ndn
88
89
#endif // NDN_UTIL_REGEX_REGEX_BACKREF_MATCHER_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::RegexMatcher::EXPR_BACKREF
Definition:
regex-matcher.hpp:51
ndn::RegexPatternListMatcher
Definition:
regex-pattern-list-matcher.hpp:35
ndn::RegexBackrefMatcher::~RegexBackrefMatcher
virtual ~RegexBackrefMatcher()
Definition:
regex-backref-matcher.hpp:39
ndn::RegexBackrefMatcher::RegexBackrefMatcher
RegexBackrefMatcher(const std::string &expr, shared_ptr< RegexBackrefManager > backrefManager)
Definition:
regex-backref-matcher.hpp:61
ndn::RegexMatcher::m_backrefManager
shared_ptr< RegexBackrefManager > m_backrefManager
Definition:
regex-matcher.hpp:98
ndn::RegexBackrefMatcher
Definition:
regex-backref-matcher.hpp:33
regex-matcher.hpp
ndn::RegexMatcher::m_matchers
std::vector< shared_ptr< RegexMatcher > > m_matchers
Definition:
regex-matcher.hpp:99
ndn::RegexBackrefMatcher::lateCompile
void lateCompile()
Definition:
regex-backref-matcher.hpp:44
ndn::RegexMatcher::m_expr
const std::string m_expr
Definition:
regex-matcher.hpp:96
ndn::RegexMatcher::Error
Definition:
regex-matcher.hpp:37
regex-pattern-list-matcher.hpp
ndn::RegexBackrefMatcher::compile
virtual void compile()
Compile the regular expression to generate the more matchers when necessary.
Definition:
regex-backref-matcher.hpp:69
ndn::RegexMatcher
Definition:
regex-matcher.hpp:34
ndnSIM
ndn-cxx
src
util
regex
regex-backref-matcher.hpp
Generated on Wed Jan 11 2017 18:17:14 for ndnSIM by
1.8.13