WIP trying to get ahed with the problem of issuing queries
This commit is contained in:
parent
007a6e1855
commit
90e09b9fa0
6 changed files with 259 additions and 87 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 13 KiB |
|
|
@ -71,6 +71,10 @@ PLANNED "Query focus management" QueryFocus_test <<END
|
|||
END
|
||||
|
||||
|
||||
PLANNED "issuing typed queries" QueryResolver_test <<END
|
||||
END
|
||||
|
||||
|
||||
PLANNED "RebuildFixture_test" RebuildFixture_test <<END
|
||||
END
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
QueryResolver(Test) - issuing typed queries over a generic interface
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2009, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
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.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "lib/test/run.hpp"
|
||||
//#include "lib/lumitime.hpp"
|
||||
//#include "proc/mobject/placement-ref.hpp"
|
||||
//#include "proc/mobject/session/test-scopes.hpp"
|
||||
//#include "proc/mobject/placement-index.hpp"
|
||||
#include "proc/mobject/session/query-resolver.hpp"
|
||||
//#include "lib/access-casted.hpp"
|
||||
//#include "lib/variant.hpp"
|
||||
//#include "lib/meta/typelist.hpp"
|
||||
//#include "lib/util.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
|
||||
|
||||
namespace mobject {
|
||||
namespace session {
|
||||
namespace test {
|
||||
|
||||
//using util::isSameObject;
|
||||
//using lumiera::Time;
|
||||
using std::string;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
namespace { // a test query resolving facility
|
||||
|
||||
|
||||
struct TypeMatchFilter
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
* @test verify the mechanism for issuing typed queries through a generic interface,
|
||||
* without disclosing the facility actually answering those queries.
|
||||
* Results are to be retrieved through a Lumiera Forward Iterator.
|
||||
*
|
||||
* @see mobject::session::QueryResolver
|
||||
* @see mobject::session::ScopeLocate usage example
|
||||
* @see mobject::session::ContentsQuery typed query example
|
||||
* @see contents-query-test.cpp
|
||||
*/
|
||||
class QueryResolver_test : public Test
|
||||
{
|
||||
|
||||
virtual void
|
||||
run (Arg)
|
||||
{
|
||||
Iterator ii = subF2.query<TestSubMO21>();
|
||||
while (ii)
|
||||
{
|
||||
subF2.attach(*ii);
|
||||
cout << string(subF2) << endl;
|
||||
ii = subF2.query<TestSubMO21>();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/** Register this test class... */
|
||||
LAUNCHER (QueryResolver_test, "unit session");
|
||||
|
||||
|
||||
}}} // namespace mobject::session::test
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
format 58
|
||||
"ConfigQuery" // CommonLib::ConfigQuery
|
||||
revision 4
|
||||
revision 12
|
||||
modified_by 5 "hiv"
|
||||
// class settings
|
||||
//class diagram settings
|
||||
|
|
@ -450,7 +450,7 @@ ${inlines}
|
|||
end
|
||||
|
||||
classdiagram 137733 "Query Interface"
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
|
||||
draw_all_relations no hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
|
||||
size A4
|
||||
end
|
||||
|
||||
|
|
@ -473,6 +473,104 @@ ${members}};
|
|||
"
|
||||
explicit_switch_type ""
|
||||
|
||||
operation 141317 "issue"
|
||||
public explicit_return_type ""
|
||||
nparams 1
|
||||
param in name "query" type class_ref 156805 // QuerY
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
|
||||
cpp_def "${comment}${inline}${type}
|
||||
${class}::${name} ${(}${)}${const}${volatile} ${throw}${staticnl}
|
||||
{
|
||||
${body}
|
||||
}
|
||||
|
||||
"
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
class 156805 "QuerY"
|
||||
abstract visibility public stereotype "interface"
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
php_decl ""
|
||||
python_2_2 python_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
class 156933 "Result"
|
||||
visibility package
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
php_decl ""
|
||||
python_2_2 python_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
end
|
||||
|
||||
operation 140037 "isValid"
|
||||
public explicit_return_type "bool"
|
||||
nparams 1
|
||||
param in name "pos" type class_ref 156933 // Result
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
|
||||
cpp_def "${comment}${inline}${type}
|
||||
${class}::${name} ${(}${)}${const}${volatile} ${throw}${staticnl}
|
||||
{
|
||||
${body}
|
||||
}
|
||||
|
||||
"
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
operation 140165 "nextResult"
|
||||
public return_type class_ref 156933 // Result
|
||||
nparams 0
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
|
||||
cpp_def "${comment}${inline}${type}
|
||||
${class}::${name} ${(}${)}${const}${volatile} ${throw}${staticnl}
|
||||
{
|
||||
${body}
|
||||
}
|
||||
|
||||
"
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
classrelation 181765 // <dependency>
|
||||
relation 171653 -_->
|
||||
a default
|
||||
cpp default "#include in source"
|
||||
classrelation_ref 181765 // <dependency>
|
||||
b parent class_ref 156933 // Result
|
||||
end
|
||||
|
||||
classrelation 182533 // <unidirectional association>
|
||||
relation 172165 --->
|
||||
a role_name "" protected
|
||||
cpp default " ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
|
||||
"
|
||||
classrelation_ref 182533 // <unidirectional association>
|
||||
b parent class_ref 156933 // Result
|
||||
end
|
||||
end
|
||||
|
||||
class 155141 "Query"
|
||||
|
|
@ -507,45 +605,41 @@ ${inlines}
|
|||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
classrelation 183685 // <generalisation>
|
||||
relation 173317 ---|>
|
||||
a public
|
||||
cpp default "${type}"
|
||||
classrelation_ref 183685 // <generalisation>
|
||||
b parent class_ref 156933 // Result
|
||||
end
|
||||
end
|
||||
|
||||
operation 140037 "isValid"
|
||||
public explicit_return_type "bool"
|
||||
nparams 0
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
|
||||
cpp_def "${comment}${inline}${type}
|
||||
${class}::${name} ${(}${)}${const}${volatile} ${throw}${staticnl}
|
||||
{
|
||||
${body}
|
||||
}
|
||||
|
||||
"
|
||||
|
||||
|
||||
|
||||
|
||||
classrelation 181125 // <realization>
|
||||
relation 171141 -_-|>
|
||||
a public
|
||||
cpp default "${type}"
|
||||
classrelation_ref 181125 // <realization>
|
||||
b parent class_ref 156805 // QuerY
|
||||
end
|
||||
|
||||
operation 140165 "nextResult"
|
||||
public return_type class_ref 155269 // Cursor
|
||||
nparams 0
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
|
||||
cpp_def "${comment}${inline}${type}
|
||||
${class}::${name} ${(}${)}${const}${volatile} ${throw}${staticnl}
|
||||
{
|
||||
${body}
|
||||
}
|
||||
|
||||
classrelation 184837 // <unidirectional association>
|
||||
relation 174469 --->
|
||||
stereotype "type-def"
|
||||
a role_name "" protected
|
||||
cpp default " ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
|
||||
"
|
||||
|
||||
|
||||
|
||||
|
||||
classrelation_ref 184837 // <unidirectional association>
|
||||
b parent class_ref 155397 // IterAdapter
|
||||
end
|
||||
end
|
||||
|
||||
class 155397 "IterAdapter"
|
||||
visibility package
|
||||
nformals 2
|
||||
formal name "POS" type "class" explicit_default_value ""
|
||||
explicit_extends ""
|
||||
formal name "CON" type "class" explicit_default_value ""
|
||||
explicit_extends ""
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
|
|
@ -580,41 +674,8 @@ ${inlines}
|
|||
b parent class_ref 153989 // QueryResolver
|
||||
end
|
||||
|
||||
classrelation 179973 // <unidirectional association>
|
||||
relation 169989 --->
|
||||
stereotype "generate"
|
||||
a role_name "" protected
|
||||
cpp default " ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
|
||||
"
|
||||
classrelation_ref 179973 // <unidirectional association>
|
||||
b parent class_ref 155653 // ActualQuery
|
||||
end
|
||||
end
|
||||
|
||||
class 155653 "ActualQuery"
|
||||
visibility package
|
||||
nactuals 1
|
||||
actual class class_ref 155141 // Query
|
||||
rank 0 explicit_value ""
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
php_decl ""
|
||||
python_2_2 python_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
classrelation 179845 // <generalisation>
|
||||
relation 169861 ---|>
|
||||
a public
|
||||
cpp default "${type}"
|
||||
classrelation_ref 179845 // <generalisation>
|
||||
b parent class_ref 155141 // Query
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
usecaseview 128389 "query use"
|
||||
|
|
|
|||
|
|
@ -6,45 +6,56 @@ classcanvas 128005 class_ref 153989 // QueryResolver
|
|||
end
|
||||
classcanvas 128133 class_ref 155141 // Query
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
|
||||
xyz 137 195 2000
|
||||
end
|
||||
classcanvas 128261 class_ref 155269 // Cursor
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
|
||||
xyz 225 271 2004
|
||||
xyz 180 332 2000
|
||||
end
|
||||
classcanvas 128517 class_ref 155397 // IterAdapter
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
|
||||
xyz 62 298 2000
|
||||
xyz 50 241 2000
|
||||
end
|
||||
classcanvas 128645 class_ref 155525 // ResolvingFacility
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
|
||||
xyz 480 293 2000
|
||||
xyz 427 339 2000
|
||||
end
|
||||
classcanvas 129157 class_ref 155653 // ActualQuery
|
||||
classcanvas 129797 class_ref 156805 // QuerY
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
|
||||
xyz 386 431 2000
|
||||
xyz 163 150 2000
|
||||
end
|
||||
classcanvas 131077 class_ref 156933 // Result
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
|
||||
xyz 250 241 2000
|
||||
end
|
||||
classcanvas 131205 class_ref 155269 // Cursor
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
|
||||
xyz 251 378 2005
|
||||
end
|
||||
line 128389 ---+
|
||||
from ref 128261 z 1999 to ref 128133
|
||||
relationcanvas 128773 relation_ref 169733 // <realization>
|
||||
geometry VHV
|
||||
from ref 128645 z 1999 to point 526 191
|
||||
line 128901 z 1999 to point 292 191
|
||||
line 129029 z 1999 to ref 128005
|
||||
from ref 131077 z 1999 to ref 129797
|
||||
line 131845 ---+
|
||||
from ref 131205 z 1999 to ref 128133
|
||||
relationcanvas 132101 relation_ref 173317 // <generalisation>
|
||||
from ref 131205 z 1999 to ref 131077
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
end
|
||||
relationcanvas 129285 relation_ref 169861 // <generalisation>
|
||||
geometry VHV
|
||||
from ref 129157 z 1999 to point 420 350
|
||||
line 129413 z 1999 to point 168 350
|
||||
line 129541 z 1999 to ref 128133
|
||||
relationcanvas 132229 relation_ref 171141 // <realization>
|
||||
from ref 128133 z 1999 to ref 129797
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
end
|
||||
relationcanvas 129669 relation_ref 169989 // <unidirectional association>
|
||||
from ref 128645 z 1999 stereotype "<<generate>>" xyz 469 379 3000 to ref 129157
|
||||
relationcanvas 132357 relation_ref 169733 // <realization>
|
||||
geometry VHV unfixed
|
||||
from ref 128645 z 1999 to point 473 166
|
||||
line 132485 z 1999 to point 292 166
|
||||
line 132613 z 1999 to ref 128005
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
end
|
||||
relationcanvas 133125 relation_ref 174469 // <unidirectional association>
|
||||
geometry VHr
|
||||
from ref 128133 z 1999 stereotype "<<type-def>>" xyz 100 358 3000 to point 81 356
|
||||
line 133381 z 1999 to ref 128517
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
end
|
||||
preferred_whz 629 529 1
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ diagrams
|
|||
classdiagram_ref 136581 // MObjectRef
|
||||
651 533 100 4 0 38
|
||||
active classdiagram_ref 137733 // Query Interface
|
||||
688 570 100 4 0 0
|
||||
629 529 100 4 0 0
|
||||
end
|
||||
show_stereotypes
|
||||
selected
|
||||
|
|
@ -28,7 +28,10 @@ open
|
|||
classview_ref 129541 // InterfaceSystem
|
||||
classview_ref 129285 // StreamType
|
||||
class_ref 153989 // QueryResolver
|
||||
class_ref 156933 // Result
|
||||
classrelation_ref 181765 // <dependency>
|
||||
class_ref 155141 // Query
|
||||
class_ref 155525 // ResolvingFacility
|
||||
classview_ref 132229 // Custom holders
|
||||
classview_ref 128266 // SmartPointers
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue