Time to get rid of the horrible coding style

This commit is contained in:
pd 2008-08-01 18:31:43 +02:00
parent 534ee610d8
commit efc594f888
53 changed files with 1137 additions and 1136 deletions

View file

@ -29,21 +29,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());
@ -51,14 +51,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
{
@ -66,21 +66,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);
@ -88,18 +88,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;
@ -108,14 +108,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());
@ -123,14 +123,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
@ -143,10 +143,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);
}