diff options
| author | Stephen D. Huston <shuston@apache.org> | 2008-10-30 23:12:22 +0000 |
|---|---|---|
| committer | Stephen D. Huston <shuston@apache.org> | 2008-10-30 23:12:22 +0000 |
| commit | fe67c148e7df4b2eecd1c241a5ef00abebc2060f (patch) | |
| tree | f8247440b194178a827152b8b5e1654b225346d1 /qpid/cpp | |
| parent | 3229a62debea661e6842bec0c7e1bc3eac6b1c61 (diff) | |
| download | qpid-python-fe67c148e7df4b2eecd1c241a5ef00abebc2060f.tar.gz | |
Adjust namespace references to work with MSVC
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@709281 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Connection.cpp | 1 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/DeliveryRecord.cpp | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/DtxAck.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Link.cpp | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Message.cpp | 12 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/MessageStoreModule.cpp | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/NullMessageStore.cpp | 8 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Vhost.cpp | 4 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/management/ManagementObject.cpp | 24 |
9 files changed, 41 insertions, 28 deletions
diff --git a/qpid/cpp/src/qpid/broker/Connection.cpp b/qpid/cpp/src/qpid/broker/Connection.cpp index 3ed41a3f2d..47ad8f74b7 100644 --- a/qpid/cpp/src/qpid/broker/Connection.cpp +++ b/qpid/cpp/src/qpid/broker/Connection.cpp @@ -35,7 +35,6 @@ #include <iostream> #include <assert.h> -using namespace boost; using namespace qpid::sys; using namespace qpid::framing; using namespace qpid::sys; diff --git a/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp b/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp index 31ccdd8260..1a15373e6a 100644 --- a/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp +++ b/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp @@ -26,8 +26,8 @@ #include "qpid/framing/FrameHandler.h" #include "qpid/framing/MessageTransferBody.h" +using namespace qpid; using namespace qpid::broker; -using namespace qpid::framing; using std::string; DeliveryRecord::DeliveryRecord(const QueuedMessage& _msg, @@ -88,10 +88,10 @@ void DeliveryRecord::deliver(framing::FrameHandler& h, DeliveryId deliveryId, ui { id = deliveryId; if (msg.payload->getRedelivered()){ - msg.payload->getProperties<DeliveryProperties>()->setRedelivered(true); + msg.payload->getProperties<framing::DeliveryProperties>()->setRedelivered(true); } - AMQFrame method(in_place<MessageTransferBody>(ProtocolVersion(), tag, acceptExpected ? 0 : 1, acquired ? 0 : 1)); + framing::AMQFrame method(framing::in_place<framing::MessageTransferBody>(framing::ProtocolVersion(), tag, acceptExpected ? 0 : 1, acquired ? 0 : 1)); method.setEof(false); h.handle(method); msg.payload->sendHeader(h, framesize); diff --git a/qpid/cpp/src/qpid/broker/DtxAck.cpp b/qpid/cpp/src/qpid/broker/DtxAck.cpp index 47637369ca..100ce2492d 100644 --- a/qpid/cpp/src/qpid/broker/DtxAck.cpp +++ b/qpid/cpp/src/qpid/broker/DtxAck.cpp @@ -26,7 +26,7 @@ using std::bind2nd; using std::mem_fun_ref; using namespace qpid::broker; -DtxAck::DtxAck(const framing::SequenceSet& acked, std::list<DeliveryRecord>& unacked) +DtxAck::DtxAck(const qpid::framing::SequenceSet& acked, std::list<DeliveryRecord>& unacked) { remove_copy_if(unacked.begin(), unacked.end(), inserter(pending, pending.end()), not1(bind2nd(mem_fun_ref(&DeliveryRecord::coveredBy), &acked))); diff --git a/qpid/cpp/src/qpid/broker/Link.cpp b/qpid/cpp/src/qpid/broker/Link.cpp index a814c12eed..5cd976ee08 100644 --- a/qpid/cpp/src/qpid/broker/Link.cpp +++ b/qpid/cpp/src/qpid/broker/Link.cpp @@ -50,7 +50,7 @@ Link::Link(LinkRegistry* _links, string& _username, string& _password, Broker* _broker, - management::Manageable* parent) + Manageable* parent) : links(_links), store(_store), host(_host), port(_port), transport(_transport), durable(_durable), @@ -161,7 +161,7 @@ void Link::destroy () AclModule* acl = getBroker()->getAcl(); std::string userID = getUsername() + "@" + getBroker()->getOptions().realm; - if (acl && !acl->authorise(userID,acl::DELETE,acl::LINK,"")){ + if (acl && !acl->authorise(userID,acl::ACT_DELETE,acl::OBJ_LINK,"")){ throw NotAllowedException("ACL denied delete link request"); } @@ -336,7 +336,7 @@ ManagementObject* Link::GetManagementObject (void) const return (ManagementObject*) mgmtObject; } -Manageable::status_t Link::ManagementMethod (uint32_t op, management::Args& args, string& text) +Manageable::status_t Link::ManagementMethod (uint32_t op, Args& args, string& text) { switch (op) { diff --git a/qpid/cpp/src/qpid/broker/Message.cpp b/qpid/cpp/src/qpid/broker/Message.cpp index 4a63962ecf..d2c5682359 100644 --- a/qpid/cpp/src/qpid/broker/Message.cpp +++ b/qpid/cpp/src/qpid/broker/Message.cpp @@ -33,17 +33,19 @@ #include <time.h> using boost::intrusive_ptr; -using namespace qpid::broker; -using namespace qpid::framing; using qpid::sys::AbsTime; using qpid::sys::Duration; using qpid::sys::TIME_MSEC; using qpid::sys::FAR_FUTURE; using std::string; +using namespace qpid::framing; + +namespace qpid { +namespace broker { TransferAdapter Message::TRANSFER; -Message::Message(const SequenceNumber& id) : frames(id), persistenceId(0), redelivered(false), loaded(false), + Message::Message(const framing::SequenceNumber& id) : frames(id), persistenceId(0), redelivered(false), loaded(false), staged(false), forcePersistentPolicy(false), publisher(0), adapter(0), expiration(FAR_FUTURE) {} @@ -109,7 +111,7 @@ void Message::encode(framing::Buffer& buffer) const frames.map_if(f1, TypeFilter2<METHOD_BODY, HEADER_BODY>()); //then encode the payload of each content frame - EncodeBody f2(buffer); + framing::EncodeBody f2(buffer); frames.map_if(f2, TypeFilter<CONTENT_BODY>()); } @@ -338,3 +340,5 @@ void Message::setReplacementMessage(boost::intrusive_ptr<Message> msg, const Que { replacement[qfor] = msg; } + +}} // namespace qpid::broker diff --git a/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp b/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp index c9528b9d98..20f5b98b6b 100644 --- a/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp +++ b/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp @@ -26,9 +26,11 @@ #define TRANSFER_EXCEPTION(fn) try { fn; } catch (std::exception& e) { throw Exception(e.what()); } using boost::intrusive_ptr; -using namespace qpid::broker; using qpid::framing::FieldTable; +namespace qpid { +namespace broker { + MessageStoreModule::MessageStoreModule(MessageStore* _store) : store(_store) {} MessageStoreModule::~MessageStoreModule() @@ -162,3 +164,5 @@ void MessageStoreModule::collectPreparedXids(std::set<std::string>& xids) { TRANSFER_EXCEPTION(store->collectPreparedXids(xids)); } + +}} // namespace qpid::broker diff --git a/qpid/cpp/src/qpid/broker/NullMessageStore.cpp b/qpid/cpp/src/qpid/broker/NullMessageStore.cpp index e1c7fe240d..edb4cc7d97 100644 --- a/qpid/cpp/src/qpid/broker/NullMessageStore.cpp +++ b/qpid/cpp/src/qpid/broker/NullMessageStore.cpp @@ -44,11 +44,6 @@ public: } }; -} -} - -using namespace qpid::broker; - NullMessageStore::NullMessageStore(bool _warn) : warn(_warn), nextPersistenceId(1) {} bool NullMessageStore::init(const Options* /*options*/) {return true;} @@ -168,3 +163,6 @@ void NullMessageStore::collectPreparedXids(std::set<string>& out) { out.insert(prepared.begin(), prepared.end()); } + + +}} // namespace qpid::broker diff --git a/qpid/cpp/src/qpid/broker/Vhost.cpp b/qpid/cpp/src/qpid/broker/Vhost.cpp index c030d4c51f..537d2b4e29 100644 --- a/qpid/cpp/src/qpid/broker/Vhost.cpp +++ b/qpid/cpp/src/qpid/broker/Vhost.cpp @@ -24,7 +24,9 @@ using namespace qpid::broker; using qpid::management::ManagementAgent; namespace _qmf = qmf::org::apache::qpid::broker; -Vhost::Vhost (management::Manageable* parentBroker) : mgmtObject(0) +class qpid::management::Manageable; + +Vhost::Vhost (qpid::management::Manageable* parentBroker) : mgmtObject(0) { if (parentBroker != 0) { diff --git a/qpid/cpp/src/qpid/management/ManagementObject.cpp b/qpid/cpp/src/qpid/management/ManagementObject.cpp index 09abbeb0ca..5a40e3f619 100644 --- a/qpid/cpp/src/qpid/management/ManagementObject.cpp +++ b/qpid/cpp/src/qpid/management/ManagementObject.cpp @@ -23,10 +23,12 @@ #include "ManagementObject.h" #include "qpid/agent/ManagementAgent.h" #include "qpid/framing/FieldTable.h" +#include "qpid/sys/Thread.h" -using namespace qpid::framing; +#include <stdlib.h> + +using namespace qpid; using namespace qpid::management; -using namespace qpid::sys; void AgentAttachment::setBanks(uint32_t broker, uint32_t bank) { @@ -57,20 +59,24 @@ ObjectId::ObjectId(AgentAttachment* _agent, uint8_t flags, uint16_t seq, uint64_ ObjectId::ObjectId(std::istream& in) : agent(0) { - string text; + std::string text; in >> text; fromString(text); } -ObjectId::ObjectId(const string& text) : agent(0) +ObjectId::ObjectId(const std::string& text) : agent(0) { fromString(text); } -void ObjectId::fromString(const string& text) +void ObjectId::fromString(const std::string& text) { #define FIELDS 5 - string copy(text.c_str()); +#if defined (_WIN32) && !defined (atoll) +# define atoll(X) _atoi64(X) +#endif + + std::string copy(text.c_str()); char* cText; char* field[FIELDS]; bool atFieldStart = true; @@ -152,12 +158,12 @@ std::ostream& operator<<(std::ostream& out, const ObjectId& i) int ManagementObject::nextThreadIndex = 0; -void ManagementObject::writeTimestamps (Buffer& buf) +void ManagementObject::writeTimestamps (framing::Buffer& buf) { buf.putShortString (getPackageName ()); buf.putShortString (getClassName ()); buf.putBin128 (getMd5Sum ()); - buf.putLongLong (uint64_t (Duration (now ()))); + buf.putLongLong (uint64_t (sys::Duration (sys::now ()))); buf.putLongLong (createTime); buf.putLongLong (destroyTime); objectId.encode(buf); @@ -166,7 +172,7 @@ void ManagementObject::writeTimestamps (Buffer& buf) void ManagementObject::setReference(ObjectId) {} int ManagementObject::getThreadIndex() { - static __thread int thisIndex = -1; + static QPID_TSS int thisIndex = -1; if (thisIndex == -1) { sys::Mutex::ScopedLock mutex(accessLock); thisIndex = nextThreadIndex; |
