zeus/jus/ServiceRemote.cpp

38 lines
1.0 KiB
C++
Raw Normal View History

2016-05-23 21:18:37 +02:00
/** @file
* @author Edouard DUPIN
* @copyright 2016, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#include <jus/ServiceRemote.h>
#include <jus/Client.h>
jus::ServiceRemote::ServiceRemote(jus::Client* _clientInterface, const std::string& _name):
m_clientInterface(_clientInterface),
m_name(_name) {
2016-05-25 21:25:33 +02:00
m_isLinked = m_clientInterface->link(_name);
2016-05-23 21:18:37 +02:00
}
jus::ServiceRemote::~ServiceRemote() {
2016-05-25 21:25:33 +02:00
if (m_isLinked == true) {
m_clientInterface->unlink(m_name);
m_isLinked = false;
}
2016-05-23 21:18:37 +02:00
}
2016-05-25 21:25:33 +02:00
bool jus::ServiceRemote::exist() {
return m_isLinked;
}
2016-05-23 21:18:37 +02:00
uint64_t jus::ServiceRemote::getId() {
return m_clientInterface->getId();
2016-05-23 21:18:37 +02:00
}
2016-06-03 23:45:01 +02:00
jus::FutureBase jus::ServiceRemote::callJson(uint64_t _transactionId,
const ejson::Object& _obj,
const std::vector<ActionAsyncClient>& _async,
jus::FutureData::ObserverFinish _callback) {
return m_clientInterface->callJson(_transactionId, _obj, _async, _callback, m_name);
2016-05-23 21:18:37 +02:00
}