diff options
Diffstat (limited to 'server/include')
-rw-r--r-- | server/include/api_core_events.h | 11 | ||||
-rw-r--r-- | server/include/utilities.h | 16 |
2 files changed, 26 insertions, 1 deletions
diff --git a/server/include/api_core_events.h b/server/include/api_core_events.h index e7e0dac..072ec45 100644 --- a/server/include/api_core_events.h +++ b/server/include/api_core_events.h @@ -21,15 +21,24 @@ #ifndef API_CORE_EVENTS_H #define API_CORE_EVENTS_H +class module_base; + namespace core_events { enum download_state {download_stopped, download_running, download_completed, download_error}; +struct download_state_info +{ + int download_id; + download_state state; +}; + + class core_events { public: - virtual void download_state_changed(int download_id, download_state state); + virtual void download_state_changed(module_base *m, std::list<download_state_info> state_list); }; }; diff --git a/server/include/utilities.h b/server/include/utilities.h index 40eb38f..3e77f89 100644 --- a/server/include/utilities.h +++ b/server/include/utilities.h @@ -25,6 +25,7 @@ #include <string> #include <memory> + //TODO: use glib's xdg api instead ? std::string replace_home_var(const std::string &path); @@ -35,6 +36,21 @@ std::shared_ptr<char*> pack_msg(server_msg *msg, int *size); std::string random_string(int length); std::string generate_auth_token(); +#include <boost/thread/lockable_adapter.hpp> +#include <boost/thread/mutex.hpp> + +template <typename CONTAINER> +class lockable_container : public boost::basic_lockable_adapter<boost::mutex>, public CONTAINER +{ + +}; + +/*template <typename CONTAINER> +class lockable_container_child : public lockable_container <CONTAINER> +{ + //code +}; */ + #endif // UTILITIES_H_INCLUDED |