Author: shuston
Date: Thu Oct 30 16:12:22 2008
New Revision: 709281

URL: http://svn.apache.org/viewvc?rev=709281&view=rev
Log:
Adjust namespace references to work with MSVC

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxAck.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Vhost.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/management/ManagementObject.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp?rev=709281&r1=709280&r2=709281&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp Thu Oct 30 
16:12:22 2008
@@ -35,7 +35,6 @@
 #include <iostream>
 #include <assert.h>
 
-using namespace boost;
 using namespace qpid::sys;
 using namespace qpid::framing;
 using namespace qpid::sys;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp?rev=709281&r1=709280&r2=709281&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp Thu Oct 30 
16:12:22 2008
@@ -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 @@
 {
     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);

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxAck.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxAck.cpp?rev=709281&r1=709280&r2=709281&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxAck.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxAck.cpp Thu Oct 30 
16:12:22 2008
@@ -26,7 +26,7 @@
 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)));

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp?rev=709281&r1=709280&r2=709281&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp Thu Oct 30 16:12:22 
2008
@@ -50,7 +50,7 @@
            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 @@
 
     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 @@
     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)
     {

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp?rev=709281&r1=709280&r2=709281&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp Thu Oct 30 
16:12:22 2008
@@ -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 @@
     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 @@
 {
     replacement[qfor] = msg;
 }
+
+}} // namespace qpid::broker

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp?rev=709281&r1=709280&r2=709281&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp 
(original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp Thu 
Oct 30 16:12:22 2008
@@ -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 @@
 {
     TRANSFER_EXCEPTION(store->collectPreparedXids(xids));
 }
+
+}} // namespace qpid::broker

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp?rev=709281&r1=709280&r2=709281&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp 
(original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp Thu Oct 
30 16:12:22 2008
@@ -44,11 +44,6 @@
     }
 };
 
-}
-}
-
-using namespace qpid::broker;
-
 NullMessageStore::NullMessageStore(bool _warn) : warn(_warn), 
nextPersistenceId(1) {}
 
 bool NullMessageStore::init(const Options* /*options*/) {return true;}
@@ -168,3 +163,6 @@
 {
     out.insert(prepared.begin(), prepared.end());
 }
+
+
+}}  // namespace qpid::broker

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Vhost.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Vhost.cpp?rev=709281&r1=709280&r2=709281&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Vhost.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Vhost.cpp Thu Oct 30 16:12:22 
2008
@@ -24,7 +24,9 @@
 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)
     {

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/management/ManagementObject.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/management/ManagementObject.cpp?rev=709281&r1=709280&r2=709281&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/management/ManagementObject.cpp 
(original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/management/ManagementObject.cpp Thu 
Oct 30 16:12:22 2008
@@ -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(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 @@
 
 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::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;


Reply via email to