3 * D-Bus++ - C++ bindings for D-Bus
5 * Copyright (C) 2005-2009 Paolo Durante <shackan@gmail.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef __DBUSXX_CONNECTION_P_H
26 #define __DBUSXX_CONNECTION_P_H
32 #include <dbus-c++/connection.h>
33 #include <dbus-c++/server.h>
34 #include <dbus-c++/dispatcher.h>
35 #include <dbus-c++/refptr_impl.h>
37 #include <dbus/dbus.h>
44 // Forward Declaration
45 class DispatcherCache
;
47 class ConnectionPMap
: private std::map
<DBusConnection
*, RefPtrI
<Connection::Private
> >, public Synchronized
51 typedef RefPtrI
<Connection::Private
> Ref
;
52 typedef std::map
<DBusConnection
*, Ref
> Base
;
58 while (!empty()) Base::erase(begin());
61 Ref
& get(DBusConnection
*c
)
65 return Base::operator [](c
);
68 void remove(DBusConnection
*c
)
76 struct DBUSXXAPILOCAL
Connection::Private
: public CallbackTarget
78 RefPtrI
<DispatcherCache
> dispCache
;
82 std::vector
<std::string
> names
;
84 Dispatcher
*dispatcher
;
87 MessageSlot disconn_filter
;
88 bool disconn_filter_function(const Message
&);
90 Server::Private
*server
;
93 Private(DBusConnection
*, bool, Dispatcher
*, Server::Private
* = NULL
);
99 DBusDispatchStatus
dispatch_status();
100 bool has_something_to_dispatch();
102 static void dispatch_status_stub(DBusConnection
*, DBusDispatchStatus
, void *);
104 static DBusHandlerResult
message_filter_stub(DBusConnection
*, DBusMessage
*, void *);
107 } /* namespace DBus */
109 #endif//__DBUSXX_CONNECTION_P_H