Mir
mir_connection_api.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_CLIENT_MIR_CONNECTION_API_H_
20 #define MIR_CLIENT_MIR_CONNECTION_API_H_
21 
22 #include "mir_toolkit/mir_wait.h"
23 
24 #include <string>
25 #include <memory>
26 #include <functional>
27 
28 namespace mir
29 {
30 namespace client
31 {
32 class ConnectionConfiguration;
33 
34 using ConfigurationFactory = std::function<std::unique_ptr<ConnectionConfiguration>(std::string const&)>;
35 
37 {
38 public:
39  virtual ~MirConnectionAPI() = default;
40 
41  virtual MirWaitHandle* connect(
42  ConfigurationFactory configuration,
43  char const* socket_file,
44  char const* name,
45  mir_connected_callback callback,
46  void* context) = 0;
47 
48  virtual void release(MirConnection* connection) = 0;
49 
51 
52 protected:
53  MirConnectionAPI() = default;
54  MirConnectionAPI(MirConnectionAPI const&) = default;
55  MirConnectionAPI& operator=(MirConnectionAPI const&) = default;
56 };
57 
58 }
59 }
60 
62 
63 #endif
All things Mir.
Definition: atomic_callback.h:25
mir::client::MirConnectionAPI * mir_connection_api_impl
Definition: mir_connection_api.h:61
virtual void release(MirConnection *connection)=0
Definition: mir_wait_handle.h:31
std::function< std::unique_ptr< ConnectionConfiguration >(std::string const &)> ConfigurationFactory
Definition: mir_connection_api.h:34
virtual MirWaitHandle * connect(ConfigurationFactory configuration, char const *socket_file, char const *name, mir_connected_callback callback, void *context)=0
virtual ~MirConnectionAPI()=default
MirConnectionAPI & operator=(MirConnectionAPI const &)=default
void(* mir_connected_callback)(MirConnection *connection, void *client_context)
Callback to be passed when issuing a mir_connect request.
Definition: client_types.h:73
virtual ConfigurationFactory configuration_factory()=0
Definition: mir_connection.h:96
Definition: mir_connection_api.h:36

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016