diff options
author | Florent Le Coz <louiz@louiz.org> | 2015-05-28 23:42:52 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2015-05-28 23:46:24 +0200 |
commit | e1a7114c8daa10589c830ce972cf461c3540111b (patch) | |
tree | 3b9fc79a881b252248d30c8e797bed13f131e90b /louloulibs/xmpp/adhoc_session.cpp | |
parent | 897b281e67dc82700db9fd9c2dedc5e01e5871ee (diff) | |
download | biboumi-e1a7114c8daa10589c830ce972cf461c3540111b.tar.gz biboumi-e1a7114c8daa10589c830ce972cf461c3540111b.tar.bz2 biboumi-e1a7114c8daa10589c830ce972cf461c3540111b.tar.xz biboumi-e1a7114c8daa10589c830ce972cf461c3540111b.zip |
louloulibs is directly included, instead of being a submodule
Because this is a nightmare to manage
Diffstat (limited to 'louloulibs/xmpp/adhoc_session.cpp')
m--------- | louloulibs | 0 | ||||
-rw-r--r-- | louloulibs/xmpp/adhoc_session.cpp | 37 |
2 files changed, 37 insertions, 0 deletions
diff --git a/louloulibs b/louloulibs deleted file mode 160000 -Subproject 0f3c1183e2bf0941ae2bffd3f31577bce4f3001 diff --git a/louloulibs/xmpp/adhoc_session.cpp b/louloulibs/xmpp/adhoc_session.cpp new file mode 100644 index 0000000..fc60bb7 --- /dev/null +++ b/louloulibs/xmpp/adhoc_session.cpp @@ -0,0 +1,37 @@ +#include <xmpp/adhoc_session.hpp> +#include <xmpp/adhoc_command.hpp> + +#include <assert.h> + +AdhocSession::AdhocSession(const AdhocCommand& command, const std::string& jid): + command(command), + owner_jid(jid), + current_step(0), + terminated(false) +{ +} + +AdhocSession::~AdhocSession() +{ +} + +const AdhocStep& AdhocSession::get_next_step() +{ + assert(this->current_step < this->command.callbacks.size()); + return this->command.callbacks[this->current_step++]; +} + +size_t AdhocSession::remaining_steps() const +{ + return this->command.callbacks.size() - this->current_step; +} + +bool AdhocSession::is_terminated() const +{ + return this->terminated; +} + +void AdhocSession::terminate() +{ + this->terminated = true; +} |