Add observeExistence for request until porting request to shared_ptr

This commit is contained in:
Benau 2018-06-06 13:23:48 +08:00
parent cbe5aad3d9
commit ca039b13ff
2 changed files with 6 additions and 0 deletions

View File

@ -43,6 +43,7 @@ namespace Online
m_info = "";
m_success = false;
m_xml_data = NULL;
m_exists = std::make_shared<bool>(true);
} // XMLRequest
// ------------------------------------------------------------------------

View File

@ -30,8 +30,10 @@
#endif
#include <curl/curl.h>
#include <assert.h>
#include <memory>
#include <string>
namespace Online
{
/** A http request expecting a xml return value.
@ -42,6 +44,7 @@ namespace Online
/** On a successful download contains the converted XML tree. */
XMLNode *m_xml_data;
std::shared_ptr<bool> m_exists;
protected:
/** Additional info contained the downloaded data (or an error
@ -89,6 +92,8 @@ namespace Online
assert(hasBeenExecuted());
return m_success;
} // isSuccess
// --------------------------------------------------------------------
std::weak_ptr<bool> observeExistence() const { return m_exists; }
}; // class XMLRequest
} //namespace Online