Lumiera  0.pre.03
»edit your freedom«
test-rand-ontology.hpp
Go to the documentation of this file.
1 /*
2  TEST-RAND-ONTOLOGY.hpp - placeholder for a domain-ontology working on dummy data frames
3 
4  Copyright (C)
5  2024, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
19 #ifndef STEAM_ENGINE_TEST_RAND_ONTOLOGY_H
20 #define STEAM_ENGINE_TEST_RAND_ONTOLOGY_H
21 
22 
23 #include "lib/error.hpp"
24 #include "lib/symbol.hpp"
25 #include "lib/depend.hpp"
26 #include "lib/nocopy.hpp"
27 #include "lib/format-string.hpp"
29 
30 #include <array>
31 #include <string>
32 
33 
34 namespace steam {
35 namespace engine{
36 namespace test {
37 
38  using std::string;
39  using lib::Literal;
40  using util::_Fmt;
41 
43  void generateFrame (TestFrame* buff, size_t frameNr =0, uint flavour =0);
44 
46  void generateMultichan (TestFrame* buffArry, uint chanCnt, size_t frameNr =0, uint flavour =0);
47 
49  void duplicateMultichan (TestFrame* outArry, TestFrame* inArry, uint chanCnt);
50 
52  void manipulateMultichan (TestFrame* buffArry, uint chanCnt, uint64_t param);
53 
55  void manipulateFrame (TestFrame* out, TestFrame const* in, uint64_t param);
56 
58  void combineFrames (TestFrame* out, TestFrame const* srcA, TestFrame const* srcB, double mix);
59 
60 
61 
63  using NoArg = std::array<char*, 0>;
64  using SoloArg = std::array<char*, 1>;
65 
66  extern const string DUMMY_FUN_ID;
67 
70  inline void
71  dummyOp (NoArg in, SoloArg out)
72  {
73  UNIMPLEMENTED ("a sincerely nonsensical operation");
74  }
76 
86  {
87 
88  public:
89  struct Spec;
90 
91  ~TestRandOntology() = default;
92  TestRandOntology() = default;
93 
94  Spec setupGenerator (string qual ="");
95  private:
96  };
97 
98 
101  {
102  const string PROTO;
103 
104  Spec (Literal kind
105  ,Literal type
106  )
107  : PROTO{_Fmt{"%s-%s"} % kind % type}
108  { }
109  };
110 
112  TestRandOntology::setupGenerator (string qual)
113  {
114  Spec spec{"generate","TestFrame"};
115  return spec;
116  }
117 
120 
121 
122 
123 }}} // namespace steam::engine::test
124 #endif
void manipulateMultichan(TestFrame *buffArry, uint chanCnt, uint64_t param)
»process« a planar multi channel array of data frames in-place.
void generateMultichan(TestFrame *buffArry, uint chanCnt, size_t frameNr, uint flavour)
produce planar multi channel output of random data frames
Definition: run.hpp:40
inline string literal This is a marker type to indicate that
Definition: symbol.hpp:76
Front-end for printf-style string template interpolation.
void generateFrame(TestFrame *buff, size_t frameNr, uint flavour)
produce sequences of frames with (reproducible) random data
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
void duplicateMultichan(TestFrame *outArry, TestFrame *inArry, uint chanCnt)
create an identical clone copy of the planar multi channel frame array
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:280
void manipulateFrame(TestFrame *out, TestFrame const *in, uint64_t param)
»process« random frame date by hash-chaining with a parameter.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
A fake Domain Ontology to describe mocked »render operations« on dummy data frames filled with random...
Marker types to indicate a literal string and a Symbol.
ElementBoxWidget::Config::Qualifier kind(Kind kind)
qualify the basic use case for the new ElementBoxWidget
Singleton services and Dependency Injection.
Types marked with this mix-in may be duplicated by copy-construction, yet may not be moved or transfe...
Definition: nocopy.hpp:95
Lumiera error handling (C++ interface).
void dummyOp(NoArg in, SoloArg out)
void combineFrames(TestFrame *out, TestFrame const *srcA, TestFrame const *srcB, double mix)
mix two random data frames by a parameter-controlled proportion
Unit test helper to generate fake test data frames.
lib::Depend< TestRandOntology > testRand
Storage for the Singleton-Accessor/Factory.