#ifndef _TR_TEST_SESSION_CONTEXT_HPP_ #define _TR_TEST_SESSION_CONTEXT_HPP_ #include #include #include #include class TestSessionSettings { public: int download_rate_limit = 1; int upload_rate_limit = 2; int listen_interfaces = 3; int enable_dht = 4; bool enable_dht_ = true; int download_rate_limit_ = 0; int upload_rate_limit_ = 0; std::string listen_interfaces_ = "0.0.0.0:0"; void set_bool(int type, int value); void set_int(int type, int value); void set_str(int type, std::string value); int get_int(int type) const; bool get_bool(int type); std::string get_str(int type); }; class TestSession { public: bool valid = false; bool paused = false; std::vector torrents_; TestSessionSettings settings_; bool is_valid(); TestSessionSettings get_settings(); bool is_paused() const; void pause(); void resume(); int listen_port(); bool is_dht_running() const; std::vector &get_torrents(); void apply_settings(TestSessionSettings settings); void async_add_torrent(const libtorrent::add_torrent_params ¶ms); }; #endif