Qpid C++ Messaging API  0.20
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Connection.h
Go to the documentation of this file.
1 #ifndef QPID_MESSAGING_CONNECTION_H
2 #define QPID_MESSAGING_CONNECTION_H
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
25 
26 #include "qpid/messaging/Handle.h"
28 #include "qpid/types/Variant.h"
29 
30 #include <string>
31 
32 namespace qpid {
33 namespace messaging {
34 
35 #ifndef SWIG
36 template <class> class PrivateImplRef;
37 #endif
38 class ConnectionImpl;
39 class Session;
40 
46 {
47  public:
48  QPID_MESSAGING_EXTERN Connection(ConnectionImpl* impl);
49  QPID_MESSAGING_EXTERN Connection(const Connection&);
50  QPID_MESSAGING_EXTERN Connection();
82  QPID_MESSAGING_EXTERN Connection(const std::string& url, const qpid::types::Variant::Map& options = qpid::types::Variant::Map());
89  QPID_MESSAGING_EXTERN Connection(const std::string& url, const std::string& options);
90  QPID_MESSAGING_EXTERN ~Connection();
91  QPID_MESSAGING_EXTERN Connection& operator=(const Connection&);
92  QPID_MESSAGING_EXTERN void setOption(const std::string& name, const qpid::types::Variant& value);
93  QPID_MESSAGING_EXTERN void open();
94  QPID_MESSAGING_EXTERN bool isOpen();
95  QPID_MESSAGING_EXTERN bool isOpen() const;
101  QPID_MESSAGING_EXTERN void close();
102  QPID_MESSAGING_EXTERN Session createTransactionalSession(const std::string& name = std::string());
103  QPID_MESSAGING_EXTERN Session createSession(const std::string& name = std::string());
104 
105  QPID_MESSAGING_EXTERN Session getSession(const std::string& name) const;
106  QPID_MESSAGING_EXTERN std::string getAuthenticatedUsername();
107 
108 #ifndef SWIG
109  private:
110  friend class qpid::messaging::PrivateImplRef<Connection>;
111 #endif
112 };
113 
114 }} // namespace qpid::messaging
115 
116 #endif