You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2006/11/10 15:35:03 UTC

svn commit: r473352 - in /incubator/qpid/trunk/qpid/cpp/src/qpid: broker/Queue.h client/Message.cpp client/Message.h framing/BasicHeaderProperties.h

Author: gsim
Date: Fri Nov 10 06:35:02 2006
New Revision: 473352

URL: http://svn.apache.org/viewvc?view=rev&rev=473352
Log:
Some more riguorous 'const' declarations in basic header properties. Some more comments in queue header.


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/BasicHeaderProperties.h

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h?view=diff&rev=473352&r1=473351&r2=473352
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h Fri Nov 10 06:35:02 2006
@@ -103,7 +103,6 @@
             void dispatch();
             void consume(Consumer* c, bool exclusive = false);
             void cancel(Consumer* c);
-            Message::shared_ptr dequeue();
             u_int32_t purge();
             u_int32_t getMessageCount() const;
             u_int32_t getConsumerCount() const;
@@ -116,7 +115,14 @@
             bool canAutoDelete() const;
 
             void enqueue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid);
+            /**
+             * dequeue from store (only done once messages is acknowledged)
+             */
             void dequeue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid);
+            /**
+             * dequeues from memory only
+             */
+            Message::shared_ptr dequeue();
         };
     }
 }

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.cpp?view=diff&rev=473352&r1=473351&r2=473352
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.cpp Fri Nov 10 06:35:02 2006
@@ -34,11 +34,11 @@
     return dynamic_cast<BasicHeaderProperties*>(header->getProperties());
 }
 
-std::string& Message::getContentType(){ 
+const std::string& Message::getContentType(){ 
     return getHeaderProperties()->getContentType(); 
 }
 
-std::string& Message::getContentEncoding(){ 
+const std::string& Message::getContentEncoding(){ 
     return getHeaderProperties()->getContentEncoding(); 
 }
 
@@ -54,19 +54,19 @@
     return getHeaderProperties()->getPriority(); 
 }
 
-std::string& Message::getCorrelationId(){
+const std::string& Message::getCorrelationId(){
     return getHeaderProperties()->getCorrelationId(); 
 }
 
-std::string& Message::getReplyTo(){ 
+const std::string& Message::getReplyTo(){ 
     return getHeaderProperties()->getReplyTo(); 
 }
 
-std::string& Message::getExpiration(){ 
+const std::string& Message::getExpiration(){ 
     return getHeaderProperties()->getExpiration(); 
 }
 
-std::string& Message::getMessageId(){
+const std::string& Message::getMessageId(){
     return getHeaderProperties()->getMessageId(); 
 }
 
@@ -74,31 +74,31 @@
     return getHeaderProperties()->getTimestamp(); 
 }
 
-std::string& Message::getType(){ 
+const std::string& Message::getType(){ 
     return getHeaderProperties()->getType(); 
 }
 
-std::string& Message::getUserId(){ 
+const std::string& Message::getUserId(){ 
     return getHeaderProperties()->getUserId(); 
 }
 
-std::string& Message::getAppId(){ 
+const std::string& Message::getAppId(){ 
     return getHeaderProperties()->getAppId(); 
 }
 
-std::string& Message::getClusterId(){ 
+const std::string& Message::getClusterId(){ 
     return getHeaderProperties()->getClusterId(); 
 }
 
-void Message::setContentType(std::string& type){ 
+void Message::setContentType(const std::string& type){ 
     getHeaderProperties()->setContentType(type); 
 }
 
-void Message::setContentEncoding(std::string& encoding){ 
+void Message::setContentEncoding(const std::string& encoding){ 
     getHeaderProperties()->setContentEncoding(encoding); 
 }
 
-void Message::setHeaders(FieldTable& headers){ 
+void Message::setHeaders(const FieldTable& headers){ 
     getHeaderProperties()->setHeaders(headers); 
 }
 
@@ -110,19 +110,19 @@
     getHeaderProperties()->setPriority(priority); 
 }
 
-void Message::setCorrelationId(std::string& correlationId){ 
+void Message::setCorrelationId(const std::string& correlationId){ 
     getHeaderProperties()->setCorrelationId(correlationId); 
 }
 
-void Message::setReplyTo(std::string& replyTo){ 
+void Message::setReplyTo(const std::string& replyTo){ 
     getHeaderProperties()->setReplyTo(replyTo);
 }
 
-void Message::setExpiration(std::string&  expiration){ 
+void Message::setExpiration(const std::string&  expiration){ 
     getHeaderProperties()->setExpiration(expiration); 
 }
 
-void Message::setMessageId(std::string& messageId){ 
+void Message::setMessageId(const std::string& messageId){ 
     getHeaderProperties()->setMessageId(messageId); 
 }
 
@@ -130,18 +130,18 @@
     getHeaderProperties()->setTimestamp(timestamp); 
 }
 
-void Message::setType(std::string& type){ 
+void Message::setType(const std::string& type){ 
     getHeaderProperties()->setType(type); 
 }
 
-void Message::setUserId(std::string& userId){ 
+void Message::setUserId(const std::string& userId){ 
     getHeaderProperties()->setUserId(userId); 
 }
 
-void Message::setAppId(std::string& appId){
+void Message::setAppId(const std::string& appId){
     getHeaderProperties()->setAppId(appId); 
 }
 
-void Message::setClusterId(std::string& clusterId){ 
+void Message::setClusterId(const std::string& clusterId){ 
     getHeaderProperties()->setClusterId(clusterId); 
 }

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h?view=diff&rev=473352&r1=473351&r2=473352
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h Fri Nov 10 06:35:02 2006
@@ -45,35 +45,35 @@
 
         inline u_int64_t getDeliveryTag(){ return deliveryTag; }
 
-        std::string& getContentType();
-        std::string& getContentEncoding();
+        const std::string& getContentType();
+        const std::string& getContentEncoding();
         qpid::framing::FieldTable& getHeaders();
         u_int8_t getDeliveryMode();
         u_int8_t getPriority();
-        std::string& getCorrelationId();
-        std::string& getReplyTo();
-        std::string& getExpiration();
-        std::string& getMessageId();
+        const std::string& getCorrelationId();
+        const std::string& getReplyTo();
+        const std::string& getExpiration();
+        const std::string& getMessageId();
         u_int64_t getTimestamp();
-        std::string& getType();
-        std::string& getUserId();
-        std::string& getAppId();
-        std::string& getClusterId();
+        const std::string& getType();
+        const std::string& getUserId();
+        const std::string& getAppId();
+        const std::string& getClusterId();
 
-	void setContentType(std::string& type);
-	void setContentEncoding(std::string& encoding);
-	void setHeaders(qpid::framing::FieldTable& headers);
+	void setContentType(const std::string& type);
+	void setContentEncoding(const std::string& encoding);
+	void setHeaders(const qpid::framing::FieldTable& headers);
 	void setDeliveryMode(u_int8_t mode);
 	void setPriority(u_int8_t priority);
-	void setCorrelationId(std::string& correlationId);
-	void setReplyTo(std::string& replyTo);
-	void setExpiration(std::string&  expiration);
-	void setMessageId(std::string& messageId);
+	void setCorrelationId(const std::string& correlationId);
+	void setReplyTo(const std::string& replyTo);
+	void setExpiration(const std::string&  expiration);
+	void setMessageId(const std::string& messageId);
 	void setTimestamp(u_int64_t timestamp);
-	void setType(std::string& type);
-	void setUserId(std::string& userId);
-	void setAppId(std::string& appId);
-	void setClusterId(std::string& clusterId);
+	void setType(const std::string& type);
+	void setUserId(const std::string& userId);
+	void setAppId(const std::string& appId);
+	void setClusterId(const std::string& clusterId);
 
 
 	friend class Channel;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/BasicHeaderProperties.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/BasicHeaderProperties.h?view=diff&rev=473352&r1=473351&r2=473352
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/BasicHeaderProperties.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/BasicHeaderProperties.h Fri Nov 10 06:35:02 2006
@@ -54,37 +54,37 @@
 	virtual void encode(Buffer& buffer) const;
 	virtual void decode(Buffer& buffer, u_int32_t size);
 
-	inline virtual u_int8_t classId(){ return BASIC; }
+	inline virtual u_int8_t classId() { return BASIC; }
 
-	inline string& getContentType(){ return contentType; }
-	inline string& getContentEncoding(){ return contentEncoding; }
-	inline FieldTable& getHeaders(){ return headers; }
-	inline u_int8_t getDeliveryMode(){ return deliveryMode; }
-	inline u_int8_t getPriority(){ return priority; }
-	inline string& getCorrelationId(){return correlationId; }
-	inline string& getReplyTo(){ return replyTo; }
-	inline string& getExpiration(){ return expiration; }
-	inline string& getMessageId(){return messageId; }
-	inline u_int64_t getTimestamp(){ return timestamp; }
-	inline string& getType(){ return type; }
-	inline string& getUserId(){ return userId; }
-	inline string& getAppId(){ return appId; }
-	inline string& getClusterId(){ return clusterId; }
+	inline const string& getContentType() const { return contentType; }
+	inline const string& getContentEncoding() const { return contentEncoding; }
+	inline FieldTable& getHeaders() { return headers; }
+	inline u_int8_t getDeliveryMode() const { return deliveryMode; }
+	inline u_int8_t getPriority() const { return priority; }
+	inline const string& getCorrelationId() const {return correlationId; }
+	inline const string& getReplyTo() const { return replyTo; }
+	inline const string& getExpiration() const { return expiration; }
+	inline const string& getMessageId() const {return messageId; }
+	inline u_int64_t getTimestamp() const { return timestamp; }
+	inline const string& getType() const { return type; }
+	inline const string& getUserId() const { return userId; }
+	inline const string& getAppId() const { return appId; }
+	inline const string& getClusterId() const { return clusterId; }
 
-	void inline setContentType(string& _type){ contentType = _type; }
-	void inline setContentEncoding(string& encoding){ contentEncoding = encoding; }
-	void inline setHeaders(FieldTable& _headers){ headers = _headers; }
+	void inline setContentType(const string& _type){ contentType = _type; }
+	void inline setContentEncoding(const string& encoding){ contentEncoding = encoding; }
+	void inline setHeaders(const FieldTable& _headers){ headers = _headers; }
 	void inline setDeliveryMode(u_int8_t mode){ deliveryMode = mode; }
 	void inline setPriority(u_int8_t _priority){ priority = _priority; }
-	void inline setCorrelationId(string& _correlationId){ correlationId = _correlationId; }
-	void inline setReplyTo(string& _replyTo){ replyTo = _replyTo;}
-	void inline setExpiration(string&  _expiration){ expiration = _expiration; }
-	void inline setMessageId(string& _messageId){ messageId = _messageId; }
+	void inline setCorrelationId(const string& _correlationId){ correlationId = _correlationId; }
+	void inline setReplyTo(const string& _replyTo){ replyTo = _replyTo;}
+	void inline setExpiration(const string&  _expiration){ expiration = _expiration; }
+	void inline setMessageId(const string& _messageId){ messageId = _messageId; }
 	void inline setTimestamp(u_int64_t _timestamp){ timestamp = _timestamp; }
-	void inline setType(string& _type){ type = _type; }
-	void inline setUserId(string& _userId){ userId = _userId; }
-	void inline setAppId(string& _appId){appId = _appId; }
-	void inline setClusterId(string& _clusterId){ clusterId = _clusterId; }
+	void inline setType(const string& _type){ type = _type; }
+	void inline setUserId(const string& _userId){ userId = _userId; }
+	void inline setAppId(const string& _appId){appId = _appId; }
+	void inline setClusterId(const string& _clusterId){ clusterId = _clusterId; }
     };
 
 }