diff options
| author | Alan Conway <aconway@apache.org> | 2009-07-21 15:05:51 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2009-07-21 15:05:51 +0000 |
| commit | 6f0e2063cf8a4e6861e6c8167109f9beaab151f3 (patch) | |
| tree | add786d4dbcdf8cc2aa691426952a0ef79141376 /cpp/src/qpid/broker | |
| parent | d19993e687876d9a7baab81c41deff0f9dc7600a (diff) | |
| download | qpid-python-6f0e2063cf8a4e6861e6c8167109f9beaab151f3.tar.gz | |
Remove some unnecessary promotions of char* to std::string.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@796333 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
| -rw-r--r-- | cpp/src/qpid/broker/SemanticState.cpp | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/SessionAdapter.cpp | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp index d77bd9b7ca..37a9e9b4af 100644 --- a/cpp/src/qpid/broker/SemanticState.cpp +++ b/cpp/src/qpid/broker/SemanticState.cpp @@ -228,6 +228,8 @@ void SemanticState::record(const DeliveryRecord& delivery) unacked.push_back(delivery); } +const std::string QPID_SYNC_FREQUENCY("qpid.sync_frequency"); + SemanticState::ConsumerImpl::ConsumerImpl(SemanticState* _parent, const string& _name, Queue::shared_ptr _queue, @@ -255,7 +257,7 @@ SemanticState::ConsumerImpl::ConsumerImpl(SemanticState* _parent, msgCredit(0), byteCredit(0), notifyEnabled(true), - syncFrequency(_arguments.getAsInt("qpid.sync_frequency")), + syncFrequency(_arguments.getAsInt(QPID_SYNC_FREQUENCY)), deliveryCount(0) {} diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp index e52274597e..6f1d42249d 100644 --- a/cpp/src/qpid/broker/SessionAdapter.cpp +++ b/cpp/src/qpid/broker/SessionAdapter.cpp @@ -57,6 +57,8 @@ SessionAdapter::SessionAdapter(SemanticState& s) : dtxImpl(s) {} +static const std::string TRUE("true"); +static const std::string FALSE("false"); void SessionAdapter::ExchangeHandlerImpl::declare(const string& exchange, const string& type, const string& alternateExchange, @@ -67,8 +69,8 @@ void SessionAdapter::ExchangeHandlerImpl::declare(const string& exchange, const std::map<acl::Property, std::string> params; params.insert(make_pair(acl::PROP_TYPE, type)); params.insert(make_pair(acl::PROP_ALTERNATE, alternateExchange)); - params.insert(make_pair(acl::PROP_PASSIVE, std::string(passive ? "true" : "false") )); - params.insert(make_pair(acl::PROP_DURABLE, std::string(durable ? "true" : "false"))); + params.insert(make_pair(acl::PROP_PASSIVE, std::string(passive ? TRUE : FALSE) )); + params.insert(make_pair(acl::PROP_DURABLE, std::string(durable ? TRUE : FALSE))); if (!acl->authorise(getConnection().getUserId(),acl::ACT_CREATE,acl::OBJ_EXCHANGE,exchange,¶ms) ) throw NotAllowedException(QPID_MSG("ACL denied exhange declare request from " << getConnection().getUserId())); } @@ -325,10 +327,10 @@ void SessionAdapter::QueueHandlerImpl::declare(const string& name, const string& if (acl) { std::map<acl::Property, std::string> params; params.insert(make_pair(acl::PROP_ALTERNATE, alternateExchange)); - params.insert(make_pair(acl::PROP_PASSIVE, std::string(passive ? "true" : "false") )); - params.insert(make_pair(acl::PROP_DURABLE, std::string(durable ? "true" : "false"))); - params.insert(make_pair(acl::PROP_EXCLUSIVE, std::string(exclusive ? "true" : "false"))); - params.insert(make_pair(acl::PROP_AUTODELETE, std::string(autoDelete ? "true" : "false"))); + params.insert(make_pair(acl::PROP_PASSIVE, std::string(passive ? TRUE : FALSE) )); + params.insert(make_pair(acl::PROP_DURABLE, std::string(durable ? TRUE : FALSE))); + params.insert(make_pair(acl::PROP_EXCLUSIVE, std::string(exclusive ? TRUE : FALSE))); + params.insert(make_pair(acl::PROP_AUTODELETE, std::string(autoDelete ? TRUE : FALSE))); if (!acl->authorise(getConnection().getUserId(),acl::ACT_CREATE,acl::OBJ_QUEUE,name,¶ms) ) throw NotAllowedException(QPID_MSG("ACL denied queue create request from " << getConnection().getUserId())); } |
