Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013, Regents of the University of California |
| 4 | * Yingdi Yu |
| 5 | * |
| 6 | * BSD license, See the LICENSE file for more information |
| 7 | * |
| 8 | * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 9 | */ |
| 10 | |
| 11 | #ifndef CHAT_POLICY_RULE_H |
| 12 | #define CHAT_POLICY_RULE_H |
| 13 | |
Yingdi Yu | 76dd800 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 14 | #include <ndn-cpp-et/policy-manager/policy-rule.hpp> |
| 15 | #include <ndn-cpp-et/regex/regex.hpp> |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 16 | |
Yingdi Yu | 76dd800 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 17 | class ChatPolicyRule : public ndn::PolicyRule |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 18 | { |
| 19 | |
| 20 | public: |
Yingdi Yu | 76dd800 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 21 | ChatPolicyRule(ndn::ptr_lib::shared_ptr<ndn::Regex> dataRegex, |
| 22 | ndn::ptr_lib::shared_ptr<ndn::Regex> signerRegex); |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 23 | |
| 24 | ChatPolicyRule(const ChatPolicyRule& rule); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 25 | |
| 26 | virtual |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 27 | ~ChatPolicyRule() {}; |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 28 | |
| 29 | bool |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 30 | matchDataName(const ndn::Data & data); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 31 | |
| 32 | bool |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 33 | matchSignerName(const ndn::Data & data); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 34 | |
| 35 | bool |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 36 | satisfy(const ndn::Data & data); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 37 | |
| 38 | bool |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 39 | satisfy(const ndn::Name & dataName, const ndn::Name & signerName); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 40 | |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 41 | private: |
Yingdi Yu | 76dd800 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 42 | ndn::ptr_lib::shared_ptr<ndn::Regex> m_dataRegex; |
| 43 | ndn::ptr_lib::shared_ptr<ndn::Regex> m_signerRegex; |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | #endif //CHAT_POLICY_RULE_H |