diff --git a/src/lib/gnuplot-gen.hpp b/src/lib/gnuplot-gen.hpp new file mode 100644 index 000000000..705faf854 --- /dev/null +++ b/src/lib/gnuplot-gen.hpp @@ -0,0 +1,72 @@ +/* + GNUPLOT-GEN.hpp - setup for simplified data visualisation via Gnuplot + + Copyright (C) Lumiera.org + 2024, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/** @file gnuplot-gen.hpp + ** Preconfigured setup for data visualisation with Gnuplot. + ** The visualisation tool [gnuplot] allows for simple data visualisation + ** in various formats, integrated into a *NIX commandline work environment. + ** + ** The namespace lib::gnuplot_gen provides .... + ** + ** @todo 3/2024 this is an initial draft, shaped by the immediate need to visualise + ** [measurement data](\ref vault::gear::test::SchedulerStress_test) collected + ** while testing the new [Scheduler](\ref scheduler.hpp) implementation. + ** + ** ## Usage + ** TBW + ** - blah + ** - blubb + ** + ** @see GnuplotGen_test + ** @see SchedulerStress_test + ** @see text-template.hpp + ** [gnuplot]: https://booooooooooooo + */ + + +#ifndef LIB_GNUPLOT_GEN_H +#define LIB_GNUPLOT_GEN_H + + +//#include "lib/format-util.hpp" +#include "lib/text-template.hpp" +//#include "lib/util.hpp" + +//#include +//#include +//#include +//#include + + +namespace lib { +namespace gnuplot_gen { ///< preconfigured setup for Gnuplot data visualisation + +// using util::toString; +// using util::isnil; +// using std::string; +// using std::move; + + + + +}} // namespace lib::gnuplot_gen +#endif /*LIB_GNUPLOT_GEN_H*/ diff --git a/src/lib/text-template.hpp b/src/lib/text-template.hpp new file mode 100644 index 000000000..ac9d87769 --- /dev/null +++ b/src/lib/text-template.hpp @@ -0,0 +1,55 @@ +/* + TEXT-TEMPLATE.hpp - minimalistic text substitution engine + + Copyright (C) Lumiera.org + 2024, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +/** @file text-template.hpp + ** A minimalistic text templating engine with flexible data binding. + ** + ** @todo WIP-WIP-WIP 3/2024 + ** @see TextTemplate_test + ** @see gnuplot-gen.hpp + ** @see SchedulerStress_test + */ + + +#ifndef LIB_TEXT_TEMPLATE_H +#define LIB_TEXT_TEMPLATE_H + + +#include "lib/error.hpp" +//#include "lib/util.hpp" + +//#include +//#include +//#include +//#include + + +namespace lib { + +// using Rat = boost::rational; +// using boost::rational_cast; +// using std::abs; + + +}// namespace lib +#endif /*LIB_TEXT_TEMPLATE_H*/ diff --git a/tests/15library.tests b/tests/15library.tests index ad0d0d684..9f0cf40c1 100644 --- a/tests/15library.tests +++ b/tests/15library.tests @@ -414,12 +414,17 @@ return: 0 END -TEST "HashGenerator_test" HashGenerator_test < + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + +/** @file gnuplot-gen-test.cpp + ** unit test \ref GnuplotGen_test + */ + + + +#include "lib/test/run.hpp" +#include "lib/test/test-helper.hpp"///////////////////////TODO +#include "lib/gnuplot-gen.hpp" +#include "lib/format-cout.hpp"///////////////////////TODO +#include "lib/test/diagnostic-output.hpp"///////////////////////TODO + +//#include +//#include + +//using std::array; + + +namespace lib { +namespace test { + + + /***************************************************************************//** + * @test verify data visualisation by generated Gnuplot scripts + * - generate a simple pot + * - generate a scatter plot with regression line + * @see gnuplot-gen.hpp + * @see TextTemplate_test + */ + class GnuplotGen_test : public Test + { + + virtual void + run (Arg) + { + simpeUsage(); + verify_instantiation(); + verify_keySubstituton(); + verify_conditional(); + verify_iteration(); + verify_Map_binding(); + verify_ETD_binding(); + + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + simpeUsage() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_instantiation() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_keySubstituton() + { + UNIMPLEMENTED ("nebbich"); + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_conditional() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_iteration() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_Map_binding() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_ETD_binding() + { + } + }; + + LAUNCHER (GnuplotGen_test, "unit common"); + + +}} // namespace lib::test diff --git a/tests/library/text-template-test.cpp b/tests/library/text-template-test.cpp new file mode 100644 index 000000000..c7efbc953 --- /dev/null +++ b/tests/library/text-template-test.cpp @@ -0,0 +1,139 @@ +/* + TextTemplate(Test) - verify the minimalistic text substitution engine + + Copyright (C) Lumiera.org + 2024, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + +/** @file text-template-test.cpp + ** unit test \ref TextTemplate_test + */ + + + +#include "lib/test/run.hpp" +#include "lib/test/test-helper.hpp"///////////////////////TODO +#include "lib/text-template.hpp" +#include "lib/format-cout.hpp"///////////////////////TODO +#include "lib/test/diagnostic-output.hpp"///////////////////////TODO + +//#include +//#include + +//using std::array; + + +namespace lib { +namespace test { + + + /***************************************************************************//** + * @test verify a minimalistic text substitution engine with flexible + * data binding, used for tool integration and script generation + * - cover the core parsing and templating functionality, + * using a direct binding + * - demonstrate the default-binding for a data map + * - cover the binding to Lumiera's ยปExternal Tree Descriptionยซ + * @see text-template.hpp + * @see GnuplotGen_test + */ + class TextTemplate_test : public Test + { + + virtual void + run (Arg) + { + simpeUsage(); + verify_instantiation(); + verify_keySubstituton(); + verify_conditional(); + verify_iteration(); + verify_Map_binding(); + verify_ETD_binding(); + + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + simpeUsage() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_instantiation() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_keySubstituton() + { + UNIMPLEMENTED ("nebbich"); + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_conditional() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_iteration() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_Map_binding() + { + } + + + /** @test TODO + * @todo WIP 4/24 ๐Ÿ” define โŸถ implement + */ + void + verify_ETD_binding() + { + } + }; + + LAUNCHER (TextTemplate_test, "unit common"); + + +}} // namespace lib::test diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 0a3de8441..8597fbaf0 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -54040,7 +54040,7 @@ - + @@ -54178,6 +54178,10 @@ + + + + @@ -112325,6 +112329,10 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + @@ -112337,6 +112345,243 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
mustache tmpl{"Hello {{what}}!"};
+std::cout << tmpl.render({"what", "World"}) << std::en
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ dies ist eine Aufgabe, die in dynamischen Sprachen nahezu magisch lösbar ist +

+ +
+
+ + + + + + + + + + + + + +

+ mir ist kein Vorschlag bekannt; vermutlich haben die Leute die gleiche Analyse vollzogen, wie ich sie hier grade mache +

+ +
+
+ + + + +

+ wenn man sich auf die Essenz beschränkt, kann man es selber schreiben +

+ +
+ + +
+
+ + + + + + + + + + + + + + + + + +

+ Keinerlei Annahmen über die Datenypen +

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+