Invocation: reorg namespace for TestRandOntology
The namespace `steam::engine::test::ont` will hold some typical definitions for the fake „media processing library“ — to be used for validating aspects of mapping and binding.
This commit is contained in:
parent
bbed729d94
commit
e47f1db8c5
6 changed files with 240 additions and 225 deletions
|
|
@ -66,7 +66,7 @@ namespace test {
|
|||
CHECK (handle.isValid());
|
||||
auto& data = handle.accessAs<TestFrame>();
|
||||
uint64_t param = defaultGen.u64();
|
||||
manipulateFrame (&data, &data, param);
|
||||
ont::manipulateFrame (&data, &data, param);
|
||||
|
||||
// »client« is done...
|
||||
handle.emit();
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ namespace test {
|
|||
Buffer buff;
|
||||
CHECK (not buff->isSane());
|
||||
|
||||
generateFrame (buff, frameNr, flavour);
|
||||
ont::generateFrame (buff, frameNr, flavour);
|
||||
CHECK ( buff->isSane());
|
||||
CHECK ( buff->isPristine());
|
||||
CHECK (*buff == TestFrame(frameNr,flavour));
|
||||
|
|
@ -119,7 +119,7 @@ namespace test {
|
|||
for (uint i=0; i<channels; ++i)
|
||||
CHECK (not buff[i]->isSane());
|
||||
|
||||
generateMultichan (buff[0], channels, frameNr, flavour);
|
||||
ont::generateMultichan (buff[0], channels, frameNr, flavour);
|
||||
for (uint i=0; i<channels; ++i)
|
||||
{
|
||||
CHECK (buff[i]->isPristine());
|
||||
|
|
@ -136,13 +136,13 @@ namespace test {
|
|||
uint flavour = defaultGen.u64();
|
||||
uint channels = 1 + rani(50);
|
||||
Buffer srcBuff[50];
|
||||
generateMultichan (srcBuff[0], channels, frameNr, flavour);
|
||||
ont::generateMultichan (srcBuff[0], channels, frameNr, flavour);
|
||||
|
||||
Buffer clone[50];
|
||||
for (uint i=0; i<channels; ++i)
|
||||
CHECK (not clone[i]->isSane());
|
||||
|
||||
duplicateMultichan (clone[0],srcBuff[0], channels);
|
||||
ont::duplicateMultichan (clone[0],srcBuff[0], channels);
|
||||
for (uint i=0; i<channels; ++i)
|
||||
{
|
||||
CHECK (clone[i]->isPristine());
|
||||
|
|
@ -168,15 +168,15 @@ namespace test {
|
|||
uint flavour = defaultGen.u64();
|
||||
uint channels = 1 + rani(50);
|
||||
Buffer buff[50], refData[50];
|
||||
generateMultichan (buff[0], channels, frameNr, flavour);
|
||||
ont::generateMultichan (buff[0], channels, frameNr, flavour);
|
||||
// stash away a copy of the test data for verification
|
||||
duplicateMultichan(refData[0],buff[0], channels);
|
||||
ont::duplicateMultichan(refData[0],buff[0], channels);
|
||||
|
||||
for (uint c=0; c<channels; ++c)
|
||||
CHECK (buff[c]->isPristine());
|
||||
|
||||
uint64_t param = defaultGen.u64();
|
||||
manipulateMultichan(buff[0], channels, param);
|
||||
ont::manipulateMultichan(buff[0], channels, param);
|
||||
|
||||
const uint SIZ = buff[0]->data64().size();
|
||||
vector<uint64_t> xlink(SIZ, param); // temporary storage for verifying the hash-chain
|
||||
|
|
@ -214,7 +214,7 @@ namespace test {
|
|||
CHECK (oBuff->isPristine());
|
||||
|
||||
uint64_t param = defaultGen.u64();
|
||||
manipulateFrame (oBuff, iBuff, param);
|
||||
ont::manipulateFrame (oBuff, iBuff, param);
|
||||
CHECK ( oBuff->isValid());
|
||||
CHECK (not oBuff->isPristine());
|
||||
CHECK ( iBuff->isPristine());
|
||||
|
|
@ -230,7 +230,7 @@ namespace test {
|
|||
CHECK (feed == oDat);
|
||||
}
|
||||
// can also process in-place
|
||||
manipulateFrame (iBuff, iBuff, param);
|
||||
ont::manipulateFrame (iBuff, iBuff, param);
|
||||
CHECK (not iBuff->isPristine());
|
||||
CHECK ( iBuff->isValid());
|
||||
CHECK (*iBuff == *oBuff); // second invocation exactly reproduced data from first invocation
|
||||
|
|
@ -253,7 +253,7 @@ namespace test {
|
|||
CHECK (oBuff->isPristine());
|
||||
|
||||
double mix = defaultGen.uni();
|
||||
combineFrames (oBuff, i1Buff, i2Buff, mix);
|
||||
ont::combineFrames (oBuff, i1Buff, i2Buff, mix);
|
||||
CHECK ( oBuff->isValid());
|
||||
CHECK (not oBuff->isPristine());
|
||||
CHECK ( i1Buff->isPristine());
|
||||
|
|
@ -265,7 +265,7 @@ namespace test {
|
|||
CHECK (oDat == std::lround((1-mix)*i1Dat + mix*i2Dat));
|
||||
|
||||
// can also process in-place
|
||||
combineFrames (i1Buff, i1Buff, i2Buff, mix);
|
||||
ont::combineFrames (i1Buff, i1Buff, i2Buff, mix);
|
||||
CHECK (not i1Buff->isPristine());
|
||||
CHECK ( i1Buff->isValid());
|
||||
CHECK (*i1Buff == *oBuff); // second invocation exactly reproduced data from first invocation
|
||||
|
|
@ -283,15 +283,14 @@ namespace test {
|
|||
testRand_simpleUsage()
|
||||
{
|
||||
auto spec = testRand().setupGenerator();
|
||||
SHOW_EXPR(spec.PROTO);
|
||||
CHECK (spec.PROTO == "generate-TestFrame"_expect);
|
||||
SHOW_EXPR(spec.describe())
|
||||
|
||||
// generate a binding as processing-functor
|
||||
auto procFun = spec.makeFun();
|
||||
using Sig = lib::meta::_Fun<decltype(procFun)>::Sig;
|
||||
SHOW_EXPR(showType<Sig>())
|
||||
CHECK (showType<Sig>() == "void (tuple<ulong, uint>, engine::test::TestFrame*)"_expect);
|
||||
|
||||
// Behaves identical to processing_generateFrame()
|
||||
// Behaves identical to processing_generateFrame() — see above...
|
||||
size_t frameNr = defaultGen.u64();
|
||||
uint flavour = defaultGen.u64();
|
||||
|
||||
|
|
@ -303,15 +302,14 @@ SHOW_EXPR(showType<Sig>())
|
|||
CHECK ( buff->isPristine());
|
||||
CHECK (*buff == TestFrame(frameNr,flavour));
|
||||
|
||||
ProcNode node{prepareNode("Test")
|
||||
ProcNode node{prepareNode(spec.nodeID())
|
||||
.preparePort()
|
||||
.invoke(spec.describe(), procFun)
|
||||
.invoke(spec.procID(), procFun)
|
||||
.setParam(frameNr,flavour)
|
||||
.completePort()
|
||||
.build()};
|
||||
|
||||
SHOW_EXPR(watch(node).getPortSpec(0))
|
||||
CHECK (watch(node).getPortSpec(0) == "Test(TestFrame)"_expect);
|
||||
CHECK (watch(node).getPortSpec(0) == "Test:generate(TestFrame)"_expect);
|
||||
|
||||
BufferProvider& provider = DiagnosticBufferProvider::build();
|
||||
BuffHandle buffHandle = provider.lockBuffer (provider.getDescriptorFor(sizeof(TestFrame)));
|
||||
|
|
|
|||
|
|
@ -65,9 +65,16 @@ namespace test {
|
|||
void
|
||||
build_connected_nodes()
|
||||
{
|
||||
auto con = prepareNode("Test:Src")
|
||||
// use some dummy specs and a dummy operation....
|
||||
StrView nodeID{ont::DUMMY_NODE_ID};
|
||||
StrView procID{ont::DUMMY_PROC_ID};
|
||||
CHECK (nodeID == "Test:dummy"_expect);
|
||||
CHECK (procID == "op(int)"_expect);
|
||||
|
||||
// use the NodeBuilder to construct a simple source-node connectivity
|
||||
auto con = prepareNode(nodeID)
|
||||
.preparePort()
|
||||
.invoke(DUMMY_FUN_ID, dummyOp)
|
||||
.invoke(procID, ont::dummyOp)
|
||||
.completePort()
|
||||
.build();
|
||||
CHECK (isnil (con.leads));
|
||||
|
|
@ -80,7 +87,7 @@ namespace test {
|
|||
CHECK (watch(n1).ports().size() == 1);
|
||||
|
||||
// can generate a symbolic spec to describe the Port's processing functionality...
|
||||
CHECK (watch(n1).getPortSpec(0) == "Test:Src.dummyFun(TestFrame)"_expect);
|
||||
CHECK (watch(n1).getPortSpec(0) == "Test:dummy.op(int)"_expect);
|
||||
CHECK (watch(n1).getPortSpec(1) == "↯"_expect);
|
||||
|
||||
// such a symbolic spec is actually generated by a deduplicated metadata descriptor
|
||||
|
|
@ -100,14 +107,11 @@ namespace test {
|
|||
CHECK (meta3.genProcSpec() == "N1.uga()"_expect);
|
||||
|
||||
// re-generate the descriptor for the source node (n1)
|
||||
auto& metaN1 = ProcID::describe("Test:Src",DUMMY_FUN_ID);
|
||||
CHECK (metaN1.genProcSpec() == "Test:Src.dummyFun(TestFrame)"_expect);
|
||||
SHOW_EXPR(metaN1.genProcName())
|
||||
CHECK (metaN1.genProcName() == "Test:Src.dummyFun"_expect);
|
||||
SHOW_EXPR(metaN1.genNodeName())
|
||||
CHECK (metaN1.genNodeName() == "Test:Src"_expect);
|
||||
SHOW_EXPR(metaN1.genNodeSpec(con.leads))
|
||||
CHECK (metaN1.genNodeSpec(con.leads) == "Test:Src-◎"_expect);
|
||||
auto& metaN1 = ProcID::describe("Test:dummy","op(int)");
|
||||
CHECK (metaN1.genProcSpec() == "Test:dummy.op(int)"_expect);
|
||||
CHECK (metaN1.genProcName() == "Test:dummy.op"_expect);
|
||||
CHECK (metaN1.genNodeName() == "Test:dummy"_expect);
|
||||
CHECK (metaN1.genNodeSpec(con.leads) == "Test:dummy-◎"_expect);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -36,132 +36,130 @@ using lib::zip;
|
|||
namespace steam {
|
||||
namespace engine{
|
||||
namespace test {
|
||||
namespace ont {
|
||||
// namespace err = lumiera::error;
|
||||
|
||||
using ont::FraNo;
|
||||
using ont::ChaNo;
|
||||
using ont::Flavr;
|
||||
using ont::Factr;
|
||||
using ont::Param;
|
||||
|
||||
namespace { // hidden local support facilities....
|
||||
|
||||
} // (End) hidden impl details
|
||||
|
||||
|
||||
const string DUMMY_FUN_ID{"dummyFun(TestFrame)"};
|
||||
|
||||
/* ========= Dummy implementation of Media processing ========= */
|
||||
|
||||
/**
|
||||
* @param buff a sufficiently sized allocation to place the result data into
|
||||
* @param frameNr the frame of the »source feed« to generate (determines actual random data)
|
||||
* @param flavour a further seed parameter to determine the actual (reproducibly) random data
|
||||
*/
|
||||
void
|
||||
generateFrame (TestFrame* buff, FraNo frameNr, Flavr flavour)
|
||||
{
|
||||
REQUIRE (buff);
|
||||
new(buff) TestFrame{uint(frameNr), flavour};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param chanCnt size of the array of frames to generate
|
||||
* @param buffArry pointer to an allocation sufficiently sized to hold `TestFrame[chanCnt]`
|
||||
* @param frameNr the frame of the »source feed« to use commonly on all those frames in the output
|
||||
* @param flavour a further seed parameter used as starting offest for the output's `family` parameters
|
||||
* @remark this is a variation of the [dummy data generator](\ref #generateFrame),
|
||||
* which immediately generates a planar block of related frames with random data,
|
||||
* all seeded with the _same_ `frameNr` and _consecutive_ `family` parameters,
|
||||
* which will be offset commonly by adding the \a flavour parameter.
|
||||
*/
|
||||
void
|
||||
generateMultichan (TestFrame* buffArry, ChaNo chanCnt, FraNo frameNr, Flavr flavour)
|
||||
{
|
||||
REQUIRE (buffArry);
|
||||
for (uint i=0; i<chanCnt; ++i)
|
||||
new(buffArry+i) TestFrame{uint(frameNr), flavour+i};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param chanCnt size of the array of frames to clone
|
||||
* @param inArry pointer to storage holding a TestFrame[chanCnt]
|
||||
* @param outArry pointer to allocated storage sufficient to hold a clone copy of these
|
||||
*/
|
||||
void
|
||||
duplicateMultichan (TestFrame* outArry, TestFrame* inArry, ChaNo chanCnt)
|
||||
{
|
||||
REQUIRE (inArry);
|
||||
REQUIRE (outArry);
|
||||
for (uint i=0; i<chanCnt; ++i)
|
||||
new(outArry+i) TestFrame{inArry[i]};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param chanCnt size of the array of frames to manipulate
|
||||
* @param buffArry pointer to an array of several frames (channels)
|
||||
* @param param parameter to control or »mark« the data manipulation (hash-combining)
|
||||
* @remark this function in-place processing of several channels in one step: data is processed
|
||||
* in 64-bit words, by hash-chaining with \a param and then joining in the data items.
|
||||
* All data buffers will be manipulated and marked with as valid with a new checksum.
|
||||
*/
|
||||
void
|
||||
manipulateMultichan (TestFrame* buffArry, ChaNo chanCnt, Param param)
|
||||
{
|
||||
REQUIRE (buffArry);
|
||||
const uint SIZ = buffArry->data64().size();
|
||||
for (uint i=0; i<SIZ; ++i)
|
||||
{
|
||||
uint64_t feed{param};
|
||||
for (uint c=0; c<chanCnt; ++c)
|
||||
{
|
||||
auto& data = buffArry[c].data64()[i];
|
||||
lib::hash::combine(feed, data);
|
||||
data = feed;
|
||||
}
|
||||
}
|
||||
for (uint c=0; c<chanCnt; ++c)
|
||||
buffArry[c].markChecksum();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param out existing allocation to place the generated TestFrame into
|
||||
* @param in allocation holding the input TestFrame data
|
||||
* @param param parameter to control or »mark« the data manipulation (hash-combining)
|
||||
* @remark this function emulates „media data processing“: data is processed in 64-bit words,
|
||||
* by hash-chaining with \a param. The generated result is marked with a valid checksum.
|
||||
*/
|
||||
void
|
||||
manipulateFrame (TestFrame* out, TestFrame const* in, Param param)
|
||||
{
|
||||
REQUIRE (in);
|
||||
REQUIRE (out);
|
||||
auto calculate = [](uint64_t chain, uint64_t val){ lib::hash::combine(chain,val); return chain; };
|
||||
for (auto& [res,src] : zip (out->data64(), in->data64()))
|
||||
res = calculate(param, src);
|
||||
out->markChecksum();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param out existing allocation to receive the calculated result TestFrame
|
||||
* @param srcA a buffer holding the input data for feed-A
|
||||
* @param srcB a buffer holding the input data for feed-B
|
||||
* @param mix degree of mixing (by integer arithmetics): 100 means 100% feed-B
|
||||
* @remark this function emulates a mixing or overlaying operation:
|
||||
* each result byte is the linear interpolation between the corresponding inputs.
|
||||
*/
|
||||
void
|
||||
combineFrames (TestFrame* out, TestFrame const* srcA, TestFrame const* srcB, Factr mix)
|
||||
{
|
||||
REQUIRE (srcA);
|
||||
REQUIRE (srcB);
|
||||
REQUIRE (out);
|
||||
for (auto& [res,inA,inB] : zip (out->data()
|
||||
,srcA->data()
|
||||
,srcB->data()))
|
||||
res = lround((1-mix)*inA + mix*inB);
|
||||
out->markChecksum();
|
||||
}
|
||||
namespace { // hidden local support facilities....
|
||||
|
||||
} // (End) hidden impl details
|
||||
|
||||
/** @remark will be returned from dummyOp() */
|
||||
int dummyNum{-1};
|
||||
|
||||
|
||||
|
||||
/* ========= Dummy implementation of Media processing ========= */
|
||||
|
||||
/**
|
||||
* @param buff a sufficiently sized allocation to place the result data into
|
||||
* @param frameNr the frame of the »source feed« to generate (determines actual random data)
|
||||
* @param flavour a further seed parameter to determine the actual (reproducibly) random data
|
||||
*/
|
||||
void
|
||||
generateFrame (TestFrame* buff, FraNo frameNr, Flavr flavour)
|
||||
{
|
||||
REQUIRE (buff);
|
||||
new(buff) TestFrame{uint(frameNr), flavour};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param chanCnt size of the array of frames to generate
|
||||
* @param buffArry pointer to an allocation sufficiently sized to hold `TestFrame[chanCnt]`
|
||||
* @param frameNr the frame of the »source feed« to use commonly on all those frames in the output
|
||||
* @param flavour a further seed parameter used as starting offest for the output's `family` parameters
|
||||
* @remark this is a variation of the [dummy data generator](\ref #generateFrame),
|
||||
* which immediately generates a planar block of related frames with random data,
|
||||
* all seeded with the _same_ `frameNr` and _consecutive_ `family` parameters,
|
||||
* which will be offset commonly by adding the \a flavour parameter.
|
||||
*/
|
||||
void
|
||||
generateMultichan (TestFrame* buffArry, ChaNo chanCnt, FraNo frameNr, Flavr flavour)
|
||||
{
|
||||
REQUIRE (buffArry);
|
||||
for (uint i=0; i<chanCnt; ++i)
|
||||
new(buffArry+i) TestFrame{uint(frameNr), flavour+i};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param chanCnt size of the array of frames to clone
|
||||
* @param inArry pointer to storage holding a TestFrame[chanCnt]
|
||||
* @param outArry pointer to allocated storage sufficient to hold a clone copy of these
|
||||
*/
|
||||
void
|
||||
duplicateMultichan (TestFrame* outArry, TestFrame* inArry, ChaNo chanCnt)
|
||||
{
|
||||
REQUIRE (inArry);
|
||||
REQUIRE (outArry);
|
||||
for (uint i=0; i<chanCnt; ++i)
|
||||
new(outArry+i) TestFrame{inArry[i]};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param chanCnt size of the array of frames to manipulate
|
||||
* @param buffArry pointer to an array of several frames (channels)
|
||||
* @param param parameter to control or »mark« the data manipulation (hash-combining)
|
||||
* @remark this function in-place processing of several channels in one step: data is processed
|
||||
* in 64-bit words, by hash-chaining with \a param and then joining in the data items.
|
||||
* All data buffers will be manipulated and marked with as valid with a new checksum.
|
||||
*/
|
||||
void
|
||||
manipulateMultichan (TestFrame* buffArry, ChaNo chanCnt, Param param)
|
||||
{
|
||||
REQUIRE (buffArry);
|
||||
const uint SIZ = buffArry->data64().size();
|
||||
for (uint i=0; i<SIZ; ++i)
|
||||
{
|
||||
uint64_t feed{param};
|
||||
for (uint c=0; c<chanCnt; ++c)
|
||||
{
|
||||
auto& data = buffArry[c].data64()[i];
|
||||
lib::hash::combine(feed, data);
|
||||
data = feed;
|
||||
}
|
||||
}
|
||||
for (uint c=0; c<chanCnt; ++c)
|
||||
buffArry[c].markChecksum();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param out existing allocation to place the generated TestFrame into
|
||||
* @param in allocation holding the input TestFrame data
|
||||
* @param param parameter to control or »mark« the data manipulation (hash-combining)
|
||||
* @remark this function emulates „media data processing“: data is processed in 64-bit words,
|
||||
* by hash-chaining with \a param. The generated result is marked with a valid checksum.
|
||||
*/
|
||||
void
|
||||
manipulateFrame (TestFrame* out, TestFrame const* in, Param param)
|
||||
{
|
||||
REQUIRE (in);
|
||||
REQUIRE (out);
|
||||
auto calculate = [](uint64_t chain, uint64_t val){ lib::hash::combine(chain,val); return chain; };
|
||||
for (auto& [res,src] : zip (out->data64(), in->data64()))
|
||||
res = calculate(param, src);
|
||||
out->markChecksum();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param out existing allocation to receive the calculated result TestFrame
|
||||
* @param srcA a buffer holding the input data for feed-A
|
||||
* @param srcB a buffer holding the input data for feed-B
|
||||
* @param mix degree of mixing (by integer arithmetics): 100 means 100% feed-B
|
||||
* @remark this function emulates a mixing or overlaying operation:
|
||||
* each result byte is the linear interpolation between the corresponding inputs.
|
||||
*/
|
||||
void
|
||||
combineFrames (TestFrame* out, TestFrame const* srcA, TestFrame const* srcB, Factr mix)
|
||||
{
|
||||
REQUIRE (srcA);
|
||||
REQUIRE (srcB);
|
||||
REQUIRE (out);
|
||||
for (auto& [res,inA,inB] : zip (out->data()
|
||||
,srcA->data()
|
||||
,srcB->data()))
|
||||
res = lround((1-mix)*inA + mix*inB);
|
||||
out->markChecksum();
|
||||
}
|
||||
}//(End)namespace ont
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -60,53 +60,55 @@ namespace test {
|
|||
using Factr = double;
|
||||
using Param = uint64_t;
|
||||
|
||||
const Literal OID{"Test"}; ///< classificatory prefix for functionality provided by this „library“
|
||||
const Literal TYPE_TESTFRAME{"TestFrame"}; ///< a stream implementation type with a frame of reproducible random data
|
||||
}
|
||||
|
||||
/** a dummy value */
|
||||
extern int dummyNum;
|
||||
|
||||
/** the simplest possible function,
|
||||
* which can be bound as Render Node */
|
||||
inline void
|
||||
dummyOp (int* num_in_buff)
|
||||
{
|
||||
CHECK (num_in_buff != nullptr);
|
||||
*num_in_buff = dummyNum++;
|
||||
}
|
||||
const Literal DUMMY_NODE_ID{"Test:dummy"};
|
||||
const Literal DUMMY_PROC_ID{"op(int)"};
|
||||
|
||||
|
||||
/** produce sequences of frames with (reproducible) random data */
|
||||
void generateFrame (TestFrame* buff, FraNo frameNr =0, Flavr flavour =0);
|
||||
|
||||
/** produce planar multi channel output of random data frames */
|
||||
void generateMultichan (TestFrame* buffArry, ChaNo chanCnt, FraNo frameNr =0, Flavr flavour =0);
|
||||
|
||||
/** create an identical clone copy of the planar multi channel frame array */
|
||||
void duplicateMultichan (TestFrame* outArry, TestFrame* inArry, ChaNo chanCnt);
|
||||
|
||||
/** »process« a planar multi channel array of data frames in-place */
|
||||
void manipulateMultichan (TestFrame* buffArry, ChaNo chanCnt, Param param);
|
||||
|
||||
/** »process« random frame date by hash-chaining with a parameter */
|
||||
void manipulateFrame (TestFrame* out, TestFrame const* in, Param param);
|
||||
|
||||
/** mix two random data frames by a parameter-controlled proportion */
|
||||
void combineFrames (TestFrame* out, TestFrame const* srcA, TestFrame const* srcB, Factr mix);
|
||||
|
||||
}//(End)namespace ont
|
||||
|
||||
/** produce sequences of frames with (reproducible) random data */
|
||||
void generateFrame (TestFrame* buff, ont::FraNo frameNr =0, ont::Flavr flavour =0);
|
||||
|
||||
/** produce planar multi channel output of random data frames */
|
||||
void generateMultichan (TestFrame* buffArry, ont::ChaNo chanCnt, ont::FraNo frameNr =0, ont::Flavr flavour =0);
|
||||
|
||||
/** create an identical clone copy of the planar multi channel frame array */
|
||||
void duplicateMultichan (TestFrame* outArry, TestFrame* inArry, ont::ChaNo chanCnt);
|
||||
|
||||
/** »process« a planar multi channel array of data frames in-place */
|
||||
void manipulateMultichan (TestFrame* buffArry, ont::ChaNo chanCnt, ont::Param param);
|
||||
|
||||
/** »process« random frame date by hash-chaining with a parameter */
|
||||
void manipulateFrame (TestFrame* out, TestFrame const* in, ont::Param param);
|
||||
|
||||
/** mix two random data frames by a parameter-controlled proportion */
|
||||
void combineFrames (TestFrame* out, TestFrame const* srcA, TestFrame const* srcB, ont::Factr mix);
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Dummy / Placeholder
|
||||
using NoArg = std::array<char*, 0>;
|
||||
using SoloArg = std::array<char*, 1>;
|
||||
|
||||
extern const string DUMMY_FUN_ID;
|
||||
|
||||
/** @todo a placeholder operation to wire a prototypical render node
|
||||
*/
|
||||
inline void
|
||||
dummyOp (NoArg in, SoloArg out)
|
||||
{
|
||||
UNIMPLEMENTED ("a sincerely nonsensical operation");
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Dummy / Placeholder
|
||||
|
||||
/**
|
||||
* A fake _Domain Ontology_ to describe mocked »render operations« on
|
||||
* dummy data frames filled with random numbers.
|
||||
*
|
||||
* A fake **Domain Ontology** to describe mocked »render operations« on dummy data frames
|
||||
* filled with random numbers. It provides a _builder notation_ to configure a _processing-functor_
|
||||
* for some operations working on such data frames.
|
||||
* @see TestFrame_test
|
||||
* @see NodeDevel_test
|
||||
* @see NodeLink_test
|
||||
*
|
||||
*/
|
||||
class TestRandOntology
|
||||
{
|
||||
|
|
@ -120,21 +122,25 @@ namespace test {
|
|||
~TestRandOntology() = default;
|
||||
TestRandOntology() = default;
|
||||
|
||||
auto setupGenerator (string qual ="");
|
||||
auto setupGenerator();
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
struct TestRandOntology::Spec
|
||||
: util::Cloneable
|
||||
{
|
||||
const string PROTO;
|
||||
const string FUNC_ID;
|
||||
const string BASE_TYPE;
|
||||
|
||||
Spec (Literal kind
|
||||
,Literal type
|
||||
)
|
||||
: PROTO{_Fmt{"%s-%s"} % kind % type}
|
||||
, FUNC_ID{kind}
|
||||
, BASE_TYPE{type}
|
||||
{ }
|
||||
};
|
||||
|
|
@ -152,17 +158,9 @@ namespace test {
|
|||
, conf_{make_shared<CONF> (spec, forward<INIT> (init)...)}
|
||||
{ }
|
||||
|
||||
auto
|
||||
makeFun()
|
||||
{
|
||||
return conf_->binding();
|
||||
}
|
||||
|
||||
string
|
||||
describe()
|
||||
{
|
||||
return conf_->procSpec();
|
||||
}
|
||||
auto makeFun() { return conf_->binding(); }
|
||||
string procID() { return conf_->procSpec(); }
|
||||
string nodeID() { return string{ont::OID}+":"+FUNC_ID; }
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -200,10 +198,14 @@ namespace test {
|
|||
% streamType;
|
||||
}
|
||||
};
|
||||
}
|
||||
}//(End)namespace ont
|
||||
|
||||
|
||||
/**
|
||||
* Initiate configuration of a generator-node to produce TestFrame(s)
|
||||
*/
|
||||
inline auto
|
||||
TestRandOntology::setupGenerator (string qual)
|
||||
TestRandOntology::setupGenerator()
|
||||
{
|
||||
Spec spec{"generate", ont::TYPE_TESTFRAME};
|
||||
Builder<ont::ConfGen> builder{spec};
|
||||
|
|
|
|||
|
|
@ -88486,9 +88486,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1728657599660" ID="ID_1919244666" MODIFIED="1728657606815" TEXT="muß einfache Node bauen können"/>
|
||||
<node CREATED="1728657607703" ID="ID_1131573155" MODIFIED="1728657612430" TEXT="muß Node aufrufen können"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1729552217035" ID="ID_797574499" MODIFIED="1736104499448" TEXT="#1371 Prototyping: build and connect render nodes">
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1729552217035" ID="ID_797574499" MODIFIED="1736196658222" TEXT="#1371 Prototyping: build and connect render nodes">
|
||||
<arrowlink COLOR="#8e213e" DESTINATION="ID_495934512" ENDARROW="Default" ENDINCLINATION="548;-1633;" ID="Arrow_ID_1445467180" STARTARROW="None" STARTINCLINATION="1411;76;"/>
|
||||
<arrowlink COLOR="#b60103" DESTINATION="ID_1585637379" ENDARROW="Default" ENDINCLINATION="-1157;-58;" ID="Arrow_ID_1730193164" STARTARROW="None" STARTINCLINATION="1290;69;"/>
|
||||
<arrowlink COLOR="#3bb554" DESTINATION="ID_1585637379" ENDARROW="Default" ENDINCLINATION="-1157;-58;" ID="Arrow_ID_1730193164" STARTARROW="None" STARTINCLINATION="1290;69;"/>
|
||||
<arrowlink COLOR="#9958aa" DESTINATION="ID_1974639046" ENDARROW="Default" ENDINCLINATION="-21;-40;" ID="Arrow_ID_445633782" STARTARROW="None" STARTINCLINATION="-80;4;"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
</node>
|
||||
|
|
@ -99312,19 +99312,33 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
<font NAME="SansSerif" SIZE="9"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1728785663035" ID="ID_1585637379" MODIFIED="1728785801243" TEXT="Integration des einfachst-möglichen Builder-Terms">
|
||||
<linktarget COLOR="#b60103" DESTINATION="ID_1585637379" ENDARROW="Default" ENDINCLINATION="-1157;-58;" ID="Arrow_ID_1730193164" SOURCE="ID_797574499" STARTARROW="None" STARTINCLINATION="1290;69;"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1728785663035" ID="ID_1585637379" MODIFIED="1736196638752" TEXT="Integration des einfachst-möglichen Builder-Terms">
|
||||
<linktarget COLOR="#3bb554" DESTINATION="ID_1585637379" ENDARROW="Default" ENDINCLINATION="-1157;-58;" ID="Arrow_ID_1730193164" SOURCE="ID_797574499" STARTARROW="None" STARTINCLINATION="1290;69;"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#435e98" CREATED="1728785697448" ID="ID_1129960489" MODIFIED="1736112720413" TEXT="kein Lead ≙ Generator-Node">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1728785719979" ID="ID_1934199369" MODIFIED="1728785743179" TEXT="frei stehende Dummy-Funktion verwenden">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1728785719979" ID="ID_1934199369" MODIFIED="1736196461289" TEXT="frei stehende Dummy-Funktion verwenden">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#435e98" CREATED="1728787111148" ID="ID_1061748863" MODIFIED="1728787143959" TEXT="minimaler Node-Builder geht durch den Compiler">
|
||||
<icon BUILTIN="ksmiletris"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1736112739202" ID="ID_180885876" MODIFIED="1736112770759" TEXT="einfache Testfälle umstellen auf Test-Rand-Ontology">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
<node COLOR="#338800" CREATED="1736112739202" ID="ID_180885876" MODIFIED="1736196458725" TEXT="einfache Testfälle umstellen auf Test-Rand-Ontology">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node COLOR="#438098" CREATED="1736196470002" ID="ID_248279095" MODIFIED="1736196623851" TEXT="(vereinfacht seit Umstellung auf flexible Signatur)">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...im Grunde bräuchte es diese dummy-Funktion jetzt gar nicht mehr, da nun viel flexiblere Signaturen akzeptiert werden; zu Beginn des Prototyping hatte ich ja noch eine <i>recht spezielle Konvention</i> mit einem std::array...
|
||||
</p>
|
||||
<p>
|
||||
Ich lasse diese Dummy-Operation dennoch bestehen, vor allem, weil auch dazu passende Specs gegeben sind
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1728785768422" ID="ID_1775907930" MODIFIED="1729988421044" TEXT="Connectivity als Ergebnis bekommen">
|
||||
|
|
@ -99590,16 +99604,13 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1736187114981" ID="ID_1479776612" MODIFIED="1736187346556" TEXT="API für TestRandOntology...">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
herausfinden wie ein API für Tests sinnvollerweise aufgebaut werden kann...
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<arrowlink COLOR="#4d6e8c" DESTINATION="ID_1540586352" ENDARROW="Default" ENDINCLINATION="155;-1061;" ID="Arrow_ID_90130139" STARTARROW="None" STARTINCLINATION="452;98;"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1736187146414" ID="ID_1300905313" MODIFIED="1736187152785" TEXT="einfacher Generator">
|
||||
|
|
@ -100421,7 +100432,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
<node CREATED="1736123267726" ID="ID_1688086276" MODIFIED="1736123279589" TEXT="makeFun()">
|
||||
<node CREATED="1736123279590" ID="ID_832077741" MODIFIED="1736123287138" TEXT="wirft einen binding-Funktor ab"/>
|
||||
</node>
|
||||
<node CREATED="1736123290037" ID="ID_180963468" MODIFIED="1736123296582" TEXT="describe()">
|
||||
<node CREATED="1736123290037" ID="ID_180963468" MODIFIED="1736196401223" TEXT="procID()">
|
||||
<node CREATED="1736123298026" ID="ID_524718587" MODIFIED="1736123306581" TEXT="erzeugt einen Proc-Descriptor"/>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1736187388153" ID="ID_1709328784" MODIFIED="1736187621185" TEXT="einfachster Fall: nur ein Kanal und Output">
|
||||
<icon BUILTIN="pencil"/>
|
||||
|
|
@ -100430,6 +100441,11 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
<icon BUILTIN="hourglass"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1736196404826" ID="ID_27449611" MODIFIED="1736196412077" TEXT="nodeID()">
|
||||
<node CREATED="1736196413609" ID="ID_548158373" MODIFIED="1736196441148" TEXT="setzt sich zusammen aus ID der Ontology + »prototype« der Operation">
|
||||
<icon BUILTIN="info"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -100735,16 +100751,13 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#b6b6c8" COLOR="#435e98" CREATED="1733087500451" FOLDED="true" ID="ID_1636981616" MODIFIED="1736112929378" STYLE="fork">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
es bleibt zu klären: <b>was stellt das Turnout-System dar</b>?
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="yes"/>
|
||||
<node CREATED="1733092790016" ID="ID_213240138" MODIFIED="1736112295870">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
|
|
|
|||
Loading…
Reference in a new issue