Skip to content

Commit

Permalink
Fix introspection; cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhaefner committed Dec 31, 2017
1 parent 55f6c57 commit cc48c3c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 28 deletions.
13 changes: 0 additions & 13 deletions include/simppl/clientside.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@ struct ClientSignalBase
{
eval_(this, iter);
}

//virtual const char* get_signature() const = 0;

ClientSignalBase(const char* name, StubBase* iface);

inline
const char* name() const
{
return name_;
Expand All @@ -59,7 +56,6 @@ struct ClientSignalBase

protected:

inline
~ClientSignalBase() = default;

StubBase* stub_;
Expand All @@ -76,7 +72,6 @@ struct ClientSignal : ClientSignalBase
{
typedef std::function<void(typename CallTraits<T>::param_type...)> function_type;

inline
ClientSignal(const char* name, StubBase* iface)
: ClientSignalBase(name, iface)
{
Expand All @@ -90,15 +85,13 @@ struct ClientSignal : ClientSignalBase
}

/// send registration to the server - only attach after the interface is connected.
inline
ClientSignal& attach()
{
stub_->register_signal(*this);
return *this;
}

/// send de-registration to the server - only attach after the interface is connected.
inline
ClientSignal& detach()
{
stub_->unregister_signal(*this);
Expand Down Expand Up @@ -141,7 +134,6 @@ struct ClientPropertyBase

protected:

inline
~ClientPropertyBase() = default;

const char* name_;
Expand All @@ -162,7 +154,6 @@ struct ClientPropertyWritableMixin : ClientPropertyBase
typedef detail::CallbackHolder<function_type, void> holder_type;


inline
ClientPropertyWritableMixin(const char* name, StubBase* iface)
: ClientPropertyBase(name, iface)
{
Expand Down Expand Up @@ -204,7 +195,6 @@ struct ClientProperty
typedef detail::PropertyCallbackHolder<std::function<void(CallState, arg_type)>, data_type> holder_type;


inline
ClientProperty(const char* name, StubBase* iface)
: base_type(name, iface)
{
Expand All @@ -223,7 +213,6 @@ struct ClientProperty
// TODO implement GetAll
DataT get();

inline
detail::InterimCallbackHolder<holder_type> get_async()
{
return detail::InterimCallbackHolder<holder_type>(this->stub_->get_property_async(this->name_));
Expand Down Expand Up @@ -316,7 +305,6 @@ struct ClientMethod
static_assert(!is_oneway || (is_oneway && std::is_same<return_type, void>::value), "oneway check");


inline
ClientMethod(const char* method_name, StubBase* parent)
: method_name_(method_name)
, parent_(parent)
Expand All @@ -339,7 +327,6 @@ struct ClientMethod
serializer_type::eval(s, t...);
}, is_oneway);

// TODO check signature
return detail::deserialize_and_return<return_type>::eval(msg.get());
}

Expand Down
2 changes: 0 additions & 2 deletions include/simppl/detail/holders.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ struct CallbackHolder
assert(that->f_);

CallState cs(*msg);

// TODO check signature

DBusMessageIter iter;
dbus_message_iter_init(msg.get(), &iter);
Expand Down
9 changes: 0 additions & 9 deletions include/simppl/serverside.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ struct ServerSignalBase

protected:

inline
~ServerSignalBase() = default;

const char* name_;
Expand All @@ -85,7 +84,6 @@ struct ServerSignalBase
template<typename... T>
struct ServerSignal : ServerSignalBase
{
inline
ServerSignal(const char* name, SkeletonBase* iface)
: ServerSignalBase(name, iface)
{
Expand Down Expand Up @@ -142,7 +140,6 @@ struct ServerMethod : ServerMethodBase


template<typename... T>
inline
detail::ServerResponseHolder operator()(const T&... t)
{
static_assert(is_oneway == false, "it's a oneway function");
Expand Down Expand Up @@ -177,7 +174,6 @@ struct ServerMethod : ServerMethodBase


template<typename... T>
inline
detail::ServerResponseHolder __impl(std::true_type, const T&... t)
{
return detail::ServerResponseHolder([&](DBusMessageIter& s){
Expand All @@ -186,7 +182,6 @@ struct ServerMethod : ServerMethodBase
}

template<typename... T>
inline
detail::ServerResponseHolder __impl(std::false_type, const T&... t)
{
return detail::ServerResponseHolder([](DBusMessageIter&){ /*NOOP*/ });
Expand Down Expand Up @@ -224,7 +219,6 @@ struct ServerPropertyBase

protected:

inline
~ServerPropertyBase() = default;

eval_type eval_;
Expand All @@ -235,15 +229,13 @@ struct ServerPropertyBase
template<typename DataT>
struct BaseProperty : ServerPropertyBase
{
inline
BaseProperty(const char* name, SkeletonBase* iface)
: ServerPropertyBase(name, iface)
, t_()
{
eval_ = __eval;
}

inline
const DataT& value() const
{
return t_;
Expand Down Expand Up @@ -304,7 +296,6 @@ struct ServerWritableMixin
template<typename DataT, int Flags>
struct ServerProperty : BaseProperty<DataT>, std::conditional<Flags & ReadWrite, ServerWritableMixin<DataT>, ServerNoopMixin<DataT>>::type
{
inline
ServerProperty(const char* name, SkeletonBase* iface)
: BaseProperty<DataT>(name, iface)
{
Expand Down
2 changes: 0 additions & 2 deletions include/simppl/typelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ struct Size<TypeList<HeadT, NilType> >
};

// -------------------------------popfrontN ------------------------------------
// TODO this should be a generic Erase algorihtm instead

template<int N, typename ListT>
struct PopFrontN;
Expand Down Expand Up @@ -96,7 +95,6 @@ struct PopBack<TypeList<HeadT, NilType> >
template<>
struct PopBack<NilType>
{
// TODO maybe generate a compiler error here?!
typedef NilType type;
};

Expand Down
5 changes: 3 additions & 2 deletions src/skeletonbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ DBusHandlerResult SkeletonBase::handle_request(DBusMessage* msg)
" <arg name=\"changed_properties\" type=\"a{sv}\"/>\n"
" <arg name=\"invalidated_properties\" type=\"as\"/>\n"
" </signal>\n"
" </interface>\n"
"</node>\n";
" </interface>\n";
}

oss << "</node>\n";

DBusMessage* reply = dbus_message_new_method_return(msg);

Expand Down

0 comments on commit cc48c3c

Please sign in to comment.