summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/acl/AclReader.cpp
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2010-04-23 00:57:35 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2010-04-23 00:57:35 +0000
commit0151d3f521ac13e626209aca8ddf1b91487c0359 (patch)
tree2d39ffa3f622ac73cef94ec1a07ac810a4bfd6b0 /cpp/src/qpid/acl/AclReader.cpp
parent329f1b6a959ab19f345ca4499c43590cf60c963d (diff)
downloadqpid-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/AclReader.cpp')
-rw-r--r--cpp/src/qpid/acl/AclReader.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/cpp/src/qpid/acl/AclReader.cpp b/cpp/src/qpid/acl/AclReader.cpp
index 2f59f4453f..966e69d9f5 100644
--- a/cpp/src/qpid/acl/AclReader.cpp
+++ b/cpp/src/qpid/acl/AclReader.cpp
@@ -101,7 +101,7 @@ void AclReader::loadDecisionData(boost::shared_ptr<AclData> d) {
<< AclHelper::getAclResultStr(d->decisionMode));
foundmode = true;
} else {
- AclData::rule rule((*i)->props);
+ AclData::Rule rule((*i)->props);
bool addrule = true;
switch ((*i)->res) {
@@ -138,17 +138,15 @@ void AclReader::loadDecisionData(boost::shared_ptr<AclData> d) {
acnt < acl::ACTIONSIZE;
(*i)->actionAll ? acnt++ : acnt = acl::ACTIONSIZE) {
- if (acnt == acl::ACT_PUBLISH)
+ if (acnt == acl::ACT_PUBLISH) {
d->transferAcl = true; // we have transfer ACL
-
+ QPID_LOG(debug, "Transfer ACL enabled !");
+ }
+
actionstr << AclHelper::getActionStr((Action) acnt) << ",";
- //find the Action, create if not exist
- if (d->actionList[acnt] == NULL) {
- d->actionList[acnt] =
- new AclData::aclAction[qpid::acl::OBJECTSIZE];
- for (int j = 0; j < qpid::acl::OBJECTSIZE; j++)
- d->actionList[acnt][j] = NULL;
+ if (d->actionList[acnt].empty()){
+ d->actionList[acnt] = AclData::AclAction(qpid::acl::OBJECTSIZE);
}
// optimize this loop to limit to valid options only!!
@@ -157,11 +155,6 @@ void AclReader::loadDecisionData(boost::shared_ptr<AclData> d) {
ocnt < acl::OBJECTSIZE;
(*i)->objStatus != aclRule::VALUE ? ocnt++ : ocnt = acl::OBJECTSIZE) {
- //find the Object, create if not exist
- if (d->actionList[acnt][ocnt] == NULL)
- d->actionList[acnt][ocnt] =
- new AclData::actionObject;
-
// add users and Rule to object set
bool allNames = false;
// check to see if names.begin is '*'
@@ -173,13 +166,13 @@ void AclReader::loadDecisionData(boost::shared_ptr<AclData> d) {
itr != (allNames ? names.end() : (*i)->names.end());
itr++) {
- AclData::actObjItr itrRule =
- d->actionList[acnt][ocnt]->find(*itr);
+ AclData::ActObjItr itrRule =
+ d->actionList[acnt][ocnt].find(*itr);
- if (itrRule == d->actionList[acnt][ocnt]->end()) {
- AclData::ruleSet rSet;
+ if (itrRule == d->actionList[acnt][ocnt].end()) {
+ AclData::RuleSet rSet;
rSet.push_back(rule);
- d->actionList[acnt][ocnt]->insert
+ d->actionList[acnt][ocnt].insert
(make_pair(std::string(*itr), rSet));
} else {
// TODO add code to check for dead rules