diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-04-23 00:57:35 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-04-23 00:57:35 +0000 |
| commit | 0151d3f521ac13e626209aca8ddf1b91487c0359 (patch) | |
| tree | 2d39ffa3f622ac73cef94ec1a07ac810a4bfd6b0 /cpp/src/qpid/acl/AclValidator.cpp | |
| parent | 329f1b6a959ab19f345ca4499c43590cf60c963d (diff) | |
| download | qpid-python-0151d3f521ac13e626209aca8ddf1b91487c0359.tar.gz | |
Changed from using arrays to using vectors.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@937119 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/acl/AclValidator.cpp')
| -rw-r--r-- | cpp/src/qpid/acl/AclValidator.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/cpp/src/qpid/acl/AclValidator.cpp b/cpp/src/qpid/acl/AclValidator.cpp index aeaf638f54..e2d13fea92 100644 --- a/cpp/src/qpid/acl/AclValidator.cpp +++ b/cpp/src/qpid/acl/AclValidator.cpp @@ -104,31 +104,28 @@ AclValidator::~AclValidator(){ /* Iterate through the data model and validate the parameters. */ void AclValidator::validate(boost::shared_ptr<AclData> d) { - - for (unsigned int cnt=0; cnt< qpid::acl::ACTIONSIZE; cnt++){ - if (d->actionList[cnt]){ + for (unsigned int cnt=0; cnt< qpid::acl::ACTIONSIZE; cnt++){ - for (unsigned int cnt1=0; cnt1< qpid::acl::OBJECTSIZE; cnt1++){ + for (unsigned int cnt1=0; cnt1< qpid::acl::OBJECTSIZE; cnt1++){ - if (d->actionList[cnt][cnt1]){ + if (!d->actionList[cnt].empty() && !d->actionList[cnt][cnt1].empty()){ + std::for_each(d->actionList[cnt][cnt1].begin(), + d->actionList[cnt][cnt1].end(), + boost::bind(&AclValidator::validateRuleSet, this, _1)); + } + } + } - std::for_each(d->actionList[cnt][cnt1]->begin(), - d->actionList[cnt][cnt1]->end(), - boost::bind(&AclValidator::validateRuleSet, this, _1)); - }//if - }//for - }//if - }//for } -void AclValidator::validateRuleSet(std::pair<const std::string, qpid::acl::AclData::ruleSet>& rules){ +void AclValidator::validateRuleSet(std::pair<const std::string, qpid::acl::AclData::RuleSet>& rules){ std::for_each(rules.second.begin(), rules.second.end(), boost::bind(&AclValidator::validateRule, this, _1)); } -void AclValidator::validateRule(qpid::acl::AclData::rule& rule){ +void AclValidator::validateRule(qpid::acl::AclData::Rule& rule){ std::for_each(rule.props.begin(), rule.props.end(), boost::bind(&AclValidator::validateProperty, this, _1)); |
