diff options
| author | Gordon Sim <gsim@apache.org> | 2008-09-21 20:39:40 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-09-21 20:39:40 +0000 |
| commit | 03fa9018260242f08d2164f06875fc708fdbf4c7 (patch) | |
| tree | 47bcba0feec9e95ecb06dfb0379b7abdf41c30f8 /cpp/src/qpid/broker/QueuedMessage.h | |
| parent | 558e92d6c9cf8dfb875c1250ab8fe1cefaf30b05 (diff) | |
| download | qpid-python-03fa9018260242f08d2164f06875fc708fdbf4c7.tar.gz | |
Refactoring of queue/queue-policy:
- moved some logic out of Queue.cpp into QueuePolicy.cpp
- moved QueuedMessage definition into its own header file
- added checks for requeue and dequeue
- split QueuePolicy logic into different sub classes
Added ability to request old messages to be discareded to make room for new ones when configured limit has been reached.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@697603 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/QueuedMessage.h')
| -rw-r--r-- | cpp/src/qpid/broker/QueuedMessage.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/QueuedMessage.h b/cpp/src/qpid/broker/QueuedMessage.h new file mode 100644 index 0000000000..82f5073d87 --- /dev/null +++ b/cpp/src/qpid/broker/QueuedMessage.h @@ -0,0 +1,46 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +#ifndef _QueuedMessage_ +#define _QueuedMessage_ + +#include "Message.h" + +namespace qpid { +namespace broker { + +class Queue; + +struct QueuedMessage +{ + boost::intrusive_ptr<Message> payload; + framing::SequenceNumber position; + Queue* queue; + + QueuedMessage() : queue(0) {} + QueuedMessage(Queue* q, boost::intrusive_ptr<Message> msg, framing::SequenceNumber sn) : + payload(msg), position(sn), queue(q) {} + QueuedMessage(Queue* q) : queue(q) {} +}; + +}} + + +#endif |
