blob: fec4b6978e4d31f3f559d1ac890bf8ecab44c2b9 [file] [log] [blame]
Yingdi Yu06202d32013-10-26 15:08:37 -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 CHAT_POLICY_RULE_H
12#define CHAT_POLICY_RULE_H
13
Yingdi Yu76dd8002013-12-24 11:16:32 +080014#include <ndn-cpp-et/policy-manager/policy-rule.hpp>
15#include <ndn-cpp-et/regex/regex.hpp>
Yingdi Yu06202d32013-10-26 15:08:37 -070016
Yingdi Yu76dd8002013-12-24 11:16:32 +080017class ChatPolicyRule : public ndn::PolicyRule
Yingdi Yu06202d32013-10-26 15:08:37 -070018{
19
20public:
Yingdi Yu76dd8002013-12-24 11:16:32 +080021 ChatPolicyRule(ndn::ptr_lib::shared_ptr<ndn::Regex> dataRegex,
22 ndn::ptr_lib::shared_ptr<ndn::Regex> signerRegex);
Yingdi Yu7989eb22013-10-31 17:38:22 -070023
24 ChatPolicyRule(const ChatPolicyRule& rule);
Yingdi Yu06202d32013-10-26 15:08:37 -070025
26 virtual
Yingdi Yu7989eb22013-10-31 17:38:22 -070027 ~ChatPolicyRule() {};
Yingdi Yu06202d32013-10-26 15:08:37 -070028
29 bool
Yingdi Yu7989eb22013-10-31 17:38:22 -070030 matchDataName(const ndn::Data & data);
Yingdi Yu06202d32013-10-26 15:08:37 -070031
32 bool
Yingdi Yu7989eb22013-10-31 17:38:22 -070033 matchSignerName(const ndn::Data & data);
Yingdi Yu06202d32013-10-26 15:08:37 -070034
35 bool
Yingdi Yu7989eb22013-10-31 17:38:22 -070036 satisfy(const ndn::Data & data);
Yingdi Yu06202d32013-10-26 15:08:37 -070037
38 bool
Yingdi Yu7989eb22013-10-31 17:38:22 -070039 satisfy(const ndn::Name & dataName, const ndn::Name & signerName);
Yingdi Yu06202d32013-10-26 15:08:37 -070040
Yingdi Yu06202d32013-10-26 15:08:37 -070041private:
Yingdi Yu76dd8002013-12-24 11:16:32 +080042 ndn::ptr_lib::shared_ptr<ndn::Regex> m_dataRegex;
43 ndn::ptr_lib::shared_ptr<ndn::Regex> m_signerRegex;
Yingdi Yu06202d32013-10-26 15:08:37 -070044};
45
46#endif //CHAT_POLICY_RULE_H