34 lines
775 B
C++
34 lines
775 B
C++
/** @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) {
|
|
m_isLinked = m_clientInterface->link(_name);
|
|
}
|
|
|
|
jus::ServiceRemote::~ServiceRemote() {
|
|
if (m_isLinked == true) {
|
|
m_clientInterface->unlink(m_name);
|
|
m_isLinked = false;
|
|
}
|
|
}
|
|
|
|
bool jus::ServiceRemote::exist() {
|
|
return m_isLinked;
|
|
}
|
|
|
|
uint64_t jus::ServiceRemote::getId() {
|
|
return m_clientInterface->getId();
|
|
}
|
|
|
|
ejson::Object jus::ServiceRemote::callJson(const ejson::Object& _obj) {
|
|
return m_clientInterface->callJson(_obj);
|
|
}
|