Remote process call framework using libmsgpack (serialization based on https://github.com/msgpack/msgpack-c/tree/cpp-3.3.0)
Class needs to inherit rpx::RemoteObject
class TestObject : public rpx::RemoteObject {
};
To provide functions to the framework
registerRemote("testfunction", &TestObject::testfunction);To call remote functions
float testfunction(float f, float ff)
{
auto [ret, success] = callRemote<float>(__FUNCTION__, 0.f, f, ff);
return ret;
}| Arg | Desc |
|---|---|
| RETURNTYPE | Type of return value |
| FUNCTIONNAME | Name of the function as string (__FUNCTION__ macro possible) |
| DEFAULTRETURN | Default return value |
| ARGS... | Arguments for function call |
auto [ret, success] = callRemote<RETURNTYPE>(FUNCTIONNAME, DEFAULTRETURN, ARGS...)void function
| Arg | Desc |
|---|---|
| FUNCTIONNAME | Name of the function |
| ARGS... | Arguments for function call |
bool success = callRemote<void>(FUNCTIONNAME, ARGS...)You can use library provided TCP server and client or use the ICommunication interface to implement your own connection.
rpx::communication::TCPServer server;
server.listen(12345);
rpx::RemoteManager::addCommunication(&server);rpx::communication::TCPClient client;
client.connect("127.0.0.1.", 12345);
rpx::RemoteManager::addCommunication(&client);For further usage checkout the sample.