define the next steps by test

This commit is contained in:
Fischlurch 2008-10-06 07:26:43 +02:00
parent 1724e019ea
commit 1bce7d4c38
3 changed files with 47 additions and 10 deletions

View file

@ -71,7 +71,7 @@ namespace lumiera {
Prototype const& prototype;
ImplFacade * implType;
ImplFacade * implType; /////////////TODO: really by ptr???
Usage intentionTag;
};

View file

@ -29,13 +29,15 @@
#include <iostream>
using std::cout;
using ::test::Test;
using util::isnil;
namespace lumiera {
namespace test_format {
using control::STypeManager;
typedef StreamType const& SType;
typedef StreamType::ImplFacade const& ImplType;
@ -47,13 +49,18 @@ namespace lumiera {
*/
class StreamTypeBasics_test : public Test
{
virtual void run (Arg arg)
virtual void
run (Arg arg)
{
buildImplType ();
basicImplTypeProperties ();
ImplType iType = buildImplType ();
basicImplTypeProperties (iType);
SType type = extend2fullType (iType);
basicStreamTypeProperties (type, iType);
}
void buildImplType ()
ImplType
buildImplType ()
{
STypeManager& typeManager = STypeManager::instance();
@ -64,16 +71,45 @@ namespace lumiera {
TODO ("how to do a simple consistency check on the returned ImplFacade? can we re-create the GAVL frame type?");
ASSERT (GAVL==iTy.libraryID);
return iTy;
}
void basicImplTypeProperties ()
void
basicImplTypeProperties (ImplType refType)
{
ImplType iTy = test_createImplType ();
ImplType iTy2 = test_createImplType ();
ASSERT (iTy2==refType);
ASSERT (refType==iTy2);
TODO ("add equality comparable concept to the ImplType class");
ASSERT (StreamType::VIDEO==refType.getKind());
UNIMPLEMENTED ("get a lib descriptor");
UNIMPLEMENTED ("check the lib of the type");
UNIMPLEMENTED ("compare two types");
}
SType
extend2fullType (ImplType iTy)
{
return STypeManager::instance().getType(iTy);
}
void
basicStreamTypeProperties (SType type, ImplType iTy)
{
ASSERT (type.implType);
ASSERT (iTy==(*type.implType)); /////////////TODO: really by ptr???
ASSERT (&iTy==type.implType); // actually using the same object (in the registry)
ASSERT (!isnil (type.prototype.id));
ASSERT (StreamType::VIDEO==type.prototype.kind);
ASSERT (StreamType::VIDEO==type.implType->getKind());
ASSERT (type.implType->canConvert(iTy)); // of course... they are actually the same
ASSERT (iTy.canConvert(type)); // because it's based on the same impl type
ASSERT (StreamType::RAW==type.intentionTag);
}
};
LAUNCHER (StreamTypeBasics_test, "unit common");

View file

@ -3431,7 +3431,7 @@ An implementation constraint can //stand-in// for a completely specified impleme
//Note:// there is a sort-of &quot;degraded&quot; variant just requiring some &amp;rarr; [[implementation constraint|StreamTypeImplConstraint]] to hold
</pre>
</div>
<div title="StreamTypeQuery" modifier="Ichthyostega" modified="200810020327" created="200809280129" tags="spec draft" changecount="22">
<div title="StreamTypeQuery" modifier="Ichthyostega" modified="200810060525" created="200809280129" tags="spec draft" changecount="23">
<pre>Querying for media stream type information comes in various flavours
* you may want to find a structural object (pipe, output, processing patten) associated with / able to deal with a certain stream type
* you may need a StreamTypeDescriptor for an existing stream given as implementation data
@ -3471,9 +3471,10 @@ Essentially, we need a search mechanism for impltypes and prototypes. This searc
!query for an (complete) StreamType
All situations discussed thus far can also occur wrapped into and triggered by a query for a complete type. Depending on what part is known, the missing bits will be queried.
Independent from these is another __Situation__ where we query for a type ''by ID''.
Independent from these is __another Situation__ where we query for a type ''by ID''.
* a simple symbolic ID can be found by searching through all existing stream types (Operation supported by the type registry within STypeManager)
* a special ''classificating'' ID can be parsed into the components (media kind, prototype, impltype), resulting in sub searches for these.
{{red{not sure if we want to support queries by symboic ID}}}...problem is the impl type, because probably the library needs to support describing any implementation type by a string. Seemingly GAVL does, but requiring it for every lib?
</pre>
</div>
<div title="StreamTypeUse" modifier="Ichthyostega" modified="200809280320" created="200809130312" tags="draft discuss dynamic" changecount="21">