6 #ifndef CPPIPC_CLIENT_CLIENT_HPP 7 #define CPPIPC_CLIENT_CLIENT_HPP 10 #include <core/system/cppipc/client/comm_client.hpp> 73 bool auto_create =
true,
74 size_t object_id = (
size_t)(-1)):
76 remote_object_id(object_id) {
77 T::__register__(comm);
78 if (auto_create) remote_object_id = comm.
make_object(T::__get_type_name__());
86 "Object not tracked after increasing ref count!");
99 if (remote_object_id != (
size_t)(-1)) {
100 comm.decr_ref_count(remote_object_id);
102 remote_object_id = (size_t)(-1);
109 comm.decr_ref_count(remote_object_id);
111 remote_object_id = object_id;
117 return remote_object_id;
128 template <
typename S>
137 template <
typename MemFn>
147 template <
typename MemFn,
typename... Args>
148 typename detail::member_function_return_type<MemFn>::type
149 call(MemFn f,
const Args&... args) {
150 return comm.
call(remote_object_id, f, args...);
155 size_t remote_object_id;
Other general exception. Body will contain the exception message.
size_t make_object(std::string object_type_name)
detail::member_function_return_type< MemFn >::type call(size_t objectid, MemFn f, const Args &... args)
size_t get_object_id() const
void register_function(MemFn f, std::string function_string)
void register_object(S *object)
object_proxy(comm_client &comm, bool auto_create=true, size_t object_id=(size_t)(-1))
void set_object_id(size_t object_id)
detail::member_function_return_type< MemFn >::type call(MemFn f, const Args &... args)
void register_function(MemFn f, std::string function_string)
size_t incr_ref_count(size_t object_id)