blob: 429eff7b2070abc2494678bab01c00e7752ab275 [file] [log] [blame]
Yingdi Yu43e71612013-10-30 22:19:31 -07001/* -*- 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 SPECIFIC_POLICY_RULE_H
12#define SPECIFIC_POLICY_RULE_H
13
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080014#include <ndn-cpp-et/policy-manager/policy-rule.hpp>
15#include <ndn-cpp-et/regex/regex.hpp>
Yingdi Yu43e71612013-10-30 22:19:31 -070016
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080017class SpecificPolicyRule : public ndn::PolicyRule
Yingdi Yu43e71612013-10-30 22:19:31 -070018{
19
20public:
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080021 SpecificPolicyRule(ndn::ptr_lib::shared_ptr<ndn::Regex> dataRegex,
22 ndn::ptr_lib::shared_ptr<ndn::Regex> signerRegex);
Yingdi Yu43e71612013-10-30 22:19:31 -070023
24 SpecificPolicyRule(const SpecificPolicyRule& rule);
25
26 virtual
27 ~SpecificPolicyRule() {};
28
29 bool
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080030 matchDataName(const ndn::Data& data);
Yingdi Yu43e71612013-10-30 22:19:31 -070031
32 bool
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080033 matchSignerName(const ndn::Data& data);
Yingdi Yu43e71612013-10-30 22:19:31 -070034
35 bool
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080036 satisfy(const ndn::Data& data);
Yingdi Yu43e71612013-10-30 22:19:31 -070037
38 bool
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080039 satisfy(const ndn::Name& dataName, const ndn::Name& signerName);
Yingdi Yu43e71612013-10-30 22:19:31 -070040
41private:
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080042 ndn::ptr_lib::shared_ptr<ndn::Regex> m_dataRegex;
43 ndn::ptr_lib::shared_ptr<ndn::Regex> m_signerRegex;
Yingdi Yu43e71612013-10-30 22:19:31 -070044};
45
46#endif //CHAT_POLICY_RULE_H