Skip to content

Commit

Permalink
rename request to method
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhaefner committed Dec 2, 2017
1 parent a2918d3 commit 0e9920d
Show file tree
Hide file tree
Showing 19 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion examples/echo/echoservice.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace example

INTERFACE(EchoService)
{
Request<in<std::string>, out<std::string>> echo;
Method<in<std::string>, out<std::string>> echo;

// constructor
EchoService()
Expand Down
2 changes: 1 addition & 1 deletion examples/mixed/mixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace test

INTERFACE(long_op)
{
Request<in<std::string>, out<std::string>> do_it;
Method<in<std::string>, out<std::string>> do_it;

long_op()
: INIT(do_it)
Expand Down
6 changes: 3 additions & 3 deletions include/simppl/clientside.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ ClientProperty<DataT, Flags>& ClientProperty<DataT, Flags>::attach()


template<typename... ArgsT>
struct ClientRequest
struct ClientMethod
{
typedef detail::generate_argument_type<ArgsT...> args_type_generator;
typedef detail::generate_return_type<ArgsT...> return_type_generator;
Expand All @@ -315,7 +315,7 @@ struct ClientRequest


inline
ClientRequest(const char* method_name, StubBase* parent)
ClientMethod(const char* method_name, StubBase* parent)
: method_name_(method_name)
, parent_(parent)
{
Expand Down Expand Up @@ -356,7 +356,7 @@ struct ClientRequest
}


ClientRequest& operator[](int flags)
ClientMethod& operator[](int flags)
{
static_assert(is_oneway == false, "it's a oneway function");

Expand Down
2 changes: 1 addition & 1 deletion include/simppl/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


#define INTERFACE(iface) \
template<template<typename...> class Request, \
template<template<typename...> class Method, \
template<typename...> class Signal, \
template<typename, int Flags=simppl::dbus::Notifying|simppl::dbus::ReadOnly> class Property, \
typename BaseT> \
Expand Down
6 changes: 3 additions & 3 deletions include/simppl/serverrequestdescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace dbus
{

// forward decl
struct ServerRequestBase;
struct ServerMethodBase;


struct ServerRequestDescriptor
Expand All @@ -30,13 +30,13 @@ struct ServerRequestDescriptor
ServerRequestDescriptor(ServerRequestDescriptor&& rhs);
ServerRequestDescriptor& operator=(ServerRequestDescriptor&& rhs);

ServerRequestDescriptor& set(ServerRequestBase* requestor, DBusMessage* msg);
ServerRequestDescriptor& set(ServerMethodBase* requestor, DBusMessage* msg);

void clear();

operator const void*() const;

ServerRequestBase* requestor_;
ServerMethodBase* requestor_;
DBusMessage* msg_;
};

Expand Down
22 changes: 11 additions & 11 deletions include/simppl/serverside.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ namespace simppl
namespace dbus
{

struct ServerRequestBase
struct ServerMethodBase
{
typedef void(*eval_type)(ServerRequestBase*, DBusMessage*);
typedef void(*eval_type)(ServerMethodBase*, DBusMessage*);
typedef void(*sig_type)(std::ostream&);

void eval(DBusMessage* msg)
Expand All @@ -55,14 +55,14 @@ struct ServerRequestBase
virtual void introspect(std::ostream& os) const = 0;
#endif

ServerRequestBase* next_;
ServerMethodBase* next_;
const char* name_;

protected:

ServerRequestBase(const char* name, SkeletonBase* iface);
ServerMethodBase(const char* name, SkeletonBase* iface);

~ServerRequestBase();
~ServerMethodBase();

eval_type eval_;

Expand Down Expand Up @@ -129,7 +129,7 @@ struct ServerSignal : ServerSignalBase


template<typename... ArgsT>
struct ServerRequest : ServerRequestBase
struct ServerMethod : ServerMethodBase
{
typedef detail::generate_argument_type<ArgsT...> args_type_generator;
typedef detail::generate_return_type<ArgsT...> return_type_generator;
Expand All @@ -151,8 +151,8 @@ struct ServerRequest : ServerRequestBase


inline
ServerRequest(const char* name, SkeletonBase* iface)
: ServerRequestBase(name, iface)
ServerMethod(const char* name, SkeletonBase* iface)
: ServerMethodBase(name, iface)
{
eval_ = __eval;
#if SIMPPL_SIGNATURE_CHECK
Expand Down Expand Up @@ -199,10 +199,10 @@ struct ServerRequest : ServerRequestBase
private:

static
void __eval(ServerRequestBase* obj, DBusMessage* msg)
void __eval(ServerMethodBase* obj, DBusMessage* msg)
{
detail::Deserializer d(msg);
detail::GetCaller<args_type>::type::template eval(d, ((ServerRequest*)obj)->f_);
detail::GetCaller<args_type>::type::template eval(d, ((ServerMethod*)obj)->f_);
}


Expand Down Expand Up @@ -356,7 +356,7 @@ struct ServerProperty : BaseProperty<DataT>

template<typename FunctorT, typename... T>
inline
void operator>>(simppl::dbus::ServerRequest<T...>& r, const FunctorT& f)
void operator>>(simppl::dbus::ServerMethod<T...>& r, const FunctorT& f)
{
r.handled_by(f);
}
Expand Down
4 changes: 2 additions & 2 deletions include/simppl/skeleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ void dispatcher_add_skeleton(Dispatcher&, StubBase&);
template<template<template<typename...> class,
template<typename...> class,
template<typename,int> class, typename> class IfaceT>
struct Skeleton : IfaceT<ServerRequest, ServerSignal, ServerProperty, SkeletonBase>
struct Skeleton : IfaceT<ServerMethod, ServerSignal, ServerProperty, SkeletonBase>
{
friend struct Dispatcher;

typedef IfaceT<ServerRequest, ServerSignal, ServerProperty, SkeletonBase> interface_type;
typedef IfaceT<ServerMethod, ServerSignal, ServerProperty, SkeletonBase> interface_type;

inline
Skeleton(Dispatcher& disp, const char* role)
Expand Down
6 changes: 3 additions & 3 deletions include/simppl/skeletonbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace dbus

// forward decl
struct Dispatcher;
struct ServerRequestBase;
struct ServerMethodBase;
struct ServerPropertyBase;
struct ServerSignalBase;

Expand All @@ -30,7 +30,7 @@ struct SkeletonBase
SkeletonBase& operator=(const SkeletonBase&) = delete;

friend struct Dispatcher;
friend struct ServerRequestBase;
friend struct ServerMethodBase;
friend struct ServerPropertyBase;
friend struct ServerSignalBase;

Expand Down Expand Up @@ -99,7 +99,7 @@ struct SkeletonBase
ServerRequestDescriptor current_request_;

// linked list heads
ServerRequestBase* methods_;
ServerMethodBase* methods_;
ServerPropertyBase* properties_;

#if SIMPPL_HAVE_INTROSPECTION
Expand Down
4 changes: 2 additions & 2 deletions include/simppl/stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ void dispatcher_add_stub(Dispatcher&, StubBase&);
template<template<template<typename...> class,
template<typename...> class,
template<typename,int> class, typename> class IfaceT>
struct Stub : IfaceT<ClientRequest, ClientSignal, ClientProperty, StubBase>
struct Stub : IfaceT<ClientMethod, ClientSignal, ClientProperty, StubBase>
{
friend struct Dispatcher;

private:

typedef IfaceT<ClientRequest, ClientSignal, ClientProperty, StubBase> interface_type;
typedef IfaceT<ClientMethod, ClientSignal, ClientProperty, StubBase> interface_type;

public:

Expand Down
2 changes: 1 addition & 1 deletion include/simppl/stubbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace detail
struct StubBase
{
template<typename... T> friend struct ClientSignal;
template<typename... T> friend struct ClientRequest;
template<typename... T> friend struct ClientMethod;
template<typename, int> friend struct ClientProperty;
template<typename, typename> friend struct ClientPropertyWritableMixin;

Expand Down
2 changes: 1 addition & 1 deletion src/serverrequestdescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ServerRequestDescriptor& ServerRequestDescriptor::operator=(ServerRequestDescrip
}


ServerRequestDescriptor& ServerRequestDescriptor::set(ServerRequestBase* requestor, DBusMessage* msg)
ServerRequestDescriptor& ServerRequestDescriptor::set(ServerMethodBase* requestor, DBusMessage* msg)
{
clear();

Expand Down
6 changes: 3 additions & 3 deletions src/serverside.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace dbus
{


ServerRequestBase::ServerRequestBase(const char* name, SkeletonBase* iface)
ServerMethodBase::ServerMethodBase(const char* name, SkeletonBase* iface)
: name_(name)
{
auto& methods = iface->methods_;
Expand All @@ -22,14 +22,14 @@ ServerRequestBase::ServerRequestBase(const char* name, SkeletonBase* iface)
}


ServerRequestBase::~ServerRequestBase()
ServerMethodBase::~ServerMethodBase()
{
// NOOP
}


#if SIMPPL_SIGNATURE_CHECK
const char* ServerRequestBase::get_signature() const
const char* ServerMethodBase::get_signature() const
{
if (signature_.empty())
{
Expand Down
6 changes: 3 additions & 3 deletions tests/async_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ namespace test {
INTERFACE(AsyncServer)
{
// FIXME validate all parameters to be either in or out or oneway
Request<in<int>, simppl::dbus::oneway> oneway;
Method<in<int>, simppl::dbus::oneway> oneway;

Request<in<int>, in<double>, out<double>> add;
Request<in<int>, in<double>, out<int>, out<double>> echo;
Method<in<int>, in<double>, out<double>> add;
Method<in<int>, in<double>, out<int>, out<double>> echo;


inline
Expand Down
6 changes: 3 additions & 3 deletions tests/errors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ namespace test

INTERFACE(Errors)
{
Request<simppl::dbus::oneway> stop;
Method<simppl::dbus::oneway> stop;

Request<> hello;
Request<in<int>, out<int>> hello1;
Method<> hello;
Method<in<int>, out<int>> hello1;

inline
Errors()
Expand Down
8 changes: 4 additions & 4 deletions tests/introserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ struct Menu

INTERFACE(Properties)
{
Request<in<int>, in<std::string>> set;
Request<> shutdown;
Request<> trigger_data;
Method<in<int>, in<std::string>> set;
Method<> shutdown;
Method<> trigger_data;

Request<out<Menu>> get_all;
Method<out<Menu>> get_all;

Property<int, simppl::dbus::ReadWrite|simppl::dbus::Notifying> data;
Property<std::map<ident_t, std::string>> props;
Expand Down
4 changes: 2 additions & 2 deletions tests/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ struct gaga

INTERFACE(Properties)
{
Request<in<int>, in<std::string>> set;
Request<simppl::dbus::oneway> shutdown;
Method<in<int>, in<std::string>> set;
Method<simppl::dbus::oneway> shutdown;

Property<int, simppl::dbus::ReadWrite|simppl::dbus::Notifying> data;
Property<std::map<ident_t, std::string>> props;
Expand Down
14 changes: 7 additions & 7 deletions tests/simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ namespace test

INTERFACE(Simple)
{
Request<> hello;
Request<> hello_wait_for_some_time;
Method<> hello;
Method<> hello_wait_for_some_time;

Request<in<int>, simppl::dbus::oneway> oneway;
Method<in<int>, simppl::dbus::oneway> oneway;

Request<in<int>, in<double>, out<double>> add;
Request<in<int>, in<double>, out<int>, out<double>> echo;
Method<in<int>, in<double>, out<double>> add;
Method<in<int>, in<double>, out<int>, out<double>> echo;

Request<in<std::wstring>, out<std::wstring>> echo_wstring;
Request<in<wchar_t*>, out<wchar_t*>> echo_wchart;
Method<in<std::wstring>, out<std::wstring>> echo_wstring;
Method<in<wchar_t*>, out<wchar_t*>> echo_wchart;

Property<int> data;

Expand Down
4 changes: 2 additions & 2 deletions tests/timeout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ namespace test

INTERFACE(Timeout)
{
Request<in<int>, out<double>> eval;
Request<in<int>, simppl::dbus::oneway> oneway;
Method<in<int>, out<double>> eval;
Method<in<int>, simppl::dbus::oneway> oneway;

inline
Timeout()
Expand Down
2 changes: 1 addition & 1 deletion tests/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace test

INTERFACE(VServer)
{
Request<out<std::map<std::string, simppl::Variant<int,double,std::string>>>> getData;
Method<out<std::map<std::string, simppl::Variant<int,double,std::string>>>> getData;

VServer()
: INIT(getData)
Expand Down

0 comments on commit 0e9920d

Please sign in to comment.