All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
validator-null.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
9 #ifndef NDN_SECURITY_VALIDATOR_NULL_HPP
10 #define NDN_SECURITY_VALIDATOR_NULL_HPP
11 
12 #include "validator.hpp"
13 
14 namespace ndn {
15 
16 class ValidatorNull : public Validator
17 {
18 public:
19  virtual
21  {
22  }
23 
24 protected:
25  virtual void
26  checkPolicy(const Data& data,
27  int nSteps,
28  const OnDataValidated& onValidated,
29  const OnDataValidationFailed& onValidationFailed,
30  std::vector<shared_ptr<ValidationRequest> >& nextSteps)
31  {
32  onValidated(data.shared_from_this());
33  }
34 
35  virtual void
36  checkPolicy(const Interest& interest,
37  int nSteps,
38  const OnInterestValidated& onValidated,
39  const OnInterestValidationFailed& onValidationFailed,
40  std::vector<shared_ptr<ValidationRequest> >& nextSteps)
41  {
42  onValidated(interest.shared_from_this());
43  }
44 };
45 
46 } // namespace ndn
47 
48 #endif //NDN_SECURITY_VALIDATOR_NULL_HPP
virtual void checkPolicy(const Data &data, int nSteps, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed, std::vector< shared_ptr< ValidationRequest > > &nextSteps)
Check the Data against policy and return the next validation step if necessary.
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:24
function< void(const shared_ptr< const Data > &)> OnDataValidated
Callback to report a successful Data validation.
function< void(const shared_ptr< const Data > &, const std::string &)> OnDataValidationFailed
Callback to report a failed Data validation.
function< void(const shared_ptr< const Interest > &, const std::string &)> OnInterestValidationFailed
Callback to report a failed Interest validation.
virtual void checkPolicy(const Interest &interest, int nSteps, const OnInterestValidated &onValidated, const OnInterestValidationFailed &onValidationFailed, std::vector< shared_ptr< ValidationRequest > > &nextSteps)
Check the Interest against validation policy and return the next validation step if necessary...
Validator is one of the main classes of the security library.
Definition: validator.hpp:27
function< void(const shared_ptr< const Interest > &)> OnInterestValidated
Callback to report a successful Interest validation.