/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/qpid/client/SessionBase.h

00001 #ifndef QPID_CLIENT_SESSIONBASE_H
00002 #define QPID_CLIENT_SESSIONBASE_H
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  * 
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  * 
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
00022  *
00023  */
00024 
00025 #include "qpid/framing/Uuid.h"
00026 #include "qpid/framing/amqp_structs.h"
00027 #include "qpid/framing/ProtocolVersion.h"
00028 #include "qpid/framing/MethodContent.h"
00029 #include "qpid/framing/TransferContent.h"
00030 #include "qpid/client/Completion.h"
00031 #include "qpid/client/ConnectionImpl.h"
00032 #include "qpid/client/Response.h"
00033 #include "qpid/client/SessionCore.h"
00034 #include "qpid/client/TypedResult.h"
00035 #include "qpid/shared_ptr.h"
00036 #include <string>
00037 
00038 namespace qpid {
00039 namespace client {
00040 
00041 using std::string;
00042 using framing::Content;
00043 using framing::FieldTable;
00044 using framing::MethodContent;
00045 using framing::SequenceNumberSet;
00046 using framing::Uuid;
00047 
00071 enum SynchronousMode { SYNC=true, ASYNC=false };
00072 
00073 
00077 class SessionBase
00078 {
00079   public:
00080     SessionBase();
00081     ~SessionBase();
00082 
00084     framing::FrameSet::shared_ptr get();
00085     
00087     Uuid getId() const;
00088 
00100     void setSynchronous(SynchronousMode mode);
00101     void setSynchronous(bool set);
00102     bool isSynchronous() const;
00103     SynchronousMode getSynchronous() const;
00104 
00109     void suspend();
00110     
00112     void close();
00113 
00119     void sync();
00120     
00121     Execution& getExecution();
00122     
00123     typedef framing::TransferContent DefaultContent;
00124 
00125   protected:
00126     shared_ptr<SessionCore> impl;
00127     framing::ProtocolVersion version;
00128     friend class Connection;
00129     SessionBase(shared_ptr<SessionCore>);
00130 };
00131 
00132 }} // namespace qpid::client
00133 
00134 #endif  

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