CreatorInterface.hpp 2 KB
 Praetorius, Simon committed Mar 20, 2016 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 #pragma once #include namespace AMDiS { /** \ingroup Common * \brief * Interface for the implementation of the factory method pattern. * The creation of an object of a sub class of BaseClass is deligated * to a corresponding sub class of Creator. So it is possible to * manage a CreatorMap, which can be extended at run-time. An example is * the LinearSolverInterfaceMap: If you write your own LinearSolverInterface sub class and a * corresponding Creator >, you can add the creator together * with a key string to the LinearSolverInterfaceMap. Then you can create an LinearSolverInterface * depending of a key string read from the init file, which can also be * your own new solver. */ template class CreatorInterface { public: virtual ~CreatorInterface() {} /** \brief * Must be implemented by sub classes of CreatorInterface. * Creates a new instance of the sub class of BaseClass. */ virtual BaseClass* create() = 0; /// Can be implemented by sub classes. virtual void free(BaseClass*) {} /// virtual bool isNullCreator() { return false; } }; /** \brief * A Creator which creates no object and returns NULL instead. * Used together with the key word 'no' in CreatorMap. */ template class NullCreator : public CreatorInterface { /// Creates no object. virtual BaseClass* create() override { return NULL; } /// Implementation of \ref CreatorInterface::isNullCreator() virtual bool isNullCreator() override { return true; } }; /** * \ingroup Common * * \brief * Interface for creators with name. */ template class CreatorInterfaceName : public CreatorInterface { public: /// Sets \ref name void setName(std::string str) { name = str; } protected: std::string name; }; } // end namespace AMDiS
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2260679304599762, "perplexity": 1625.3770781597968}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882571719.48/warc/CC-MAIN-20220812140019-20220812170019-00161.warc.gz"}