Merge branch 'master' of git://anongit.freedesktop.org/git/dbus/dbus-c++
Merge branch 'master' of git://anongit.freedesktop.org/git/dbus/dbus-c++ Conflicts: include/dbus-c++/connection.h include/dbus-c++/dispatcher.h include/dbus-c++/pendingcall.h src/dispatcher.cpp
This commit is contained in:
commit
c1970e2352
57 changed files with 1642 additions and 1638 deletions
|
@ -33,21 +33,21 @@
|
|||
|
||||
using namespace DBus;
|
||||
|
||||
Interface::Interface( const std::string& name )
|
||||
Interface::Interface(const std::string &name)
|
||||
: _name(name)
|
||||
{}
|
||||
|
||||
Interface::~Interface()
|
||||
{}
|
||||
|
||||
InterfaceAdaptor* AdaptorBase::find_interface( const std::string& name )
|
||||
InterfaceAdaptor *AdaptorBase::find_interface(const std::string &name)
|
||||
{
|
||||
InterfaceAdaptorTable::const_iterator ii = _interfaces.find(name);
|
||||
|
||||
return ii != _interfaces.end() ? ii->second : NULL;
|
||||
}
|
||||
|
||||
InterfaceAdaptor::InterfaceAdaptor( const std::string& name )
|
||||
InterfaceAdaptor::InterfaceAdaptor(const std::string &name)
|
||||
: Interface(name)
|
||||
{
|
||||
debug_log("adding interface %s", name.c_str());
|
||||
|
@ -55,14 +55,14 @@ InterfaceAdaptor::InterfaceAdaptor( const std::string& name )
|
|||
_interfaces[name] = this;
|
||||
}
|
||||
|
||||
Message InterfaceAdaptor::dispatch_method( const CallMessage& msg )
|
||||
Message InterfaceAdaptor::dispatch_method(const CallMessage &msg)
|
||||
{
|
||||
const char* name = msg.member();
|
||||
const char *name = msg.member();
|
||||
|
||||
MethodTable::iterator mi = _methods.find(name);
|
||||
if( mi != _methods.end() )
|
||||
if (mi != _methods.end())
|
||||
{
|
||||
return mi->second.call( msg );
|
||||
return mi->second.call(msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,21 +70,21 @@ Message InterfaceAdaptor::dispatch_method( const CallMessage& msg )
|
|||
}
|
||||
}
|
||||
|
||||
void InterfaceAdaptor::emit_signal( const SignalMessage& sig )
|
||||
void InterfaceAdaptor::emit_signal(const SignalMessage &sig)
|
||||
{
|
||||
SignalMessage& sig2 = const_cast<SignalMessage&>(sig);
|
||||
SignalMessage &sig2 = const_cast<SignalMessage &>(sig);
|
||||
|
||||
sig2.interface( name().c_str() );
|
||||
sig2.interface(name().c_str());
|
||||
_emit_signal(sig2);
|
||||
}
|
||||
|
||||
Variant* InterfaceAdaptor::get_property( const std::string& name )
|
||||
Variant *InterfaceAdaptor::get_property(const std::string &name)
|
||||
{
|
||||
PropertyTable::iterator pti = _properties.find(name);
|
||||
|
||||
if( pti != _properties.end() )
|
||||
if (pti != _properties.end())
|
||||
{
|
||||
if( !pti->second.read )
|
||||
if (!pti->second.read)
|
||||
throw ErrorAccessDenied("property is not readable");
|
||||
|
||||
return &(pti->second.value);
|
||||
|
@ -92,18 +92,18 @@ Variant* InterfaceAdaptor::get_property( const std::string& name )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void InterfaceAdaptor::set_property( const std::string& name, Variant& value )
|
||||
void InterfaceAdaptor::set_property(const std::string &name, Variant &value)
|
||||
{
|
||||
PropertyTable::iterator pti = _properties.find(name);
|
||||
|
||||
if( pti != _properties.end() )
|
||||
if (pti != _properties.end())
|
||||
{
|
||||
if( !pti->second.write )
|
||||
if (!pti->second.write)
|
||||
throw ErrorAccessDenied("property is not writeable");
|
||||
|
||||
Signature sig = value.signature();
|
||||
|
||||
if( pti->second.sig != sig )
|
||||
if (pti->second.sig != sig)
|
||||
throw ErrorInvalidSignature("property expects a different type");
|
||||
|
||||
pti->second.value = value;
|
||||
|
@ -112,14 +112,14 @@ void InterfaceAdaptor::set_property( const std::string& name, Variant& value )
|
|||
throw ErrorFailed("requested property not found");
|
||||
}
|
||||
|
||||
InterfaceProxy* ProxyBase::find_interface( const std::string& name )
|
||||
InterfaceProxy *ProxyBase::find_interface(const std::string &name)
|
||||
{
|
||||
InterfaceProxyTable::const_iterator ii = _interfaces.find(name);
|
||||
|
||||
return ii != _interfaces.end() ? ii->second : NULL;
|
||||
}
|
||||
|
||||
InterfaceProxy::InterfaceProxy( const std::string& name )
|
||||
InterfaceProxy::InterfaceProxy(const std::string &name)
|
||||
: Interface(name)
|
||||
{
|
||||
debug_log("adding interface %s", name.c_str());
|
||||
|
@ -127,14 +127,14 @@ InterfaceProxy::InterfaceProxy( const std::string& name )
|
|||
_interfaces[name] = this;
|
||||
}
|
||||
|
||||
bool InterfaceProxy::dispatch_signal( const SignalMessage& msg )
|
||||
bool InterfaceProxy::dispatch_signal(const SignalMessage &msg)
|
||||
{
|
||||
const char* name = msg.member();
|
||||
const char *name = msg.member();
|
||||
|
||||
SignalTable::iterator si = _signals.find(name);
|
||||
if( si != _signals.end() )
|
||||
if (si != _signals.end())
|
||||
{
|
||||
si->second.call( msg );
|
||||
si->second.call(msg);
|
||||
// Here we always return false because there might be
|
||||
// another InterfaceProxy listening for the same signal.
|
||||
// This way we instruct libdbus-1 to go on dispatching
|
||||
|
@ -147,10 +147,10 @@ bool InterfaceProxy::dispatch_signal( const SignalMessage& msg )
|
|||
}
|
||||
}
|
||||
|
||||
Message InterfaceProxy::invoke_method( const CallMessage& call )
|
||||
Message InterfaceProxy::invoke_method(const CallMessage &call)
|
||||
{
|
||||
CallMessage& call2 = const_cast<CallMessage&>(call);
|
||||
CallMessage &call2 = const_cast<CallMessage &>(call);
|
||||
|
||||
call2.interface( name().c_str() );
|
||||
call2.interface(name().c_str());
|
||||
return _invoke_method(call2);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue