/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/qpid/broker/TxPublish.h

00001 /*
00002  *
00003  * Licensed to the Apache Software Foundation (ASF) under one
00004  * or more contributor license agreements.  See the NOTICE file
00005  * distributed with this work for additional information
00006  * regarding copyright ownership.  The ASF licenses this file
00007  * to you under the Apache License, Version 2.0 (the
00008  * "License"); you may not use this file except in compliance
00009  * with the License.  You may obtain a copy of the License at
00010  * 
00011  *   http://www.apache.org/licenses/LICENSE-2.0
00012  * 
00013  * Unless required by applicable law or agreed to in writing,
00014  * software distributed under the License is distributed on an
00015  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00016  * KIND, either express or implied.  See the License for the
00017  * specific language governing permissions and limitations
00018  * under the License.
00019  *
00020  */
00021 #ifndef _TxPublish_
00022 #define _TxPublish_
00023 
00024 #include "Queue.h"
00025 #include "Deliverable.h"
00026 #include "Message.h"
00027 #include "MessageStore.h"
00028 #include "TxOp.h"
00029 
00030 #include <algorithm>
00031 #include <functional>
00032 #include <list>
00033 
00034 #include <boost/intrusive_ptr.hpp>
00035 
00036 namespace qpid {
00037     namespace broker {
00048         class TxPublish : public TxOp, public Deliverable{
00049             class Prepare{
00050                 TransactionContext* ctxt;
00051                 boost::intrusive_ptr<Message>& msg;
00052             public:
00053                 Prepare(TransactionContext* ctxt, boost::intrusive_ptr<Message>& msg);
00054                 void operator()(Queue::shared_ptr& queue);            
00055             };
00056 
00057             class Commit{
00058                 boost::intrusive_ptr<Message>& msg;
00059             public:
00060                 Commit(boost::intrusive_ptr<Message>& msg);
00061                 void operator()(Queue::shared_ptr& queue);            
00062             };
00063 
00064             boost::intrusive_ptr<Message> msg;
00065             std::list<Queue::shared_ptr> queues;
00066 
00067         public:
00068             TxPublish(boost::intrusive_ptr<Message> msg);
00069             virtual bool prepare(TransactionContext* ctxt) throw();
00070             virtual void commit() throw();
00071             virtual void rollback() throw();
00072             
00073             virtual void deliverTo(Queue::shared_ptr& queue);
00074 
00075             virtual ~TxPublish(){}
00076 
00077             uint64_t contentSize();
00078         };
00079     }
00080 }
00081 
00082 
00083 #endif

Generated on Thu Apr 10 11:08:17 2008 for Qpid by  doxygen 1.4.7