All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sec-rule.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
8 #ifndef NDN_SECURITY_SEC_RULE_HPP
9 #define NDN_SECURITY_SEC_RULE_HPP
10 
11 #include "../common.hpp"
12 #include "../data.hpp"
13 
14 namespace ndn {
15 
16 class SecRule
17 {
18 public:
19  class Error : public std::runtime_error
20  {
21  public:
22  explicit
23  Error(const std::string& what)
24  : std::runtime_error(what)
25  {
26  }
27  };
28 
30  : m_isPositive(isPositive)
31  {
32  }
33 
34  virtual
36  {
37  }
38 
39  virtual bool
40  matchDataName(const Data& data) = 0;
41 
42  virtual bool
43  matchSignerName(const Data& data) = 0;
44 
45  virtual bool
46  satisfy(const Data& data) = 0;
47 
48  virtual bool
49  satisfy(const Name& dataName, const Name& signerName) = 0;
50 
51  inline bool
52  isPositive();
53 
54 protected:
56 };
57 
58 bool
60 {
61  return m_isPositive;
62 }
63 
64 } // namespace ndn
65 
66 #endif //NDN_SECURITY_SEC_RULE_HPP
bool isPositive()
Definition: sec-rule.hpp:59
SecRule(bool isPositive)
Definition: sec-rule.hpp:29
bool m_isPositive
Definition: sec-rule.hpp:55
virtual ~SecRule()
Definition: sec-rule.hpp:35
virtual bool satisfy(const Data &data)=0
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:26
Error(const std::string &what)
Definition: sec-rule.hpp:23
virtual bool matchDataName(const Data &data)=0
virtual bool matchSignerName(const Data &data)=0