forked from martinhaefner/simppl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverside.cpp
73 lines (54 loc) · 1.27 KB
/
serverside.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "simppl/interface.h"
#define SIMPPL_SERVERSIDE_CPP
#include "simppl/serverside.h"
#undef SIMPPL_SERVERSIDE_CPP
namespace simppl
{
namespace dbus
{
ServerMethodBase::ServerMethodBase(const char* name, SkeletonBase* iface, int iface_id)
: name_(name)
{
auto& methods = iface->method_heads_[iface_id];
this->next_ = methods;
methods = this;
}
ServerMethodBase::~ServerMethodBase()
{
// NOOP
}
#if SIMPPL_SIGNATURE_CHECK
const char* ServerMethodBase::get_signature() const
{
if (signature_.empty())
{
std::ostringstream oss;
oss << "sig:";
get_signature(oss);
signature_ = oss.str();
}
return signature_.c_str()+4;
}
#endif
ServerPropertyBase::ServerPropertyBase(const char* name, SkeletonBase* iface, int iface_id)
: name_(name)
, iface_id_(iface_id)
, parent_(iface)
{
auto& properties = iface->property_heads_[iface_id];
this->next_ = properties;
properties = this;
}
ServerSignalBase::ServerSignalBase(const char* name, SkeletonBase* iface, int iface_id)
: name_(name)
, iface_id_(iface_id)
, parent_(iface)
{
#if SIMPPL_HAVE_INTROSPECTION
auto& signals = iface->signal_heads_[iface_id];
this->next_ = signals;
signals = this;
#endif
}
} // namespace dbus
} // namespace simppl