Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
test-scopes.cpp
Go to the documentation of this file.
1/*
2 TEST-SCOPES.cpp - builds a test PlacementIndex containing dummy Placements as nested scopes
3
4 Copyright (C)
5 2009, 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
25
26
27namespace steam {
28namespace mobject {
29namespace session {
30namespace test {
31
32
37 PPIdx
39 {
40 PDum p1(*new TestSubMO21);
41 PDum p2(*new TestSubMO21);
42 PDum p3(*new TestSubMO21);
43 PDum p4(*new TestSubMO21);
44 PDum p5(*new TestSubMO21);
45
46 PDum ps1(*new DummyMO);
47 PDum ps2(*new TestSubMO2);
48 PDum ps3(*new TestSubMO1);
49
50 // Prepare an (test)Index backing the PlacementRefs
52
53 PMO& root = index->getRoot();
54
55 typedef PMO::ID ID;
56 ID i1 = index->insert (p1, root);
57 ID i2 = index->insert (p2, i1 );
58 ID i3 = index->insert (p3, i2 );
59 ID i4 = index->insert (p4, i3 );
60 index->insert (p5, i4 );
61
62 index->insert (ps1,root);
63 ID is2 =index->insert (ps2,root);
64 index->insert (ps3, is2);
65
66 return index;
67 }
68
78
79
88 {
89 return retrieve_firstElmOfType<TestSubMO1>();
90 }
91
94 {
95 return retrieve_firstElmOfType<TestSubMO21>();
96 }
97
98
105
106
107}}}} // namespace steam::mobject::session::test
iterator resolveBy(QueryResolver const &resolver) const
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition asset.hpp:98
Query a scope to discover it's contents or location.
static PPIdx install()
Re-define the implicit PlacementIndex temporarily, e.g.
Test MObject subclass, which, contrary to any real MObject, can be created directly without involving...
PlacementMO & retrieve_firstTestSubMO21()
PPIdx build_testScopes()
helper for tests: create a pseudo-session (actually just a PlacementIndex), which contains some neste...
std::shared_ptr< PlacementIndex > PPIdx
PlacementMO & retrieve_startElm()
complement to the helper: retrieve one of the dummy placements which is a Placement<> and way down in...
ScopeQuery< MObject >::iterator explore_testScope(PlacementMO const &scopeTop)
shortcut to explore the contents of a scope within the current index.
Namespace of Session and user visible high-level objects.
Definition sequence.hpp:65
@ CHILDREN
discover the immediate children
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
Specific queries to explore contents of a scope within the high-level model.
Implementation level session API: query a scope.
Implementation level session API: PlacementIndex mock for tests.
static lumiera::QueryResolver const & getResolver()
Subclass-1 is not defined "processible", thus will always be handled as DummyMO...
Subclass-2 is defined "processible", but we omit the necessary "applicable" definition in TestTool,...
Unit test helper to generate a system of nested test scopes.