[DEV] better callback api but error on a mutable and const elements ...
This commit is contained in:
parent
cdfcede4c9
commit
4bfdd57093
@ -310,7 +310,7 @@ class FunctionDefinition:
|
||||
else:
|
||||
param_data += elem["name"]
|
||||
out += param_data
|
||||
out += ");\n"
|
||||
out += ") const;\n"
|
||||
return out;
|
||||
def generate_cpp_proxy(self, space, class_name):
|
||||
out = "";
|
||||
@ -327,7 +327,7 @@ class FunctionDefinition:
|
||||
else:
|
||||
param_data += elem["name"]
|
||||
out += param_data
|
||||
out += ") {\n"
|
||||
out += ") const {\n"
|
||||
space += " "
|
||||
if self.is_action == True:
|
||||
out += space + 'return m_obj.callAction("' + self.name + '"'
|
||||
@ -703,6 +703,7 @@ class ServiceDefinition:
|
||||
out += "#include <zeus/RemoteProperty.hpp>\n"
|
||||
out += "#include <string>\n"
|
||||
out += "#include <vector>\n"
|
||||
out += "#include <" + self.prop["file_name_class_header"] + ">\n"
|
||||
for elem in self.imports:
|
||||
prop = zeus_object_to_dictionary(elem)
|
||||
#out += "#include <" + prop["file_name_class_header"] + ">\n"
|
||||
|
@ -392,14 +392,14 @@ void appl::MediaDecoder::init(ememory::SharedPtr<ClientProperty> _property, uint
|
||||
}
|
||||
APPL_WARNING("Get File");
|
||||
media.getFile().andThen(
|
||||
[=](zeus::Future<zeus::ProxyFile> _fut) mutable {
|
||||
[=](const zeus::ProxyFile& _proxy) mutable {
|
||||
APPL_WARNING("Receive ProxyFile");
|
||||
m_remote->m_fileHandle = _fut.get();
|
||||
m_remote->m_fileHandle = _proxy;
|
||||
APPL_WARNING("We have handle");
|
||||
m_remote->m_fileHandle.getSize().andThen(
|
||||
[=](zeus::Future<uint64_t> _fut) mutable {
|
||||
[=](const uint64_t& _value) mutable {
|
||||
APPL_WARNING("Receive FileSize to index property");
|
||||
uint64_t sizeOfBuffer = _fut.get();
|
||||
uint64_t sizeOfBuffer = _value;
|
||||
APPL_WARNING("pppllloooppp " << sizeOfBuffer);
|
||||
m_remote->m_buffer.resize(sizeOfBuffer, 0);
|
||||
APPL_WARNING("pppllloooppp");
|
||||
@ -501,7 +501,7 @@ int64_t appl::MediaDecoder::seekFunc(int64_t _offset, int _whence) {
|
||||
return m_remote->m_bufferReadPosition;
|
||||
}
|
||||
|
||||
bool appl::StreamBuffering::addDataCallback(zeus::Future<zeus::Raw> _fut, int64_t _positionRequest) {
|
||||
bool appl::StreamBuffering::addDataCallback(const zeus::Raw& _data, int64_t _positionRequest) {
|
||||
#ifdef DEBUG
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
#endif
|
||||
@ -509,15 +509,10 @@ bool appl::StreamBuffering::addDataCallback(zeus::Future<zeus::Raw> _fut, int64_
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
bool find = false;
|
||||
m_callInProgress = false;
|
||||
if (_fut.hasError() == true) {
|
||||
APPL_ERROR("Error when loading data (1 MB)");
|
||||
return true;
|
||||
}
|
||||
// TODO : Check buffer size ...
|
||||
zeus::Raw buffer = _fut.get();
|
||||
APPL_DEBUG(" ==> receive DATA : " << _positionRequest << " size=" << buffer.size());
|
||||
APPL_DEBUG(" ==> receive DATA : " << _positionRequest << " size=" << _data.size());
|
||||
// copy data
|
||||
memcpy(&m_buffer[_positionRequest], buffer.data(), buffer.size());
|
||||
memcpy(&m_buffer[_positionRequest], _data.data(), _data.size());
|
||||
// Update the buffer data and positionning
|
||||
// find if the position correspond at a last positioning:
|
||||
|
||||
@ -525,20 +520,20 @@ bool appl::StreamBuffering::addDataCallback(zeus::Future<zeus::Raw> _fut, int64_
|
||||
while (it != m_bufferFillSection.end()) {
|
||||
if ( _positionRequest >= it->first
|
||||
&& _positionRequest < it->second) {
|
||||
if (_positionRequest + buffer.size() > it->second){
|
||||
it->second = _positionRequest + buffer.size();
|
||||
if (_positionRequest + _data.size() > it->second){
|
||||
it->second = _positionRequest + _data.size();
|
||||
}
|
||||
find = true;
|
||||
break;
|
||||
} else if (it->second == _positionRequest) {
|
||||
it->second += buffer.size();
|
||||
it->second += _data.size();
|
||||
find = true;
|
||||
break;
|
||||
}
|
||||
auto it2 = it;
|
||||
++it2;
|
||||
if ( it2 != m_bufferFillSection.end()
|
||||
&& _positionRequest + buffer.size() >= it2->first) {
|
||||
&& _positionRequest + _data.size() >= it2->first) {
|
||||
it2->first = _positionRequest;
|
||||
find = true;
|
||||
break;
|
||||
@ -550,7 +545,7 @@ bool appl::StreamBuffering::addDataCallback(zeus::Future<zeus::Raw> _fut, int64_
|
||||
}
|
||||
if (find == false) {
|
||||
APPL_ERROR("insert new element in the list of values");
|
||||
m_bufferFillSection.insert(it, std::pair<uint32_t,uint32_t>(_positionRequest, _positionRequest + buffer.size()));
|
||||
m_bufferFillSection.insert(it, std::pair<uint32_t,uint32_t>(_positionRequest, _positionRequest + _data.size()));
|
||||
}
|
||||
}
|
||||
checkIfWeNeedMoreDataFromNetwork();
|
||||
@ -625,8 +620,8 @@ void appl::StreamBuffering::checkIfWeNeedMoreDataFromNetwork() {
|
||||
APPL_DEBUG("Request DATA: " << it->second << " size=" << sizeRequest);
|
||||
auto futData = m_fileHandle.getPart(it->second, it->second + sizeRequest);
|
||||
auto localShared = ememory::dynamicPointerCast<appl::StreamBuffering>(sharedFromThis());
|
||||
futData.andThen([=](zeus::Future<zeus::Raw> _fut) mutable {
|
||||
return localShared->addDataCallback(_fut, it->second);
|
||||
futData.andThen([=](const zeus::Raw& _value) mutable {
|
||||
return localShared->addDataCallback(_value, it->second);
|
||||
});
|
||||
m_callInProgress = true;
|
||||
}
|
||||
@ -643,8 +638,8 @@ void appl::StreamBuffering::checkIfWeNeedMoreDataFromNetwork() {
|
||||
APPL_DEBUG("Request DATA : " << m_bufferReadPosition << " size=" << sizeRequest);
|
||||
auto futData = m_fileHandle.getPart(m_bufferReadPosition, m_bufferReadPosition+sizeRequest);
|
||||
auto localShared = ememory::dynamicPointerCast<appl::StreamBuffering>(sharedFromThis());
|
||||
futData.andThen([=](zeus::Future<zeus::Raw> _fut) mutable {
|
||||
return localShared->addDataCallback(_fut, m_bufferReadPosition);
|
||||
futData.andThen([=](const zeus::Raw& _value) mutable {
|
||||
return localShared->addDataCallback(_value, m_bufferReadPosition);
|
||||
});
|
||||
m_callInProgress = true;
|
||||
// nothing more to do ...
|
||||
@ -665,8 +660,8 @@ void appl::StreamBuffering::checkIfWeNeedMoreDataFromNetwork() {
|
||||
APPL_DEBUG("Request DATA : " << m_bufferReadPosition << " size=" << sizeRequest);
|
||||
auto futData = m_fileHandle.getPart(m_bufferReadPosition, m_bufferReadPosition + sizeRequest);
|
||||
auto localShared = ememory::dynamicPointerCast<appl::StreamBuffering>(sharedFromThis());
|
||||
futData.andThen([=](zeus::Future<zeus::Raw> _fut) mutable {
|
||||
return localShared->addDataCallback(_fut, m_bufferReadPosition);
|
||||
futData.andThen([=](const zeus::Raw& _value) mutable {
|
||||
return localShared->addDataCallback(_value, m_bufferReadPosition);
|
||||
});
|
||||
m_callInProgress = true;
|
||||
if (find == false) {
|
||||
|
@ -69,7 +69,7 @@ namespace appl {
|
||||
bool m_callInProgress;
|
||||
bool m_stopRequested;
|
||||
public:
|
||||
bool addDataCallback(zeus::Future<zeus::Raw> _fut, int64_t _positionRequest);
|
||||
bool addDataCallback(const zeus::Raw& _data, int64_t _positionRequest);
|
||||
void checkIfWeNeedMoreDataFromNetwork();
|
||||
uint64_t getSize() {
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
|
@ -79,32 +79,31 @@ void appl::ElementProperty::loadData() {
|
||||
auto tmpProperty = sharedFromThis();
|
||||
// Get the media
|
||||
zeus::Future<zeus::ProxyMedia> futMedia = m_remoteServiceVideo.get(m_id);
|
||||
futMedia.andElse([=](zeus::Future<zeus::ProxyMedia> _fut) mutable {
|
||||
futMedia.andElse([=](const std::string& _error, const std::string& _help) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get media error: " << tmpProperty->m_id);
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_title = "[ERROR] can not get media informations <br/>" + _fut.getErrorType() + ": " + _fut.getErrorHelp();
|
||||
tmpProperty->m_title = "[ERROR] can not get media informations <br/>" + _error + ": " + _help;
|
||||
tmpProperty->m_metadataUpdated = appl::statusLoadingData::done;
|
||||
}
|
||||
m_widget->markToRedraw();
|
||||
return true;
|
||||
});
|
||||
futMedia.andThen([=](zeus::Future<zeus::ProxyMedia> _fut) mutable {
|
||||
futMedia.andThen([=](const zeus::ProxyMedia& _media) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get media: " << tmpProperty->m_id);
|
||||
zeus::ProxyMedia media = _fut.get();
|
||||
if (media.exist() == false) {
|
||||
if (_media.exist() == false) {
|
||||
APPL_ERROR("get media error");
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_title = "[ERROR] can not get media informations (2)<br/>" + _fut.getErrorType() + ": " + _fut.getErrorHelp();
|
||||
tmpProperty->m_title = "[ERROR] can not get media informations (2)";
|
||||
tmpProperty->m_metadataUpdated = appl::statusLoadingData::done;
|
||||
}
|
||||
m_widget->markToRedraw();
|
||||
return true;
|
||||
}
|
||||
|
||||
media.getMetadata("title")
|
||||
.andElse([=](zeus::Future<std::string> _fut) mutable {
|
||||
_media.getMetadata("title")
|
||||
.andElse([=](const std::string& _error, const std::string& _help) mutable {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_nbElementLoaded++;
|
||||
@ -114,11 +113,11 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.andThen([=](zeus::Future<std::string> _fut) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get title: " << _fut.get());
|
||||
.andThen([=](const std::string& _value) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get title: " << _value);
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_title = _fut.get();
|
||||
tmpProperty->m_title = _value;
|
||||
}
|
||||
m_widget->markToRedraw();
|
||||
{
|
||||
@ -130,8 +129,8 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
media.getMetadata("series-name")
|
||||
.andElse([=](zeus::Future<std::string> _fut) mutable {
|
||||
_media.getMetadata("series-name")
|
||||
.andElse([=](const std::string& _error, const std::string& _help) mutable {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_nbElementLoaded++;
|
||||
@ -141,11 +140,11 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.andThen([=](zeus::Future<std::string> _fut) mutable {
|
||||
APPL_ERROR(" [" << tmpProperty->m_id << "] get serie: " << _fut.get());
|
||||
.andThen([=](const std::string& _value) mutable {
|
||||
APPL_ERROR(" [" << tmpProperty->m_id << "] get serie: " << _value);
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_serie = _fut.get();
|
||||
tmpProperty->m_serie = _value;
|
||||
}
|
||||
m_widget->markToRedraw();
|
||||
{
|
||||
@ -157,8 +156,8 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
media.getMetadata("saison")
|
||||
.andElse([=](zeus::Future<std::string> _fut) mutable {
|
||||
_media.getMetadata("saison")
|
||||
.andElse([=](const std::string& _error, const std::string& _help) mutable {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_nbElementLoaded++;
|
||||
@ -168,11 +167,11 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.andThen([=](zeus::Future<std::string> _fut) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get saison: " << _fut.get());
|
||||
.andThen([=](const std::string& _value) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get saison: " << _value);
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_saison = _fut.get();
|
||||
tmpProperty->m_saison = _value;
|
||||
}
|
||||
m_widget->markToRedraw();
|
||||
{
|
||||
@ -184,8 +183,8 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
media.getMetadata("episode")
|
||||
.andElse([=](zeus::Future<std::string> _fut) mutable {
|
||||
_media.getMetadata("episode")
|
||||
.andElse([=](const std::string& _error, const std::string& _help) mutable {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_nbElementLoaded++;
|
||||
@ -195,11 +194,11 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.andThen([=](zeus::Future<std::string> _fut) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get episode: " << _fut.get());
|
||||
.andThen([=](const std::string& _value) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get episode: " << _value);
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_episode = _fut.get();
|
||||
tmpProperty->m_episode = _value;
|
||||
}
|
||||
m_widget->markToRedraw();
|
||||
{
|
||||
@ -211,8 +210,8 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
media.getMetadata("description")
|
||||
.andElse([=](zeus::Future<std::string> _fut) mutable {
|
||||
_media.getMetadata("description")
|
||||
.andElse([=](const std::string& _error, const std::string& _help) mutable {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_nbElementLoaded++;
|
||||
@ -222,11 +221,11 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.andThen([=](zeus::Future<std::string> _fut) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get description: " << _fut.get());
|
||||
.andThen([=](const std::string& _value) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get description: " << _value);
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_description = _fut.get();
|
||||
tmpProperty->m_description = _value;
|
||||
}
|
||||
m_widget->markToRedraw();
|
||||
{
|
||||
@ -238,8 +237,8 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
media.getMetadata("production-methode")
|
||||
.andElse([=](zeus::Future<std::string> _fut) mutable {
|
||||
_media.getMetadata("production-methode")
|
||||
.andElse([=](const std::string& _error, const std::string& _help) mutable {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_nbElementLoaded++;
|
||||
@ -249,11 +248,11 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.andThen([=](zeus::Future<std::string> _fut) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get production-methode: " << _fut.get());
|
||||
.andThen([=](const std::string& _value) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get production-methode: " << _value);
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_productMethode = _fut.get();
|
||||
tmpProperty->m_productMethode = _value;
|
||||
}
|
||||
m_widget->markToRedraw();
|
||||
{
|
||||
@ -265,8 +264,8 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
media.getMetadata("type")
|
||||
.andElse([=](zeus::Future<std::string> _fut) mutable {
|
||||
_media.getMetadata("type")
|
||||
.andElse([=](const std::string& _error, const std::string& _help) mutable {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_nbElementLoaded++;
|
||||
@ -276,11 +275,11 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.andThen([=](zeus::Future<std::string> _fut) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get type: " << _fut.get());
|
||||
.andThen([=](const std::string& _value) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get type: " << _value);
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_type = _fut.get();
|
||||
tmpProperty->m_type = _value;
|
||||
}
|
||||
m_widget->markToRedraw();
|
||||
{
|
||||
@ -292,8 +291,8 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
media.getMineType()
|
||||
.andElse([=](zeus::Future<std::string> _fut) mutable {
|
||||
_media.getMineType()
|
||||
.andElse([=](const std::string& _error, const std::string& _help) mutable {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_nbElementLoaded++;
|
||||
@ -303,11 +302,11 @@ void appl::ElementProperty::loadData() {
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.andThen([=](zeus::Future<std::string> _fut) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get mine-type: " << _fut.get());
|
||||
.andThen([=](const std::string& _value) mutable {
|
||||
APPL_INFO(" [" << tmpProperty->m_id << "] get mine-type: " << _value);
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(tmpProperty->m_mutex);
|
||||
tmpProperty->m_mineType = _fut.get();
|
||||
tmpProperty->m_mineType = _value;
|
||||
if (etk::start_with(tmpProperty->m_mineType, "video") == true) {
|
||||
// TODO : Optimise this ...
|
||||
tmpProperty->m_thumb = egami::load("DATA:Video.svg", ivec2(128,128));
|
||||
|
@ -6,9 +6,9 @@
|
||||
#pragma once
|
||||
#include <zeus/debug.hpp>
|
||||
#include <zeus/message/ParamType.hpp>
|
||||
#include <zeus/File.hpp>
|
||||
#include <zeus/message/Message.hpp>
|
||||
#include <zeus/message/Call.hpp>
|
||||
#include <zeus/Raw.hpp>
|
||||
#include <ememory/memory.hpp>
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace zeus {
|
||||
|
||||
void notify(const std::string& _value) {
|
||||
if (m_interface != nullptr) {
|
||||
m_interface->answerValue(m_transactionId, m_source, m_destination, _value);
|
||||
m_interface->progressNotify(m_transactionId, m_source, m_destination, _value);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -85,6 +85,14 @@ namespace zeus {
|
||||
});
|
||||
return *this;
|
||||
}
|
||||
Future<ZEUS_RETURN>& andThen(std::function<bool(const ZEUS_RETURN&)> _callback) {
|
||||
zeus::FutureBase::andThen(
|
||||
[=](zeus::FutureBase _fut) {
|
||||
zeus::Future<ZEUS_RETURN> tmp(_fut);
|
||||
return _callback(tmp.get());
|
||||
});
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* @brief Attach callback on a specific return action (ERROR)
|
||||
* @param[in] _callback Handle on the function to call in case of error on the call
|
||||
@ -96,6 +104,13 @@ namespace zeus {
|
||||
});
|
||||
return *this;
|
||||
}
|
||||
Future<ZEUS_RETURN>& andElse(std::function<bool(const std::string&, const std::string&)> _callback) {
|
||||
zeus::FutureBase::andElse(
|
||||
[=](zeus::FutureBase _fut) {
|
||||
return _callback(_fut.getErrorType(), _fut.getErrorHelp());
|
||||
});
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* @brief Attach callback on activity of the action if user set some return information
|
||||
* @param[in] _callback Handle on the function to call in progress information
|
||||
|
@ -85,7 +85,7 @@ namespace zeus {
|
||||
*/
|
||||
class ObjectRemote {
|
||||
private:
|
||||
ememory::SharedPtr<zeus::ObjectRemoteBase> m_interface;
|
||||
mutable ememory::SharedPtr<zeus::ObjectRemoteBase> m_interface;
|
||||
public:
|
||||
/**
|
||||
* @brief
|
||||
@ -113,7 +113,7 @@ namespace zeus {
|
||||
* @return A generic future with all datas
|
||||
*/
|
||||
template<class... _ARGS>
|
||||
zeus::FutureBase call(const std::string& _functionName, _ARGS&&... _args) {
|
||||
zeus::FutureBase call(const std::string& _functionName, _ARGS&&... _args) const {
|
||||
if ( m_interface == nullptr
|
||||
|| m_interface->m_interfaceWeb == nullptr) {
|
||||
ememory::SharedPtr<zeus::message::Answer> ret = zeus::message::Answer::create(nullptr); // TODO : This is a real bad case ...
|
||||
@ -133,7 +133,7 @@ namespace zeus {
|
||||
* @return
|
||||
*/
|
||||
template<class... _ARGS>
|
||||
zeus::FutureBase callAction(const std::string& _functionName, _ARGS&&... _args) {
|
||||
zeus::FutureBase callAction(const std::string& _functionName, _ARGS&&... _args) const {
|
||||
zeus::FutureBase tmp = call(_functionName, _args...);
|
||||
tmp.setAction();
|
||||
return tmp;
|
||||
|
@ -120,10 +120,10 @@ zeus::Raw zeus::FileImpl::getPart(uint64_t _start, uint64_t _stop) {
|
||||
|
||||
std::string zeus::storeInFile(zeus::ProxyFile _file, std::string _filename) {
|
||||
zeus::ActionNotification tmp;
|
||||
return zeus::storeInFile(_file, _filename, tmp);
|
||||
return zeus::storeInFileNotify(_file, _filename, tmp);
|
||||
}
|
||||
|
||||
std::string zeus::storeInFile(zeus::ProxyFile _file, std::string _filename, zeus::ActionNotification _notification) {
|
||||
std::string zeus::storeInFileNotify(zeus::ProxyFile _file, std::string _filename, zeus::ActionNotification _notification) {
|
||||
auto futSize = _file.getSize();
|
||||
auto futSha = _file.getSha512();
|
||||
futSize.wait();
|
||||
@ -150,7 +150,7 @@ std::string zeus::storeInFile(zeus::ProxyFile _file, std::string _filename, zeus
|
||||
offset += nbElement;
|
||||
retSize -= nbElement;
|
||||
ZEUS_VERBOSE("read: " << offset << "/" << futSize.get() << " " << buffer.size());
|
||||
"{\"pourcent\":" + etk::to_string(float(offset)/float(buffer.size())) + ", \"comment\":\"download\""
|
||||
_notification.notify("{\"pourcent\":" + etk::to_string(float(offset)/float(buffer.size())) + ", \"comment\":\"download\"");
|
||||
}
|
||||
nodeFile.fileClose();
|
||||
// get the final sha512 of the file:
|
||||
|
Loading…
x
Reference in New Issue
Block a user