From dc31e6cc204213f6bcf788f9cae30b856ad04fa2 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 27 Dec 2022 13:11:53 +0100 Subject: update class diagram --- oop2eindopdr/class-diagram.svg | 2048 +++++++++++++++++++++------------------- 1 file changed, 1075 insertions(+), 973 deletions(-) diff --git a/oop2eindopdr/class-diagram.svg b/oop2eindopdr/class-diagram.svg index 4467582..ebdb3db 100644 --- a/oop2eindopdr/class-diagram.svg +++ b/oop2eindopdr/class-diagram.svg @@ -1,6 +1,6 @@ - Qt SVG Document Generated with Qt @@ -18,472 +18,387 @@ font-family="Sans Serif" font-size="12" font-weight="400" font-style="normal" > - - - + - - - - - - - - - - - -ZipExport - - - - - - - - - - - - - - - - - - - - - - - - - -- pokedex : Pokedex* - - - - - - - - - - - - - - - - -- csv_path : string + - - - + - - - -- zip_path : string - - + - - - + - -- id_list : std::vector< std :: string > - - - - + - - - - + - - - -+ ZipExport() «constructor» - - + - - - + - -+ ZipExport(pokedex : Pokedex*, input_csv : string, output_zip : string) «constructor» - - - - + - - -+ ~ZipExport() «destructor» - + - - - - - -+ set_pokedex(pokedex : Pokedex*) + - - - + - - - -+ import_csv(filename : string) - - + - - - + - -+ export_zip(filename : string) - - - - + - - - - + - - - - + - - - -Pokedex +PokemonCard - @@ -493,1223 +408,1243 @@ font-family="Sans Serif" font-size="12" font-weight="700" font-style="normal" > - - - + - - - - - cards : std::vector< PokemonCard * > + >- raw_data : nlohmann::json - - - - - - - cache : CacheManager* + >- pokedex : Pokedex* - - - - - - - api : PokemonTCGAPIClient* + >- image_download_thread : std::thread* - - - - - - - download_manager : DownloadManager* + >- url_card_normal : string - - - - - - - +- url_card_hires : string - - - - -- load_collection_remote() - - ++ id : string - - - - -- load_collection_local() - - ++ name : string - - - - -- verify_collection() - - ++ hp : unsigned - - - - -- search_cards_local(query : string) : std::vector< PokemonCard * > - - ++ value : double - - - - -- search_cards_remote(query : string) : std::vector< PokemonCard * > - - ++ attacks : std::vector< std :: string > - - - - -- lower(input : string) : string - + - - - - - + Pokedex() «constructor» + >- raw_load_json(raw_data : nlohmann::json) - - - - - - + ~Pokedex() «destructor» + >- raw_load_cache(cache_path : const char*) - - - - - - + search_cards(query : string) : std::vector< PokemonCard * > + >- prefix_cache_path(filename : const char*) : string - - - - - - + get_card_by_id(id : string) : PokemonCard* + >+ PokemonCard(pokedex : Pokedex*) «constructor» - - - - - - - ++ ~PokemonCard() «destructor» - - - - - - - ++ short_identifier() : string - -DownloadManager - - - - - - ++ fetch_market_value() - - - -- max_files : const unsigned - - - ++ verify_files() - - - -- download_queue : std::vector< std :: thread * > - - - ++ download_files() - - - -- file_queue : std::vector< std :: fstream * > - - - ++ set_pokedex(pokedex : Pokedex*) - - - - - - - ++ image_location() : string - -- open_file(filename : string) : std::fstream* - - - - - ++ image_location_hires() : string - -- close_file(file_ptr : std::fstream*) - - - - - - -+ DownloadManager() «constructor» - - + - - + + + +PokemonTCGAPIClient + + + + + + + + + - + - -+ ~DownloadManager() «destructor» - - - +- API_URL : const char* - - - -+ wget(url : string, filename : string) : std::thread* - - + - - - - - - ++ PokemonTCGAPIClient() «constructor» - - - - - - - ++ ~PokemonTCGAPIClient() «destructor» - - - - - - - +- raw_request(endpoint : const char*, params : cpr::Parameters) : nlohmann::json - - - - - - - - +- raw_get_cards(query : const char*) : nlohmann::json - - - - - - - - +- raw_get_card(id : const char*) : nlohmann::json - - - - - - - +- raw_get_sets(query : const char*) : nlohmann::json - - - - - - - ++ get_cards_by_query(query : const char*) : std::vector< PokemonCard * > - - - - - - - - ++ get_set_cards(set_name : const char*) : std::vector< PokemonCard * > - - -0..1 - - - - --pokedex ++ get_full_card(id : const char*) : PokemonCard* - - - - -0..1 - - ++ get_sets() : std::vector< std :: string > - - -0..1 - - - - --pokedex - - - - + - - - -CacheManager +Pokedex - @@ -1719,1965 +1654,2132 @@ font-family="Sans Serif" font-size="12" font-weight="700" font-style="normal" > - - - + - - - - - cache_path : string + >- cards : std::vector< PokemonCard * > - - - - - - - files : std::vector< std :: fstream * > + >- cache : CacheManager* - - - - - - - max_tries : const unsigned int + >- api : PokemonTCGAPIClient* - - - - - - + age : uint64_t + >- download_manager : DownloadManager* - - - - - - + - - - - - - retry(label : string, check_pre : bool, action : std::function< void ( ) >, retry_if : std::function< bool ( ) >) + >- load_collection_remote() - - - - - - - retry_while(label : string, action : std::function< void ( ) >, retry_if : std::function< bool ( ) >) + >- load_collection_local() - - - - - - - retry_if(label : string, action : std::function< void ( ) >, retry_if : std::function< bool ( ) >) + >- verify_collection() - - - - - - + CacheManager(cache_path : string) «constructor» + >- search_cards_local(query : string) : std::vector< PokemonCard * > - - - - - - + CacheManager(cache_path : const char*) «constructor» + >- search_cards_remote(query : string) : std::vector< PokemonCard * > - - - - - - + ~CacheManager() «destructor» + >- lower(input : string) : string - - - - - - + init_cache() + >+ Pokedex() «constructor» - - - - - - + update_cache() + >+ ~Pokedex() «destructor» - - - - - - + verify_cache() + >+ search_cards(query : string) : std::vector< PokemonCard * > - - - - - - + cache_get(filename : const char*) : std::fstream* + >+ get_card_by_id(id : string) : PokemonCard* - - - - - - -+ cache_get(filename : string) : std::fstream* - - - + - + + + + + + +DownloadManager + + + + + + + + + + + + + - - -+ cache_exists(filename : const char*) : bool - - +- max_files : const unsigned - - - - -+ cache_exists(filename : string) : bool - - +- download_queue : std::vector< std :: thread * > - - - - -+ prefix_cache_path(filename : const char*) : string - - +- file_queue : std::vector< std :: fstream * > - - - - - - + - - - - --cache - +- open_file(filename : string) : std::fstream* - - - - - - -PokemonTCGAPIClient - +- close_file(file_ptr : std::fstream*) - - - - - - - ++ DownloadManager() «constructor» - -- API_URL : const char* - - - - - - ++ ~DownloadManager() «destructor» - - - - - -+ PokemonTCGAPIClient() «constructor» - ++ wget(url : string, filename : string) : std::thread* - - - - - -+ ~PokemonTCGAPIClient() «destructor» - - - - + + + + + + + + + + +CacheManager - + + + + + + + + + + - -- raw_request(endpoint : const char*, params : cpr::Parameters) : nlohmann::json - - - +- cache_path : string - - - -- raw_get_cards(query : const char*) : nlohmann::json - - - +- files : std::vector< std :: fstream * > - - - -- raw_get_card(id : const char*) : nlohmann::json - - - +- max_tries : const unsigned int - - - -- raw_get_sets(query : const char*) : nlohmann::json - - - ++ age : uint64_t - - - -+ get_cards_by_query(query : const char*) : std::vector< PokemonCard * > - - + - - - - -+ get_set_cards(set_name : const char*) : std::vector< PokemonCard * > - +- retry(label : string, check_pre : bool, action : std::function< void ( ) >, retry_if : std::function< bool ( ) >) - - - - - -+ get_full_card(id : const char*) : PokemonCard* - +- retry_while(label : string, action : std::function< void ( ) >, retry_if : std::function< bool ( ) >) - - - - - -+ get_sets() : std::vector< std :: string > - +- retry_if(label : string, action : std::function< void ( ) >, retry_if : std::function< bool ( ) >) - - - - - - - ++ CacheManager(cache_path : const char*) «constructor» - - - - - - - -PokemonCard ++ CacheManager(cache_path : string) «constructor» - - - - - - - ++ ~CacheManager() «destructor» - - -- raw_data : nlohmann::json - - - - ++ init_cache() - - -- pokedex : Pokedex* - - - - ++ update_cache() - - -- image_download_thread : std::thread* - - - - ++ verify_cache() - - -- url_card_normal : string - - - - ++ cache_get(filename : const char*) : std::fstream* - - -- url_card_hires : string - - - - ++ cache_get(filename : string) : std::fstream* - - -+ id : string - - - - ++ cache_exists(filename : const char*) : bool - - -+ name : string - - - - ++ cache_exists(filename : string) : bool - - -+ hp : unsigned - - - - ++ prefix_cache_path(filename : const char*) : string - - -+ value : double - - - - - - -+ attacks : std::vector< std :: string > - + + + + + + + - +ZipExport + + + + + + + + + + + + + - - - - - +- pokedex : Pokedex* - - - - -- raw_load_json(raw_data : nlohmann::json) - - +- csv_path : string - - - - -- raw_load_cache(cache_path : const char*) - - +- zip_path : string - - - - -- prefix_cache_path(filename : const char*) : string - - ++ id_list : std::vector< std :: string > - - - - -+ PokemonCard(pokedex : Pokedex*) «constructor» - + - - - - - -+ ~PokemonCard() «destructor» ++ ZipExport() «constructor» - - - - - - -+ short_identifier() : string ++ ~ZipExport() «destructor» - - - - - - -+ fetch_market_value() ++ set_pokedex(pokedex : Pokedex*) - - - - - - -+ verify_files() ++ import_csv(filename : string) : std::vector< std :: string > - - - - - - -+ download_files() ++ export_zip(filename : string, cards : std::vector< PokemonCard * >) - - - - - - -+ set_pokedex(pokedex : Pokedex*) - - - - +0..1 - - -+ image_location() : string - - +-api - - - - +0..1 + + + + + + + + + + + + +-pokedex + + + -+ image_location_hires() : string - - - +0..1 - - - - - +-download_manager - - - - -0..1 - - - - --api +-cache + + + + + + + + + + + + +0..1 + + + + + + + + + + + + +-pokedex - -- cgit v1.2.3