From 89a9202c6cd3f93ef68578699dc6bddf4a811ca7 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 1 Dec 2011 23:32:34 +0100 Subject: [PATCH 01/87] cleanup: remove precompiled headers we don't need them and they even tend to increase build times due to unnecessary compound-includes at some core headers --- SConstruct | 7 --- src/lib/frameid.hpp | 1 + src/lib/maybe.hpp | 1 - src/lib/result.hpp | 1 - src/lib/simple-allocator.hpp | 1 - src/lib/test/run.hpp | 5 +- src/lib/typed-allocation-manager.hpp | 1 - src/lib/typed-counter.hpp | 1 - src/pre.hpp | 51 ------------------- src/pre_a.hpp | 48 ----------------- src/proc/asset.hpp | 4 +- src/proc/asset/db.hpp | 4 +- src/proc/asset/media.cpp | 2 +- src/proc/asset/media.hpp | 2 - src/proc/asset/meta.hpp | 2 - src/proc/asset/proc.hpp | 2 - src/proc/asset/struct.hpp | 2 - src/proc/assetmanager.hpp | 2 - src/proc/common.hpp | 1 - src/proc/control/command-closure.hpp | 1 - src/proc/control/command-def.hpp | 1 - src/proc/control/command-invocation.hpp | 1 - src/proc/control/command-mutation.hpp | 1 - src/proc/control/command-registry.hpp | 1 - src/proc/control/command-signature.hpp | 1 - src/proc/control/command.hpp | 2 +- src/proc/control/handling-pattern.hpp | 1 - src/proc/control/handling-patterns.hpp | 1 - src/proc/control/proc-dispatcher.hpp | 1 - src/proc/engine/procnode.hpp | 3 +- src/proc/mobject/mobject-ref.hpp | 1 - src/proc/mobject/mobject.hpp | 3 -- src/proc/mobject/placement-ref.hpp | 1 - src/proc/mobject/placement.hpp | 2 +- .../placement-index-query-resolver.cpp | 1 - .../placement-index-query-resolver.hpp | 1 - src/proc/mobject/session/placement-index.hpp | 1 - src/proc/state.hpp | 4 +- tests/components/proc/asset/testasset.hpp | 4 -- .../proc/control/test-dummy-commands.hpp | 1 - .../session/defs-manager-impl-test.cpp | 2 - .../mobject/session/defs-manager-test.cpp | 2 - 42 files changed, 10 insertions(+), 165 deletions(-) delete mode 100644 src/pre.hpp delete mode 100644 src/pre_a.hpp diff --git a/SConstruct b/SConstruct index 318f3f53c..038958348 100644 --- a/SConstruct +++ b/SConstruct @@ -333,13 +333,6 @@ def defineBuildTargets(env, artifacts): We use a custom function to declare a whole tree of srcfiles. """ - # use PCH to speed up building // disabled for now due to strange failures -# env['GCH'] = ( env.PrecompiledHeader('src/pre.hpp') -# + env.PrecompiledHeader('src/pre_a.hpp') -# ) - - - lLib = env.SharedLibrary('lumiera', srcSubtree(env,'src/lib'), install=True) lApp = env.SharedLibrary('lumieracommon', srcSubtree(env,'src/common'), install=True, LIBS=lLib) lBack = env.SharedLibrary('lumierabackend', srcSubtree(env,'src/backend'),install=True) diff --git a/src/lib/frameid.hpp b/src/lib/frameid.hpp index a8db83077..d8833ddb4 100644 --- a/src/lib/frameid.hpp +++ b/src/lib/frameid.hpp @@ -25,6 +25,7 @@ #define LUMIERA_FRAMEID_H +#include namespace lumiera { diff --git a/src/lib/maybe.hpp b/src/lib/maybe.hpp index 085160a92..f8e7204ff 100644 --- a/src/lib/maybe.hpp +++ b/src/lib/maybe.hpp @@ -48,7 +48,6 @@ #ifndef LIB_MAYBE_H #define LIB_MAYBE_H -//#include "pre.hpp" #include "lib/error.hpp" //#include "lib/wrapper.hpp" #include "lib/util.hpp" diff --git a/src/lib/result.hpp b/src/lib/result.hpp index 2f42c7f64..38b3ba123 100644 --- a/src/lib/result.hpp +++ b/src/lib/result.hpp @@ -40,7 +40,6 @@ #ifndef LIB_RESULT_H #define LIB_RESULT_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/wrapper.hpp" #include "lib/util.hpp" diff --git a/src/lib/simple-allocator.hpp b/src/lib/simple-allocator.hpp index b79b2081d..f36b19a30 100644 --- a/src/lib/simple-allocator.hpp +++ b/src/lib/simple-allocator.hpp @@ -46,7 +46,6 @@ #ifndef LIB_SIMPLE_ALLOCATOR_H #define LIB_SIMPLE_ALLOCATOR_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/meta/generator.hpp" #include "lib/meta/typelist-util.hpp" diff --git a/src/lib/test/run.hpp b/src/lib/test/run.hpp index b47a46e4c..bcb38e222 100644 --- a/src/lib/test/run.hpp +++ b/src/lib/test/run.hpp @@ -36,15 +36,12 @@ #ifndef TESTHELPER_RUN_H #define TESTHELPER_RUN_H -#include "pre.hpp" - - +#include "proc/common.hpp" #include "include/logging.h" #include "lib/test/suite.hpp" #include "lib/util.hpp" -#include #include diff --git a/src/lib/typed-allocation-manager.hpp b/src/lib/typed-allocation-manager.hpp index d1a04b19e..a4d8810fc 100644 --- a/src/lib/typed-allocation-manager.hpp +++ b/src/lib/typed-allocation-manager.hpp @@ -66,7 +66,6 @@ #ifndef LIB_TYPED_ALLOCATION_MANAGER_H #define LIB_TYPED_ALLOCATION_MANAGER_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/format.hpp" #include "lib/typed-counter.hpp" diff --git a/src/lib/typed-counter.hpp b/src/lib/typed-counter.hpp index f208f8cdc..8201e6eb3 100644 --- a/src/lib/typed-counter.hpp +++ b/src/lib/typed-counter.hpp @@ -56,7 +56,6 @@ #ifndef LIB_TYPED_COUNTER_H #define LIB_TYPED_COUNTER_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/sync-classlock.hpp" diff --git a/src/pre.hpp b/src/pre.hpp deleted file mode 100644 index 1170769b9..000000000 --- a/src/pre.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - PRE.hpp - precompiled header collection - - - Copyright (C) Lumiera.org - 2008, Christian Thaeter - Hermann Vosseler - - 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. - -*/ - -/** @file pre.hpp - ** Precompiled Header Collection. - ** Assortment of standard util, error handling and basic lib-boost components, - ** frequently used in conjunction. Precompiling these can speedup building - ** significantly. When used, this header should be included prior to any other - ** headers (and it needs to be compiled by gcc into a "pre.gch" file prior to - ** building the object files including this header). - ** - ** @see mobject.hpp usage example - ** @see pre_a.hpp precompiled header including Asset subsystem - */ - -#ifndef LUMIERA_PRE_HPP -#define LUMIERA_PRE_HPP - -#include -#include -#include -#include -#include -#include - -#include "proc/common.hpp" - - - -#endif /*LUMIERA_PRE_HPP*/ diff --git a/src/pre_a.hpp b/src/pre_a.hpp deleted file mode 100644 index 153fbb01a..000000000 --- a/src/pre_a.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - PRE_A.hpp - precompiled header (including assets) - - - Copyright (C) Lumiera.org - 2008, Christian Thaeter - Hermann Vosseler - - 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. - -*/ - -/** @file pre.hpp - ** Precompiled Header including Asset subsystem. - ** Assortment of standard util, error handling and basic lib-boost components, - ** together with the basic asset.hpp. - ** - ** @see pre.hpp - */ - -#ifndef LUMIERA_PRE_A_HPP -#define LUMIERA_PRE_A_HPP - - -#include -#include -#include -#include -#include -#include - -#include "proc/common.hpp" -#include "proc/asset.hpp" - - -#endif /*LUMIERA_PRE_A_HPP*/ diff --git a/src/proc/asset.hpp b/src/proc/asset.hpp index bd26b92ae..c7332560d 100644 --- a/src/proc/asset.hpp +++ b/src/proc/asset.hpp @@ -55,9 +55,9 @@ #define PROC_INTERFACE_ASSET_H -#include "proc/asset/category.hpp" -#include "include/logging.h" #include "lib/error.hpp" +#include "include/logging.h" +#include "proc/asset/category.hpp" #include "lib/p.hpp" #include diff --git a/src/proc/asset/db.hpp b/src/proc/asset/db.hpp index b2d9b073f..07455995f 100644 --- a/src/proc/asset/db.hpp +++ b/src/proc/asset/db.hpp @@ -25,11 +25,9 @@ #define ASSET_DB_H -#include "pre_a.hpp" - #include "lib/sync.hpp" -#include "proc/asset.hpp" #include "lib/error.hpp" +#include "proc/asset.hpp" #include #include diff --git a/src/proc/asset/media.cpp b/src/proc/asset/media.cpp index 7ba45d628..d76617144 100644 --- a/src/proc/asset/media.cpp +++ b/src/proc/asset/media.cpp @@ -21,8 +21,8 @@ * *****************************************************/ -#include "pre.hpp" #include "lib/error.hpp" +#include "proc/common.hpp" #include "proc/assetmanager.hpp" #include "proc/asset/media.hpp" #include "proc/asset/clip.hpp" diff --git a/src/proc/asset/media.hpp b/src/proc/asset/media.hpp index bdd37da18..9331d456f 100644 --- a/src/proc/asset/media.hpp +++ b/src/proc/asset/media.hpp @@ -35,8 +35,6 @@ #ifndef ASSET_MEDIA_H #define ASSET_MEDIA_H -#include "pre_a.hpp" - #include "proc/asset.hpp" #include "lib/factory.hpp" #include "lib/time/timevalue.hpp" diff --git a/src/proc/asset/meta.hpp b/src/proc/asset/meta.hpp index 9ac73ea4f..e633f188e 100644 --- a/src/proc/asset/meta.hpp +++ b/src/proc/asset/meta.hpp @@ -58,8 +58,6 @@ #ifndef ASSET_META_H #define ASSET_META_H -#include "pre_a.hpp" - #include "proc/asset.hpp" #include "proc/asset/entry-id.hpp" #include "lib/factory.hpp" diff --git a/src/proc/asset/proc.hpp b/src/proc/asset/proc.hpp index cced6e638..dc0e33388 100644 --- a/src/proc/asset/proc.hpp +++ b/src/proc/asset/proc.hpp @@ -35,8 +35,6 @@ #ifndef ASSET_PROC_H #define ASSET_PROC_H -#include "pre_a.hpp" - #include "proc/asset.hpp" #include "lib/factory.hpp" #include "lib/streamtype.hpp" diff --git a/src/proc/asset/struct.hpp b/src/proc/asset/struct.hpp index 4fd1b7f2b..c873304fe 100644 --- a/src/proc/asset/struct.hpp +++ b/src/proc/asset/struct.hpp @@ -57,8 +57,6 @@ #ifndef ASSET_STRUCT_H #define ASSET_STRUCT_H -#include "pre_a.hpp" - #include "proc/asset.hpp" #include "lib/query.hpp" #include "lib/factory.hpp" diff --git a/src/proc/assetmanager.hpp b/src/proc/assetmanager.hpp index d5102eeb4..3b69baa7c 100644 --- a/src/proc/assetmanager.hpp +++ b/src/proc/assetmanager.hpp @@ -38,8 +38,6 @@ #define PROC_INTERFACE_ASSETMANAGER_H -#include "pre_a.hpp" - #include "proc/asset.hpp" #include "lib/error.hpp" #include "lib/singleton.hpp" diff --git a/src/proc/common.hpp b/src/proc/common.hpp index b6f42f445..3b18c731b 100644 --- a/src/proc/common.hpp +++ b/src/proc/common.hpp @@ -30,7 +30,6 @@ ** the primary Proc-Layer namespaces ** ** @see main.cpp - ** @see pre.hpp ** */ diff --git a/src/proc/control/command-closure.hpp b/src/proc/control/command-closure.hpp index 90b29435c..eb59a1c54 100644 --- a/src/proc/control/command-closure.hpp +++ b/src/proc/control/command-closure.hpp @@ -67,7 +67,6 @@ #ifndef CONTROL_COMMAND_CLOSURE_H #define CONTROL_COMMAND_CLOSURE_H -//#include "pre.hpp" #include "lib/bool-checkable.hpp" #include "lib/meta/typelist.hpp" #include "lib/meta/function.hpp" diff --git a/src/proc/control/command-def.hpp b/src/proc/control/command-def.hpp index 07490ce0b..2f87f89d6 100644 --- a/src/proc/control/command-def.hpp +++ b/src/proc/control/command-def.hpp @@ -53,7 +53,6 @@ #ifndef CONTROL_COMMAND_DEF_H #define CONTROL_COMMAND_DEF_H -//#include "pre.hpp" #include "lib/error.hpp" #include "include/logging.h" #include "lib/symbol.hpp" diff --git a/src/proc/control/command-invocation.hpp b/src/proc/control/command-invocation.hpp index 660814098..e357fcd9f 100644 --- a/src/proc/control/command-invocation.hpp +++ b/src/proc/control/command-invocation.hpp @@ -46,7 +46,6 @@ #ifndef CONTROL_COMMAND_INVOCACTION_H #define CONTROL_COMMAND_INVOCACTION_H -//#include "pre.hpp" #include "proc/control/command.hpp" #include "proc/control/handling-pattern.hpp" #include "proc/control/argument-tuple-accept.hpp" diff --git a/src/proc/control/command-mutation.hpp b/src/proc/control/command-mutation.hpp index 9a4f2d13d..fd4df2760 100644 --- a/src/proc/control/command-mutation.hpp +++ b/src/proc/control/command-mutation.hpp @@ -45,7 +45,6 @@ #ifndef CONTROL_COMMAND_MUTATION_H #define CONTROL_COMMAND_MUTATION_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/bool-checkable.hpp" #include "proc/control/command-closure.hpp" diff --git a/src/proc/control/command-registry.hpp b/src/proc/control/command-registry.hpp index 1a94ee13f..833840528 100644 --- a/src/proc/control/command-registry.hpp +++ b/src/proc/control/command-registry.hpp @@ -57,7 +57,6 @@ #ifndef CONTROL_COMMAND_REGISTRY_H #define CONTROL_COMMAND_REGISTRY_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/singleton.hpp" #include "lib/sync.hpp" diff --git a/src/proc/control/command-signature.hpp b/src/proc/control/command-signature.hpp index 44354c300..f37f82c85 100644 --- a/src/proc/control/command-signature.hpp +++ b/src/proc/control/command-signature.hpp @@ -46,7 +46,6 @@ #ifndef CONTROL_COMMAND_SIGNATURE_H #define CONTROL_COMMAND_SIGNATURE_H -//#include "pre.hpp" #include "lib/meta/function.hpp" #include "lib/meta/typelist.hpp" #include "lib/meta/typelist-manip.hpp" diff --git a/src/proc/control/command.hpp b/src/proc/control/command.hpp index 86632febc..2ab26d0dd 100644 --- a/src/proc/control/command.hpp +++ b/src/proc/control/command.hpp @@ -52,9 +52,9 @@ #ifndef CONTROL_COMMAND_H #define CONTROL_COMMAND_H -#include "pre.hpp" #include "lib/error.hpp" #include "lib/symbol.hpp" +#include "proc/common.hpp" #include "proc/control/argument-erasure.hpp" #include "proc/control/argument-tuple-accept.hpp" #include "proc/control/handling-pattern.hpp" diff --git a/src/proc/control/handling-pattern.hpp b/src/proc/control/handling-pattern.hpp index 6cc947211..84ae17237 100644 --- a/src/proc/control/handling-pattern.hpp +++ b/src/proc/control/handling-pattern.hpp @@ -44,7 +44,6 @@ #ifndef CONTROL_HANDLING_PATTERN_H #define CONTROL_HANDLING_PATTERN_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/symbol.hpp" #include "lib/bool-checkable.hpp" diff --git a/src/proc/control/handling-patterns.hpp b/src/proc/control/handling-patterns.hpp index 19d3d7d5f..41a87fbeb 100644 --- a/src/proc/control/handling-patterns.hpp +++ b/src/proc/control/handling-patterns.hpp @@ -42,7 +42,6 @@ #ifndef CONTROL_HANDLING_PATTERNS_DEF_H #define CONTROL_HANDLING_PATTERNS_DEF_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/multifact.hpp" #include "proc/control/handling-pattern.hpp" diff --git a/src/proc/control/proc-dispatcher.hpp b/src/proc/control/proc-dispatcher.hpp index a4161aa42..e955b66c5 100644 --- a/src/proc/control/proc-dispatcher.hpp +++ b/src/proc/control/proc-dispatcher.hpp @@ -35,7 +35,6 @@ #ifndef CONTROL_PROC_DISPATCHER_H #define CONTROL_PROC_DISPATCHER_H -//#include "pre.hpp" //#include "lib/symbol.hpp" #include "proc/control/command.hpp" #include "lib/singleton.hpp" diff --git a/src/proc/engine/procnode.hpp b/src/proc/engine/procnode.hpp index 4017140c6..a5eac5bc0 100644 --- a/src/proc/engine/procnode.hpp +++ b/src/proc/engine/procnode.hpp @@ -40,8 +40,7 @@ #ifndef ENGINE_PROCNODE_H #define ENGINE_PROCNODE_H -#include "pre.hpp" - +#include "lib/error.hpp" #include "proc/common.hpp" #include "proc/state.hpp" #include "proc/asset/proc.hpp" diff --git a/src/proc/mobject/mobject-ref.hpp b/src/proc/mobject/mobject-ref.hpp index 36cbdd102..4e8adaeb6 100644 --- a/src/proc/mobject/mobject-ref.hpp +++ b/src/proc/mobject/mobject-ref.hpp @@ -59,7 +59,6 @@ #ifndef MOBJECT_MOBJECT_REF_H #define MOBJECT_MOBJECT_REF_H -//#include "pre.hpp" #include "lib/handle.hpp" #include "proc/mobject/placement.hpp" #include "proc/mobject/placement-ref.hpp" diff --git a/src/proc/mobject/mobject.hpp b/src/proc/mobject/mobject.hpp index c20bd64dd..78a98fde7 100644 --- a/src/proc/mobject/mobject.hpp +++ b/src/proc/mobject/mobject.hpp @@ -24,9 +24,6 @@ #ifndef MOBJECT_MOBJECT_H #define MOBJECT_MOBJECT_H -#include "pre.hpp" - - #include "proc/common.hpp" #include "proc/mobject/builder/buildertool.hpp" #include "proc/mobject/placement.hpp" diff --git a/src/proc/mobject/placement-ref.hpp b/src/proc/mobject/placement-ref.hpp index d5fb4fa59..338f4ae60 100644 --- a/src/proc/mobject/placement-ref.hpp +++ b/src/proc/mobject/placement-ref.hpp @@ -65,7 +65,6 @@ #ifndef MOBJECT_PLACEMENT_REF_H #define MOBJECT_PLACEMENT_REF_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/bool-checkable.hpp" #include "proc/mobject/placement.hpp" diff --git a/src/proc/mobject/placement.hpp b/src/proc/mobject/placement.hpp index 94f6b2cca..52d4bf805 100644 --- a/src/proc/mobject/placement.hpp +++ b/src/proc/mobject/placement.hpp @@ -67,7 +67,7 @@ #ifndef MOBJECT_PLACEMENT_H #define MOBJECT_PLACEMENT_H -#include "pre.hpp" +#include "lib/error.hpp" #include "lib/hash-indexed.hpp" #include "lib/time/timevalue.hpp" #include "proc/mobject/session/locatingpin.hpp" diff --git a/src/proc/mobject/session/placement-index-query-resolver.cpp b/src/proc/mobject/session/placement-index-query-resolver.cpp index ea366b6ac..35fa5ecdc 100644 --- a/src/proc/mobject/session/placement-index-query-resolver.cpp +++ b/src/proc/mobject/session/placement-index-query-resolver.cpp @@ -21,7 +21,6 @@ * *****************************************************/ -//#include "pre.hpp" #include "proc/mobject/session/placement-index-query-resolver.hpp" #include "proc/mobject/session/scope-query.hpp" #include "proc/mobject/placement.hpp" diff --git a/src/proc/mobject/session/placement-index-query-resolver.hpp b/src/proc/mobject/session/placement-index-query-resolver.hpp index 6e4ab424d..bac26d96d 100644 --- a/src/proc/mobject/session/placement-index-query-resolver.hpp +++ b/src/proc/mobject/session/placement-index-query-resolver.hpp @@ -56,7 +56,6 @@ #ifndef MOBJECT_SESSION_PLACEMENT_INDEX_QUERY_RESOLVER_H #define MOBJECT_SESSION_PLACEMENT_INDEX_QUERY_RESOLVER_H -//#include "pre.hpp" #include "proc/mobject/session/placement-index.hpp" #include "proc/mobject/session/query-resolver.hpp" #include "proc/mobject/session/scope-query.hpp" diff --git a/src/proc/mobject/session/placement-index.hpp b/src/proc/mobject/session/placement-index.hpp index 51dde737d..9dbc283ae 100644 --- a/src/proc/mobject/session/placement-index.hpp +++ b/src/proc/mobject/session/placement-index.hpp @@ -105,7 +105,6 @@ #ifndef MOBJECT_PLACEMENT_INDEX_H #define MOBJECT_PLACEMENT_INDEX_H -//#include "pre.hpp" #include "lib/util.hpp" #include "lib/error.hpp" #include "lib/itertools.hpp" diff --git a/src/proc/state.hpp b/src/proc/state.hpp index f0e863aaa..4cee7bc9a 100644 --- a/src/proc/state.hpp +++ b/src/proc/state.hpp @@ -25,9 +25,7 @@ #define PROC_INTERFACE_STATE_H -#include "pre.hpp" - -#include "proc/common.hpp" +#include "lib/error.hpp" #include "lib/frameid.hpp" #include "proc/engine/buffhandle.hpp" diff --git a/tests/components/proc/asset/testasset.hpp b/tests/components/proc/asset/testasset.hpp index 7dbcbe636..ff1044e83 100644 --- a/tests/components/proc/asset/testasset.hpp +++ b/tests/components/proc/asset/testasset.hpp @@ -25,11 +25,7 @@ #define ASSET_TESTASSET_H -#include "pre_a.hpp" - #include "proc/asset.hpp" -//#include "lib/util.hpp" - #include diff --git a/tests/components/proc/control/test-dummy-commands.hpp b/tests/components/proc/control/test-dummy-commands.hpp index 1a8bd5eb3..f6dce546d 100644 --- a/tests/components/proc/control/test-dummy-commands.hpp +++ b/tests/components/proc/control/test-dummy-commands.hpp @@ -38,7 +38,6 @@ #ifndef COMMAND_TEST_DUMMY_COMMANDS_H #define COMMAND_TEST_DUMMY_COMMANDS_H -//#include "pre.hpp" #include "lib/error.hpp" #include "lib/test/test-helper.hpp" diff --git a/tests/components/proc/mobject/session/defs-manager-impl-test.cpp b/tests/components/proc/mobject/session/defs-manager-impl-test.cpp index f3cc8d5e0..48ad7f98c 100644 --- a/tests/components/proc/mobject/session/defs-manager-impl-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-impl-test.cpp @@ -21,8 +21,6 @@ * *****************************************************/ -#include "pre_a.hpp" - #include "lib/test/run.hpp" #include "lib/util.hpp" diff --git a/tests/components/proc/mobject/session/defs-manager-test.cpp b/tests/components/proc/mobject/session/defs-manager-test.cpp index 3f9ae390e..e2d618a1b 100644 --- a/tests/components/proc/mobject/session/defs-manager-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-test.cpp @@ -21,8 +21,6 @@ * *****************************************************/ -#include "pre_a.hpp" - #include "lib/test/run.hpp" #include "lib/symbol.hpp" #include "lib/query.hpp" From eb79a00cf4adb3947529b4cdedf52450c7b10e58 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 2 Dec 2011 16:10:03 +0100 Subject: [PATCH 02/87] cleanup: rectify Proc-Layer namespaces (I) --- src/common/configrules.hpp | 16 +-- src/common/query/fake-configrules.hpp | 4 +- src/lib/element-tracker.hpp | 3 +- src/lib/meta/trait.hpp | 6 +- src/lib/p.hpp | 8 +- src/lib/wrapperptr.hpp | 18 +-- src/proc/asset.cpp | 3 +- src/proc/asset.hpp | 19 ++-- src/proc/asset/asset-format.hpp | 3 +- src/proc/asset/buildinstruct.hpp | 9 +- src/proc/asset/category.cpp | 6 +- src/proc/asset/category.hpp | 7 +- src/proc/asset/clip.cpp | 3 +- src/proc/asset/clip.hpp | 23 ++-- src/proc/asset/codec.cpp | 3 +- src/proc/asset/codec.hpp | 3 +- src/proc/asset/compoundmedia.cpp | 3 +- src/proc/asset/compoundmedia.hpp | 3 +- src/proc/asset/dataset.hpp | 12 +- src/proc/asset/db.hpp | 3 +- src/proc/asset/effect.cpp | 3 +- src/proc/asset/effect.hpp | 3 +- src/proc/asset/entry-id.hpp | 10 +- src/proc/asset/inventory.hpp | 3 +- src/proc/asset/media.cpp | 23 ++-- src/proc/asset/media.hpp | 18 +-- src/proc/asset/meta.cpp | 3 +- src/proc/asset/meta.hpp | 3 +- src/proc/asset/meta/time-grid.cpp | 3 +- src/proc/asset/meta/time-grid.hpp | 5 +- src/proc/asset/pipe.cpp | 3 +- src/proc/asset/pipe.hpp | 7 +- src/proc/asset/preview.cpp | 3 +- src/proc/asset/preview.hpp | 3 +- src/proc/asset/proc.cpp | 3 +- src/proc/asset/proc.hpp | 7 +- src/proc/asset/procpatt.cpp | 6 +- src/proc/asset/procpatt.hpp | 4 +- src/proc/asset/sequence.cpp | 3 +- src/proc/asset/sequence.hpp | 5 +- src/proc/asset/struct-factory-impl.hpp | 49 ++++---- src/proc/asset/struct-scheme.hpp | 3 +- src/proc/asset/struct.cpp | 6 +- src/proc/asset/struct.hpp | 3 +- src/proc/asset/timeline.cpp | 3 +- src/proc/asset/timeline.hpp | 6 +- src/proc/asset/typed-id.hpp | 3 +- src/proc/asset/typed-lookup.cpp | 3 +- src/proc/asset/unknown.cpp | 5 +- src/proc/asset/unknown.hpp | 5 +- src/proc/asset/viewer.cpp | 3 +- src/proc/asset/viewer.hpp | 6 +- src/proc/assetmanager.cpp | 7 +- src/proc/assetmanager.hpp | 6 +- src/proc/common.hpp | 105 +++++++++++------- src/proc/control/mediaimpllib.hpp | 2 +- src/proc/control/stypemanager.cpp | 1 - src/proc/control/stypemanager.hpp | 3 +- src/proc/control/styperegistry.hpp | 2 +- src/proc/controllerfacade.cpp | 3 +- src/proc/engine/buffer-local-key.hpp | 3 +- src/proc/engine/buffer-metadata.hpp | 3 +- src/proc/engine/buffer-provider.cpp | 3 +- src/proc/engine/buffer-provider.hpp | 3 +- src/proc/engine/buffhandle-attach.hpp | 3 +- src/proc/engine/buffhandle.hpp | 9 +- src/proc/engine/bufftable-obsolete.hpp | 3 +- src/proc/engine/bufftable.hpp | 3 +- src/proc/engine/channel-descriptor.hpp | 5 +- .../engine/diagnostic-buffer-provider.cpp | 3 +- .../engine/diagnostic-buffer-provider.hpp | 3 +- src/proc/engine/dispatcher.cpp | 3 +- src/proc/engine/dispatcher.hpp | 3 +- src/proc/engine/link.cpp | 3 +- src/proc/engine/link.hpp | 6 +- src/proc/engine/mask.cpp | 6 +- src/proc/engine/mask.hpp | 3 +- src/proc/engine/nodefactory.cpp | 3 +- src/proc/engine/nodefactory.hpp | 3 +- src/proc/engine/nodeinvocation.hpp | 3 +- src/proc/engine/nodeoperation.hpp | 1 + src/proc/engine/nodewiring-config.hpp | 1 + src/proc/engine/nodewiring-def.hpp | 3 +- src/proc/engine/nodewiring.cpp | 3 +- src/proc/engine/nodewiring.hpp | 3 +- src/proc/engine/pluginadapter.cpp | 6 +- src/proc/engine/pluginadapter.hpp | 3 +- src/proc/engine/procnode.hpp | 3 +- src/proc/engine/render-invocation.cpp | 3 +- src/proc/engine/render-invocation.hpp | 3 +- src/proc/engine/renderengine.cpp | 3 +- src/proc/engine/renderengine.hpp | 3 +- src/proc/engine/rendergraph.cpp | 3 +- src/proc/engine/rendergraph.hpp | 3 +- src/proc/engine/source.cpp | 3 +- src/proc/engine/source.hpp | 3 +- src/proc/engine/stateproxy.cpp | 3 +- src/proc/engine/stateproxy.hpp | 3 +- .../engine/tracking-heap-block-provider.cpp | 3 +- .../engine/tracking-heap-block-provider.hpp | 3 +- src/proc/engine/type-handler.hpp | 5 +- src/{common => proc}/external/libgavl.cpp | 10 +- src/{common => proc}/external/libgavl.hpp | 13 +-- src/proc/facade.cpp | 13 ++- src/proc/facade.hpp | 17 ++- .../applicable-builder-target-types.hpp | 4 +- src/proc/mobject/builder/assembler.cpp | 23 ++-- src/proc/mobject/builder/assembler.hpp | 42 ++++--- src/proc/mobject/builder/buildertool.hpp | 17 +-- src/proc/mobject/builder/common.hpp | 4 +- src/proc/mobject/builder/conmanager.cpp | 27 +++-- src/proc/mobject/builder/conmanager.hpp | 53 +++++---- .../builder/fixture-change-detector.hpp | 3 +- .../mobject/builder/model-port-registry.cpp | 5 +- .../mobject/builder/model-port-registry.hpp | 3 +- src/proc/mobject/builder/mould.hpp | 103 +++++++++-------- src/proc/mobject/builder/nodecreatortool.cpp | 76 ++++++------- src/proc/mobject/builder/nodecreatortool.hpp | 3 +- src/proc/mobject/builder/operationpoint.cpp | 6 +- src/proc/mobject/builder/operationpoint.hpp | 4 +- src/proc/mobject/builder/renderstate.hpp | 39 ++++--- .../mobject/builder/segmentation-tool.cpp | 3 +- .../mobject/builder/segmentation-tool.hpp | 3 +- src/proc/mobject/builder/segmentation.cpp | 3 +- src/proc/mobject/builder/segmentation.hpp | 3 +- src/proc/mobject/builder/toolfactory.cpp | 3 +- src/proc/mobject/builder/toolfactory.hpp | 3 +- src/proc/mobject/builder/wiringrequest.hpp | 41 ++++--- src/proc/mobject/builderfacade.cpp | 3 +- src/proc/mobject/builderfacade.hpp | 4 +- src/proc/mobject/explicitplacement.hpp | 3 +- src/proc/mobject/interpolator.cpp | 14 +-- src/proc/mobject/interpolator.hpp | 16 +-- src/proc/mobject/mobject-ref.cpp | 5 +- src/proc/mobject/mobject-ref.hpp | 15 +-- src/proc/mobject/mobject.cpp | 3 +- src/proc/mobject/mobject.hpp | 6 +- src/proc/mobject/model-port.hpp | 6 +- src/proc/mobject/output-designation.cpp | 3 +- src/proc/mobject/output-designation.hpp | 3 +- src/proc/mobject/output-mapping.hpp | 3 +- src/proc/mobject/parameter.cpp | 3 +- src/proc/mobject/parameter.hpp | 3 +- src/proc/mobject/paramprovider.cpp | 6 +- src/proc/mobject/paramprovider.hpp | 6 +- src/proc/mobject/placement-ref.hpp | 18 +-- src/proc/mobject/placement.cpp | 3 +- src/proc/mobject/placement.hpp | 3 +- src/proc/mobject/session.hpp | 7 +- src/proc/mobject/session/abstractmo.cpp | 5 +- src/proc/mobject/session/abstractmo.hpp | 9 +- src/proc/mobject/session/allocation.cpp | 33 +++--- src/proc/mobject/session/allocation.hpp | 61 +++++----- src/proc/mobject/session/auto.cpp | 33 +++--- src/proc/mobject/session/auto.hpp | 53 +++++---- src/proc/mobject/session/binding.cpp | 3 +- src/proc/mobject/session/binding.hpp | 9 +- src/proc/mobject/session/bus-mo.cpp | 3 +- src/proc/mobject/session/bus-mo.hpp | 7 +- src/proc/mobject/session/clip.cpp | 3 +- src/proc/mobject/session/clip.hpp | 9 +- src/proc/mobject/session/compoundclip.cpp | 38 ------- src/proc/mobject/session/compoundclip.hpp | 53 --------- src/proc/mobject/session/constraint.cpp | 21 ++-- src/proc/mobject/session/constraint.hpp | 33 +++--- src/proc/mobject/session/defs-manager.cpp | 7 +- src/proc/mobject/session/defs-manager.hpp | 18 +-- src/proc/mobject/session/defs-registry.hpp | 9 +- src/proc/mobject/session/effect.cpp | 33 +++--- src/proc/mobject/session/effect.hpp | 8 +- src/proc/mobject/session/element-query.hpp | 7 +- src/proc/mobject/session/fixedlocation.cpp | 62 +++++------ src/proc/mobject/session/fixedlocation.hpp | 26 ++--- src/proc/mobject/session/fixture.cpp | 11 +- src/proc/mobject/session/fixture.hpp | 9 +- src/proc/mobject/session/generator-mo.cpp | 3 +- src/proc/mobject/session/generator-mo.hpp | 7 +- src/proc/mobject/session/label.cpp | 3 +- src/proc/mobject/session/label.hpp | 7 +- .../mobject/session/lifecycle-advisor.hpp | 7 +- src/proc/mobject/session/locatingpin.cpp | 3 +- src/proc/mobject/session/locatingpin.hpp | 9 +- src/proc/mobject/session/meta.cpp | 21 ++-- src/proc/mobject/session/meta.hpp | 12 +- src/proc/mobject/session/mobjectfactory.cpp | 3 +- src/proc/mobject/session/mobjectfactory.hpp | 7 +- .../placement-index-query-resolver.cpp | 3 +- .../placement-index-query-resolver.hpp | 3 +- src/proc/mobject/session/placement-index.cpp | 3 +- src/proc/mobject/session/placement-index.hpp | 7 +- src/proc/mobject/session/plug.cpp | 21 ++-- src/proc/mobject/session/plug.hpp | 33 +++--- .../mobject/session/query-focus-stack.hpp | 3 +- src/proc/mobject/session/query-focus.cpp | 3 +- src/proc/mobject/session/query-focus.hpp | 3 +- src/proc/mobject/session/query-resolver.cpp | 3 +- src/proc/mobject/session/query-resolver.hpp | 3 +- src/proc/mobject/session/relativelocation.cpp | 41 ++++--- src/proc/mobject/session/relativelocation.hpp | 3 +- src/proc/mobject/session/root.cpp | 3 +- src/proc/mobject/session/root.hpp | 11 +- src/proc/mobject/session/scope-locator.hpp | 7 +- src/proc/mobject/session/scope-path.cpp | 3 +- src/proc/mobject/session/scope-path.hpp | 9 +- src/proc/mobject/session/scope-query.hpp | 7 +- src/proc/mobject/session/scope.cpp | 3 +- src/proc/mobject/session/scope.hpp | 7 +- src/proc/mobject/session/segment.cpp | 17 ++- src/proc/mobject/session/segment.hpp | 59 +++++----- src/proc/mobject/session/segmentation.cpp | 17 ++- src/proc/mobject/session/segmentation.hpp | 47 ++++---- .../mobject/session/sess-manager-impl.cpp | 3 +- .../mobject/session/sess-manager-impl.hpp | 3 +- src/proc/mobject/session/session-impl.cpp | 3 +- src/proc/mobject/session/session-impl.hpp | 7 +- .../session/session-interface-modules.hpp | 7 +- src/proc/mobject/session/session-query.hpp | 3 +- .../session/session-service-defaults.hpp | 3 +- .../session/session-service-explore-scope.hpp | 5 +- .../mobject/session/session-service-fetch.hpp | 3 +- .../session/session-service-mock-index.hpp | 3 +- .../session/session-service-mutate.hpp | 3 +- src/proc/mobject/session/session-services.cpp | 3 +- src/proc/mobject/session/session-services.hpp | 3 +- src/proc/mobject/session/session.cpp | 3 +- src/proc/mobject/session/simpleclip.cpp | 38 ------- src/proc/mobject/session/simpleclip.hpp | 50 --------- .../session/specific-contents-query.hpp | 3 +- src/proc/mobject/session/track.cpp | 3 +- src/proc/mobject/session/track.hpp | 29 ++--- src/proc/mobject/session/wish.cpp | 21 ++-- src/proc/mobject/session/wish.hpp | 37 +++--- src/proc/mobject/test-dummy-mobject.hpp | 3 +- src/proc/play/dummy-play-connection.cpp | 30 ++--- src/proc/play/output-director.hpp | 2 +- src/proc/play/output-slot-connection.hpp | 4 +- src/proc/play/output-slot.hpp | 4 +- src/proc/play/play-process.hpp | 2 +- src/proc/state.cpp | 3 +- src/proc/state.hpp | 9 +- src/{lib => proc}/streamtype.cpp | 7 +- src/{lib => proc}/streamtype.hpp | 8 +- .../proc/asset/asset-diagnostics.hpp | 2 +- tests/components/proc/asset/basicpipetest.cpp | 3 +- tests/components/proc/asset/testasset.hpp | 2 +- tests/components/proc/asset/testclipasset.hpp | 2 +- tests/components/proc/asset/typed-id-test.cpp | 2 +- .../proc/control/command-basic-test.cpp | 2 +- .../session/defs-manager-impl-test.cpp | 3 +- .../mobject/session/defs-manager-test.cpp | 3 +- .../session/defs-registry-impl-test.cpp | 2 +- .../lib/advice/advice-configuration-test.cpp | 2 +- tests/lib/advice/advice-multiplicity-test.cpp | 2 +- tests/lib/advice/advice-situations-test.cpp | 2 +- tests/lib/custom-shared-ptr-test.cpp | 1 - tests/lib/teststreamtypes.hpp | 2 +- 256 files changed, 1265 insertions(+), 1326 deletions(-) rename src/{common => proc}/external/libgavl.cpp (94%) rename src/{common => proc}/external/libgavl.hpp (92%) delete mode 100644 src/proc/mobject/session/compoundclip.cpp delete mode 100644 src/proc/mobject/session/compoundclip.hpp delete mode 100644 src/proc/mobject/session/simpleclip.cpp delete mode 100644 src/proc/mobject/session/simpleclip.hpp rename src/{lib => proc}/streamtype.cpp (93%) rename src/{lib => proc}/streamtype.hpp (97%) diff --git a/src/common/configrules.hpp b/src/common/configrules.hpp index 841858883..1e91d4813 100644 --- a/src/common/configrules.hpp +++ b/src/common/configrules.hpp @@ -68,7 +68,7 @@ namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? using std::string; - using lumiera::P; + using lib::P; @@ -212,13 +212,13 @@ namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? * the list of all concrete types participating in the * rule based config query system */ - typedef lumiera::typelist::Types < mobject::session::Track - , asset::Pipe - , const asset::ProcPatt - , asset::Timeline - , asset::Sequence - > ::List - InterfaceTypes; + typedef typelist::Types < proc::mobject::session::Track + , proc::asset::Pipe + , const proc::asset::ProcPatt + , proc::asset::Timeline + , proc::asset::Sequence + > ::List + InterfaceTypes; /** * user-visible Interface to the ConfigRules subsystem. diff --git a/src/common/query/fake-configrules.hpp b/src/common/query/fake-configrules.hpp index bbc9f91ca..2a527e63c 100644 --- a/src/common/query/fake-configrules.hpp +++ b/src/common/query/fake-configrules.hpp @@ -54,10 +54,12 @@ namespace lumiera { namespace query { + namespace asset = proc::asset; + using asset::Pipe; using asset::ProcPatt; using asset::PProcPatt; - using mobject::Session; + using proc::mobject::Session; using util::isnil; diff --git a/src/lib/element-tracker.hpp b/src/lib/element-tracker.hpp index d7d6c1794..117f1855a 100644 --- a/src/lib/element-tracker.hpp +++ b/src/lib/element-tracker.hpp @@ -66,7 +66,6 @@ namespace lib { - using lumiera::P; using util::isSameObject; /** @@ -189,7 +188,7 @@ namespace lib { } - typedef lumiera::P PTarget; + typedef P PTarget; /** factory for creating smart-ptr managed * TAR instances, automatically registered diff --git a/src/lib/meta/trait.hpp b/src/lib/meta/trait.hpp index ee77db289..0f25822fb 100644 --- a/src/lib/meta/trait.hpp +++ b/src/lib/meta/trait.hpp @@ -45,7 +45,7 @@ namespace tr1 { template class reference_wrapper; template class shared_ptr; }} -namespace lumiera{ +namespace lib{ template class P; } namespace mobject{ @@ -127,12 +127,12 @@ namespace meta { }; template - struct Unwrap > + struct Unwrap > { typedef X Type; static X& - extract (lumiera::P ptr) + extract (P ptr) { ASSERT (ptr); return *ptr; diff --git a/src/lib/p.hpp b/src/lib/p.hpp index cd7ccd776..51979aa5d 100644 --- a/src/lib/p.hpp +++ b/src/lib/p.hpp @@ -46,15 +46,15 @@ */ -#ifndef LUMIERA_P_H -#define LUMIERA_P_H +#ifndef LIB_P_H +#define LIB_P_H #include "lib/error.hpp" #include -namespace lumiera { +namespace lib { using std::tr1::shared_ptr; using std::tr1::weak_ptr; @@ -125,5 +125,5 @@ namespace lumiera { }; -} // namespace lumiera +} // namespace lib #endif diff --git a/src/lib/wrapperptr.hpp b/src/lib/wrapperptr.hpp index 16a20a2f2..5ee48f544 100644 --- a/src/lib/wrapperptr.hpp +++ b/src/lib/wrapperptr.hpp @@ -34,16 +34,20 @@ #include "lib/p.hpp" -namespace asset { class Asset; } -namespace mobject { class MObject; } +namespace proc { + namespace asset { class Asset; } + namespace mobject { class MObject; } + + + typedef ::lumiera::typelist::Types < mobject::Placement* + , lib::P* + > ::List + WrapperTypes; +} namespace lumiera { - typedef typelist::Types < mobject::Placement* - , P* - > ::List - WrapperTypes; /** * helper to treat various sorts of smart-ptrs uniformly. @@ -55,7 +59,7 @@ namespace lumiera { * error reporting is similar to the behaviour of dynamic_cast: when retrieving * a pointer, NULL is returned in case of mismatch. */ - typedef lib::Variant WrapperPtr; + typedef lib::Variant WrapperPtr; diff --git a/src/proc/asset.cpp b/src/proc/asset.cpp index 0f8560ad1..531566b63 100644 --- a/src/proc/asset.cpp +++ b/src/proc/asset.cpp @@ -43,6 +43,7 @@ using util::isnil; using util::cStr; +namespace proc { namespace asset { using ::NOBUG_FLAG(memory); @@ -198,4 +199,4 @@ namespace asset { } -} // namespace asset +}} // namespace proc::asset diff --git a/src/proc/asset.hpp b/src/proc/asset.hpp index c7332560d..f40721b6d 100644 --- a/src/proc/asset.hpp +++ b/src/proc/asset.hpp @@ -75,16 +75,17 @@ using std::vector; using std::set; - +namespace proc { namespace asset { + namespace error = lumiera::error; + using std::size_t; using std::tr1::shared_ptr; using std::tr1::static_pointer_cast; - using lumiera::P; + using lib::P; - //NOBUG_DECLARE_FLAG (assetmem); typedef size_t HashVal; /////////////////TICKET #722 @@ -358,17 +359,17 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset namespace proc_interface { - using asset::Asset; - using asset::Category; - using asset::ID; - using asset::IDA; - using asset::PAsset; + using proc::asset::Asset; + using proc::asset::Category; + using proc::asset::ID; + using proc::asset::IDA; + using proc::asset::PAsset; } #endif diff --git a/src/proc/asset/asset-format.hpp b/src/proc/asset/asset-format.hpp index 8ee6c71ce..ec3ffd5b3 100644 --- a/src/proc/asset/asset-format.hpp +++ b/src/proc/asset/asset-format.hpp @@ -31,6 +31,7 @@ +namespace proc { namespace asset { @@ -49,5 +50,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/buildinstruct.hpp b/src/proc/asset/buildinstruct.hpp index 715e40954..1408037c2 100644 --- a/src/proc/asset/buildinstruct.hpp +++ b/src/proc/asset/buildinstruct.hpp @@ -28,8 +28,8 @@ */ -#ifndef ASSET_BUILDINSTRUCT_H -#define ASSET_BUILDINSTRUCT_H +#ifndef PROC_ASSET_BUILDINSTRUCT_H +#define PROC_ASSET_BUILDINSTRUCT_H #include "lib/symbol.hpp" @@ -41,9 +41,10 @@ using std::string; +namespace proc { namespace asset { - using lumiera::P; + using lib::P; using lib::Symbol; using lib::Literal; @@ -127,5 +128,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/category.cpp b/src/proc/asset/category.cpp index 8e98a68dd..5016384d3 100644 --- a/src/proc/asset/category.cpp +++ b/src/proc/asset/category.cpp @@ -30,8 +30,8 @@ using boost::algorithm::starts_with; using util::isnil; -namespace asset - { +namespace proc { +namespace asset { /** human readable representation of the asset::Category. * @todo to be localized. @@ -69,4 +69,4 @@ namespace asset } -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/category.hpp b/src/proc/asset/category.hpp index b7c8df2f2..b0da8e796 100644 --- a/src/proc/asset/category.hpp +++ b/src/proc/asset/category.hpp @@ -21,8 +21,8 @@ */ -#ifndef ASSET_CATEGORY_H -#define ASSET_CATEGORY_H +#ifndef PROC_ASSET_CATEGORY_H +#define PROC_ASSET_CATEGORY_H #include "lib/symbol.hpp" @@ -31,6 +31,7 @@ +namespace proc { namespace asset { using lib::Literal; @@ -111,5 +112,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/clip.cpp b/src/proc/asset/clip.cpp index aa651de74..52d735259 100644 --- a/src/proc/asset/clip.cpp +++ b/src/proc/asset/clip.cpp @@ -27,6 +27,7 @@ using std::tr1::static_pointer_cast; +namespace proc { namespace asset { namespace { @@ -105,4 +106,4 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset diff --git a/src/proc/asset/clip.hpp b/src/proc/asset/clip.hpp index d3b1a3aaa..a73d4f4be 100644 --- a/src/proc/asset/clip.hpp +++ b/src/proc/asset/clip.hpp @@ -30,8 +30,9 @@ /////////////////////////TODO: 1/2010 very likely the handling of the clip-asset needs to be rewritten -namespace asset - { +namespace proc { +namespace asset { + /** * bookkeeping (Asset) view of a media clip. */ @@ -52,14 +53,14 @@ namespace asset virtual PClip getClipAsset (); virtual PMedia checkCompound (); - + }; - - typedef P PClipAsset; - - const string CLIP_SUBFOLDER = "clips"; // TODO: handling of hard-wired constants.... - - - -} // namespace asset + + typedef P PClipAsset; + + const string CLIP_SUBFOLDER = "clips"; // TODO: handling of hard-wired constants.... + + + +}} // namespace proc:asset #endif diff --git a/src/proc/asset/codec.cpp b/src/proc/asset/codec.cpp index 8810ea0da..08fd63713 100644 --- a/src/proc/asset/codec.cpp +++ b/src/proc/asset/codec.cpp @@ -23,8 +23,9 @@ #include "proc/asset/codec.hpp" +namespace proc { namespace asset { -} // namespace asset +}} // namespace proc::asset diff --git a/src/proc/asset/codec.hpp b/src/proc/asset/codec.hpp index b7d7e5e34..093470859 100644 --- a/src/proc/asset/codec.hpp +++ b/src/proc/asset/codec.hpp @@ -28,6 +28,7 @@ +namespace proc { namespace asset { /** @@ -40,5 +41,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/compoundmedia.cpp b/src/proc/asset/compoundmedia.cpp index e77416247..115ce7708 100644 --- a/src/proc/asset/compoundmedia.cpp +++ b/src/proc/asset/compoundmedia.cpp @@ -23,6 +23,7 @@ #include "proc/asset/compoundmedia.hpp" +namespace proc { namespace asset { @@ -30,4 +31,4 @@ namespace asset -} // namespace asset + }} // namespace proc::asset diff --git a/src/proc/asset/compoundmedia.hpp b/src/proc/asset/compoundmedia.hpp index 22fdb6922..c73c2c7d9 100644 --- a/src/proc/asset/compoundmedia.hpp +++ b/src/proc/asset/compoundmedia.hpp @@ -32,6 +32,7 @@ using std::vector; +namespace proc { namespace asset { @@ -49,5 +50,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/dataset.hpp b/src/proc/asset/dataset.hpp index e488302c2..15d6f633c 100644 --- a/src/proc/asset/dataset.hpp +++ b/src/proc/asset/dataset.hpp @@ -28,15 +28,15 @@ -namespace asset - { - - +namespace proc { +namespace asset { + + /** * meta asset describing a collection of control data */ class Dataset : public Meta {}; - -} // namespace asset + +}} // namespace proc::asset #endif diff --git a/src/proc/asset/db.hpp b/src/proc/asset/db.hpp index 07455995f..bfe99a029 100644 --- a/src/proc/asset/db.hpp +++ b/src/proc/asset/db.hpp @@ -35,6 +35,7 @@ #include +namespace proc { namespace asset { using std::tr1::static_pointer_cast; @@ -167,5 +168,5 @@ namespace asset { }; -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/effect.cpp b/src/proc/asset/effect.cpp index 999b5c118..4230177c3 100644 --- a/src/proc/asset/effect.cpp +++ b/src/proc/asset/effect.cpp @@ -23,6 +23,7 @@ #include "proc/asset/effect.hpp" +namespace proc { namespace asset { Proc::ProcFunc* @@ -33,4 +34,4 @@ namespace asset { -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/effect.hpp b/src/proc/asset/effect.hpp index e2e8c3fd4..fa9eed8fa 100644 --- a/src/proc/asset/effect.hpp +++ b/src/proc/asset/effect.hpp @@ -28,6 +28,7 @@ +namespace proc { namespace asset { /** @@ -50,5 +51,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/entry-id.hpp b/src/proc/asset/entry-id.hpp index c8b6849ac..7667c8ec6 100644 --- a/src/proc/asset/entry-id.hpp +++ b/src/proc/asset/entry-id.hpp @@ -54,12 +54,12 @@ #include +namespace proc { namespace asset { using std::string; using std::ostream; - using lumiera::error::LUMIERA_ERROR_WRONG_TYPE; namespace idi { @@ -233,9 +233,9 @@ namespace asset { recast (BareEntryID const& bID) { if (!canRecast(bID)) - throw lumiera::error::Logic ("unable to recast EntryID: desired type " - "doesn't match original definition" - , LUMIERA_ERROR_WRONG_TYPE); + throw error::Logic ("unable to recast EntryID: desired type " + "doesn't match original definition" + , error::LUMIERA_ERROR_WRONG_TYPE); return EntryID (bID.getSym()); } @@ -278,5 +278,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/inventory.hpp b/src/proc/asset/inventory.hpp index 2853e2697..6858aeeb0 100644 --- a/src/proc/asset/inventory.hpp +++ b/src/proc/asset/inventory.hpp @@ -28,6 +28,7 @@ +namespace proc { namespace asset { @@ -43,5 +44,5 @@ namespace asset { typedef lumiera::P PInv; -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/media.cpp b/src/proc/asset/media.cpp index d76617144..a80628159 100644 --- a/src/proc/asset/media.cpp +++ b/src/proc/asset/media.cpp @@ -52,6 +52,7 @@ using std::tr1::dynamic_pointer_cast; namespace error = lumiera::error; +namespace proc { namespace asset { namespace { // Implementation details @@ -229,18 +230,18 @@ namespace asset { * @throw Invalid if the given media asset is not top-level, * but rather part or a multichannel (compound) media */ - P - MediaFactory::operator() (asset::Media& mediaref) throw(lumiera::error::Invalid) + P + MediaFactory::operator() (Media& mediaref) { if (mediaref.checkCompound()) - throw lumiera::error::Invalid (str(format("Attempt to create a asset::Clip from the media %s, " - "which is not toplevel but rather part or a compound " - "(multichannel) media. Found parent Media %s.") - % string(mediaref) - % string(*mediaref.checkCompound())) - ,LUMIERA_ERROR_PART_OF_COMPOUND - ); - asset::Clip* pC = new asset::Clip (mediaref); + throw error::Invalid (str(format("Attempt to create a asset::Clip from the media %s, " + "which is not toplevel but rather part or a compound " + "(multichannel) media. Found parent Media %s.") + % string(mediaref) + % string(*mediaref.checkCompound())) + ,LUMIERA_ERROR_PART_OF_COMPOUND + ); + Clip* pC = new Clip (mediaref); return AssetManager::instance().wrap (*pC); } @@ -249,4 +250,4 @@ namespace asset { -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/media.hpp b/src/proc/asset/media.hpp index 9331d456f..3d3c0546c 100644 --- a/src/proc/asset/media.hpp +++ b/src/proc/asset/media.hpp @@ -43,6 +43,7 @@ +namespace proc { namespace asset { class Clip; @@ -50,7 +51,6 @@ namespace asset { class MediaFactory; class ProcPatt; - using lumiera::P; using lib::time::Duration; @@ -74,9 +74,9 @@ namespace asset { public: typedef P PMedia; - typedef P PClip; - typedef P PProcPatt; - typedef mobject::session::PClipMO PClipMO; + typedef P PClip; + typedef P PProcPatt; + typedef proc::mobject::session::PClipMO PClipMO; static MediaFactory create; @@ -121,7 +121,7 @@ namespace asset { * @return pointer to parent, or \code null */ virtual PMedia checkCompound () const; - friend class asset::Clip; ////////////////////////TODO better interface!!! + friend class proc::asset::Clip; ////////////////////////TODO better interface!!! }; @@ -141,7 +141,7 @@ namespace asset { class MediaFactory : public lib::Factory { public: - typedef P PType; + typedef P PType; PType operator() (Asset::Ident& key, const string& file=""); PType operator() (const string& file, const Category& cat); @@ -151,8 +151,8 @@ namespace asset { PType operator() (const char* file, const Category& cat); PType operator() (const char* file, asset::Kind); - P - operator() (asset::Media& mediaref) throw(lumiera::error::Invalid); + P + operator() (Media& mediaref); }; @@ -161,5 +161,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/meta.cpp b/src/proc/asset/meta.cpp index 3e5e15e99..75ff42c6f 100644 --- a/src/proc/asset/meta.cpp +++ b/src/proc/asset/meta.cpp @@ -26,6 +26,7 @@ #include "lib/util.hpp" +namespace proc { namespace asset { using meta::Descriptor; @@ -104,4 +105,4 @@ namespace asset { template Builder MetaFactory::operator() (Descriptor const&, EntryID); -} // namespace asset +}} // namespace proc::asset diff --git a/src/proc/asset/meta.hpp b/src/proc/asset/meta.hpp index e633f188e..8b6ffb7d1 100644 --- a/src/proc/asset/meta.hpp +++ b/src/proc/asset/meta.hpp @@ -64,6 +64,7 @@ +namespace proc { namespace asset { class Meta; @@ -160,5 +161,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/meta/time-grid.cpp b/src/proc/asset/meta/time-grid.cpp index 767daa41c..d37b77866 100644 --- a/src/proc/asset/meta/time-grid.cpp +++ b/src/proc/asset/meta/time-grid.cpp @@ -41,6 +41,7 @@ using boost::str; using std::string; +namespace proc { namespace asset { namespace meta { @@ -170,4 +171,4 @@ namespace meta { } -}} // namespace asset::meta +}}} // namespace asset::meta diff --git a/src/proc/asset/meta/time-grid.hpp b/src/proc/asset/meta/time-grid.hpp index 5b1f0486b..5dd754865 100644 --- a/src/proc/asset/meta/time-grid.hpp +++ b/src/proc/asset/meta/time-grid.hpp @@ -54,6 +54,7 @@ +namespace proc { namespace asset { namespace meta { @@ -66,7 +67,7 @@ namespace meta { class TimeGrid; - typedef lumiera::P PGrid; + typedef P PGrid; /** @@ -131,5 +132,5 @@ namespace meta { }; -}} // namespace asset::meta +}}} // namespace proc::asset::meta #endif diff --git a/src/proc/asset/pipe.cpp b/src/proc/asset/pipe.cpp index 4a766cb36..5104b0415 100644 --- a/src/proc/asset/pipe.cpp +++ b/src/proc/asset/pipe.cpp @@ -27,6 +27,7 @@ using util::isnil; +namespace proc { namespace asset { @@ -83,4 +84,4 @@ namespace asset { -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/pipe.hpp b/src/proc/asset/pipe.hpp index c3e070206..1e91e1965 100644 --- a/src/proc/asset/pipe.hpp +++ b/src/proc/asset/pipe.hpp @@ -26,16 +26,15 @@ #include "proc/asset/struct.hpp" #include "proc/asset/procpatt.hpp" -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" #include +namespace proc { namespace asset { - using lumiera::P; - using lumiera::StreamType; using std::string; class Pipe; @@ -125,5 +124,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/preview.cpp b/src/proc/asset/preview.cpp index d14d54a77..c27879f02 100644 --- a/src/proc/asset/preview.cpp +++ b/src/proc/asset/preview.cpp @@ -23,6 +23,7 @@ #include "proc/asset/preview.hpp" +namespace proc { namespace asset { @@ -64,4 +65,4 @@ namespace asset { -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/preview.hpp b/src/proc/asset/preview.hpp index 27bacd1b2..f576e1de2 100644 --- a/src/proc/asset/preview.hpp +++ b/src/proc/asset/preview.hpp @@ -28,6 +28,7 @@ +namespace proc { namespace asset { /** @@ -43,5 +44,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/proc.cpp b/src/proc/asset/proc.cpp index 8b6ecb178..54bbde451 100644 --- a/src/proc/asset/proc.cpp +++ b/src/proc/asset/proc.cpp @@ -27,6 +27,7 @@ #include "include/logging.h" +namespace proc { namespace asset { @@ -47,4 +48,4 @@ namespace asset { -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/proc.hpp b/src/proc/asset/proc.hpp index dc0e33388..0f424aece 100644 --- a/src/proc/asset/proc.hpp +++ b/src/proc/asset/proc.hpp @@ -37,10 +37,11 @@ #include "proc/asset.hpp" #include "lib/factory.hpp" -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" +namespace proc { namespace asset { @@ -75,7 +76,7 @@ namespace asset { return static_cast& > (Asset::getID()); } - typedef lumiera::StreamType::ImplFacade::DataBuffer Buff; + typedef StreamType::ImplFacade::DataBuffer Buff; typedef Buff* PBuff; typedef void (ProcFunc) (PBuff); @@ -124,5 +125,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/procpatt.cpp b/src/proc/asset/procpatt.cpp index 8399f6ccb..37de98de3 100644 --- a/src/proc/asset/procpatt.cpp +++ b/src/proc/asset/procpatt.cpp @@ -29,8 +29,8 @@ using util::isnil; -namespace asset - { +namespace proc { +namespace asset { /** new processing pattern with empty instruction list. @@ -117,4 +117,4 @@ namespace asset -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/procpatt.hpp b/src/proc/asset/procpatt.hpp index ff714617d..4d981e1d4 100644 --- a/src/proc/asset/procpatt.hpp +++ b/src/proc/asset/procpatt.hpp @@ -33,9 +33,9 @@ using std::vector; +namespace proc { namespace asset { - using lumiera::P; using lib::Symbol; class Proc; @@ -73,5 +73,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/sequence.cpp b/src/proc/asset/sequence.cpp index a84e2fd3b..8991fb864 100644 --- a/src/proc/asset/sequence.cpp +++ b/src/proc/asset/sequence.cpp @@ -27,6 +27,7 @@ //#include "proc/mobject/placement.hpp" //#include "proc/mobject/session/mobjectfactory.hpp" +namespace proc { namespace asset { using lib::AutoRegistered; @@ -62,4 +63,4 @@ namespace asset { -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/sequence.hpp b/src/proc/asset/sequence.hpp index 91d851d59..d681270e5 100644 --- a/src/proc/asset/sequence.hpp +++ b/src/proc/asset/sequence.hpp @@ -62,6 +62,7 @@ //using std::vector; //using std::string; +namespace proc { namespace mobject { namespace session { @@ -74,7 +75,7 @@ namespace asset { class Sequence; - typedef lumiera::P PSequence; + typedef P PSequence; @@ -104,5 +105,5 @@ namespace asset { ///////////////////////////TODO currently just fleshing the API -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/struct-factory-impl.hpp b/src/proc/asset/struct-factory-impl.hpp index 78986ea74..392cbfed3 100644 --- a/src/proc/asset/struct-factory-impl.hpp +++ b/src/proc/asset/struct-factory-impl.hpp @@ -58,26 +58,29 @@ #include #include -using boost::format; -using mobject::Session; -using mobject::MObject; -using mobject::session::Scope; -using mobject::session::match_specificTrack; -using mobject::session::RBinding; -using mobject::session::RTrack; - -using lib::Symbol; -using util::isnil; -using util::contains; -using asset::Query; -using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY; -using lumiera::query::extractID; +namespace proc { namespace asset { + using boost::format; + + using lib::Symbol; + using util::isnil; + using util::contains; + using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY; + using lumiera::query::extractID; + + using proc::mobject::Session; + using proc::mobject::MObject; + using proc::mobject::session::Scope; + using proc::mobject::session::match_specificTrack; + using proc::mobject::session::RBinding; + using proc::mobject::session::RTrack; + using idi::StructTraits; + namespace { Symbol genericIdSymbol ("id"); @@ -107,7 +110,7 @@ namespace asset { */ template const Asset::Ident - createIdent (const Query& query) + createIdent (Query const& query) { // does the query somehow specify the desired name-ID? string nameID = extractID (genericIdSymbol, query); @@ -173,10 +176,10 @@ namespace asset { * @todo a real implementation using a resolution engine. */ template - STRU* fabricate (const Query& caps) + STRU* fabricate (Query const& caps) { - throw lumiera::error::Config ( str(format("The following Query could not be resolved: %s.") % caps.asKey()) - , LUMIERA_ERROR_CAPABILITY_QUERY ); + throw error::Config ( str(format("The following Query could not be resolved: %s.") % caps.asKey()) + , LUMIERA_ERROR_CAPABILITY_QUERY ); } }; @@ -186,7 +189,7 @@ namespace asset { template<> inline const ProcPatt* - StructFactoryImpl::fabricate (const Query& caps) + StructFactoryImpl::fabricate (Query const& caps) { TODO ("actually extract properties/capabilities from the query..."); return new ProcPatt (createIdent (caps)); @@ -194,7 +197,7 @@ namespace asset { template<> inline Pipe* - StructFactoryImpl::fabricate (const Query& caps) + StructFactoryImpl::fabricate (Query const& caps) { const Asset::Ident idi (createIdent (caps)); string streamID = extractID ("stream", caps); @@ -208,7 +211,7 @@ namespace asset { template<> inline Timeline* - StructFactoryImpl::fabricate (const Query& caps) + StructFactoryImpl::fabricate (Query const& caps) { TODO ("extract additional properties/capabilities from the query..."); const Asset::Ident idi (createIdent (caps)); @@ -225,7 +228,7 @@ namespace asset { template<> inline Sequence* - StructFactoryImpl::fabricate (const Query& caps) + StructFactoryImpl::fabricate (Query const& caps) { // when we reach this point it is clear a suitable sequence doesn't yet exist in the model TODO ("actually extract properties/capabilities from the query..."); @@ -244,5 +247,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/struct-scheme.hpp b/src/proc/asset/struct-scheme.hpp index e0f7af463..d0354833a 100644 --- a/src/proc/asset/struct-scheme.hpp +++ b/src/proc/asset/struct-scheme.hpp @@ -45,6 +45,7 @@ using boost::format; +namespace proc { namespace mobject { namespace session { @@ -166,5 +167,5 @@ namespace asset{ } -}} // namespace asset::idi +}}} // namespace asset::idi #endif diff --git a/src/proc/asset/struct.cpp b/src/proc/asset/struct.cpp index 83083c53c..032920ec8 100644 --- a/src/proc/asset/struct.cpp +++ b/src/proc/asset/struct.cpp @@ -43,6 +43,7 @@ using lumiera::ConfigRules; using util::contains; +namespace proc { namespace asset { /****** NOTE: not fully implemented yet. What follows is partially a hack to build simple tests *******/ @@ -154,7 +155,7 @@ namespace asset { -} // namespace asset +}} // namespace asset @@ -169,6 +170,7 @@ namespace asset { #include "proc/asset/sequence.hpp" +namespace proc { namespace asset { template P StructFactory::operator() (Query const&); @@ -186,4 +188,4 @@ namespace asset { template PTimeline StructFactory::made4fake (Query const&); template PSequence StructFactory::made4fake (Queryconst&); -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/struct.hpp b/src/proc/asset/struct.hpp index c873304fe..773ddf2c8 100644 --- a/src/proc/asset/struct.hpp +++ b/src/proc/asset/struct.hpp @@ -68,6 +68,7 @@ +namespace proc { namespace asset { using std::string; @@ -161,5 +162,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/timeline.cpp b/src/proc/asset/timeline.cpp index bb2f9e36e..2b4bfdc3f 100644 --- a/src/proc/asset/timeline.cpp +++ b/src/proc/asset/timeline.cpp @@ -29,6 +29,7 @@ #include "proc/assetmanager.hpp" +namespace proc { namespace asset { using lib::AutoRegistered; @@ -69,4 +70,4 @@ namespace asset { -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/timeline.hpp b/src/proc/asset/timeline.hpp index 7bf168e1e..42ec739c0 100644 --- a/src/proc/asset/timeline.hpp +++ b/src/proc/asset/timeline.hpp @@ -67,6 +67,7 @@ //using std::vector; //using std::string; +namespace proc { namespace mobject { namespace session { @@ -78,9 +79,8 @@ namespace session { namespace asset { -// using lumiera::P; class Timeline; - typedef lumiera::P PTimeline; + typedef P PTimeline; /** @@ -111,5 +111,5 @@ namespace asset { ///////////////////////////TODO currently just fleshing the API -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/typed-id.hpp b/src/proc/asset/typed-id.hpp index a7edcc732..99f625ff3 100644 --- a/src/proc/asset/typed-id.hpp +++ b/src/proc/asset/typed-id.hpp @@ -75,6 +75,7 @@ namespace query { }} +namespace proc { namespace asset { // using std::string; @@ -132,5 +133,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/typed-lookup.cpp b/src/proc/asset/typed-lookup.cpp index a7d9c3368..942090b04 100644 --- a/src/proc/asset/typed-lookup.cpp +++ b/src/proc/asset/typed-lookup.cpp @@ -24,6 +24,7 @@ #include "proc/asset/typed-id.hpp" +namespace proc { namespace asset { LUMIERA_ERROR_DEFINE (MISSING_INSTANCE, "Existing ID registration without associated instance"); @@ -33,4 +34,4 @@ namespace asset { -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/unknown.cpp b/src/proc/asset/unknown.cpp index f8d3b81f1..2e4e1df68 100644 --- a/src/proc/asset/unknown.cpp +++ b/src/proc/asset/unknown.cpp @@ -27,6 +27,7 @@ using boost::format; +namespace proc { namespace asset { LUMIERA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media referred by placeholder not found"); @@ -49,7 +50,7 @@ namespace asset { * try to access the "real" media it stands for. */ Media::PMedia - Unknown::getOrg() throw(lumiera::error::Invalid) + Unknown::getOrg() { UNIMPLEMENTED ("how to get at the original media from a »Unknown« placeholder"); if (1==0) @@ -63,4 +64,4 @@ namespace asset { -} // namespace asset +}} // namespace asset diff --git a/src/proc/asset/unknown.hpp b/src/proc/asset/unknown.hpp index 31f3df6b0..54f234c71 100644 --- a/src/proc/asset/unknown.hpp +++ b/src/proc/asset/unknown.hpp @@ -29,6 +29,7 @@ +namespace proc { namespace asset { using lib::time::FSecs; @@ -49,7 +50,7 @@ namespace asset { friend class MediaFactory; public: - virtual Media::PMedia getOrg() throw(lumiera::error::Invalid); + virtual Media::PMedia getOrg(); }; @@ -58,5 +59,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/asset/viewer.cpp b/src/proc/asset/viewer.cpp index bd1db8cbf..12e660e67 100644 --- a/src/proc/asset/viewer.cpp +++ b/src/proc/asset/viewer.cpp @@ -29,6 +29,7 @@ //#include "proc/assetmanager.hpp" +namespace proc { namespace asset { // using lib::AutoRegistered; @@ -67,4 +68,4 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset diff --git a/src/proc/asset/viewer.hpp b/src/proc/asset/viewer.hpp index a70c322f2..618e29aa5 100644 --- a/src/proc/asset/viewer.hpp +++ b/src/proc/asset/viewer.hpp @@ -62,6 +62,7 @@ //using std::vector; //using std::string; +namespace proc { namespace mobject { namespace session { @@ -73,9 +74,8 @@ namespace session { namespace asset { - using lumiera::P; class Viewer; - typedef lumiera::P PViewer; + typedef P PViewer; /** @@ -103,5 +103,5 @@ namespace asset { ///////////////////////////TODO currently just fleshing the API -} // namespace asset +}} // namespace proc::asset #endif diff --git a/src/proc/assetmanager.cpp b/src/proc/assetmanager.cpp index 0de48828e..1b4fdb4e3 100644 --- a/src/proc/assetmanager.cpp +++ b/src/proc/assetmanager.cpp @@ -40,6 +40,7 @@ using lib::Singleton; using lib::Sync; +namespace proc { namespace asset { /** @@ -220,7 +221,7 @@ namespace asset { } -} // namespace asset +}} // namespace proc::asset @@ -240,7 +241,7 @@ namespace asset { #include "proc/asset/sequence.hpp" #include "proc/asset/meta/time-grid.hpp" - +namespace proc { namespace asset { template ID AssetManager::reg (Asset* obj, const Asset::Ident& idi); @@ -265,4 +266,4 @@ namespace asset { template P AssetManager::wrap (const TimeGrid& asset); -} // namespace asset +}} // namespace proc::asset diff --git a/src/proc/assetmanager.hpp b/src/proc/assetmanager.hpp index 3b69baa7c..61567c582 100644 --- a/src/proc/assetmanager.hpp +++ b/src/proc/assetmanager.hpp @@ -52,7 +52,7 @@ using std::string; using std::list; - +namespace proc { namespace asset { class DB; @@ -120,13 +120,13 @@ namespace asset { LUMIERA_ERROR_DECLARE (UNKNOWN_ASSET_ID); ///< use of a non-registered Asset ID. LUMIERA_ERROR_DECLARE (WRONG_ASSET_KIND); ///< Asset ID of wrong Asset kind, unable to cast. -} // namespace asset +}} // namespace proc::asset namespace proc_interface { - using asset::AssetManager; + using proc::asset::AssetManager; } #endif diff --git a/src/proc/common.hpp b/src/proc/common.hpp index 3b18c731b..6e6e2e491 100644 --- a/src/proc/common.hpp +++ b/src/proc/common.hpp @@ -41,7 +41,7 @@ - /* common types frequently used... */ + /* frequently used common types... */ #include "lib/p.hpp" #include "lib/util.hpp" @@ -60,7 +60,7 @@ namespace lumiera { /* additional global configuration goes here... */ - + } // namespace lumiera @@ -68,54 +68,75 @@ namespace lumiera { * Implementation namespace for support and library code. */ namespace lib { - + } /** - * The asset subsystem of the Proc-Layer. - * @todo refactor proc namespaces + * Proc-Layer implementation namespace root. + * Lumiera's middle layer contains the core models, both + * high-level (session) and low-level (render nodes), together with + * the Builder to translate between those two models, the command frontend, + * session support system, the playback-and-render-control subsystem and + * the API and backbone of the renderengine. Most render implementation + * code resides in the backend or is loaded from plug-ins though. */ -namespace asset { } - - -/** - * Proc-Layer dispatcher, controller and administrative facilities. - * @todo refactor proc namespaces - */ -namespace control { } - - -/** - * Render engine code as part of the Proc-Layer. - * Backbone of the engine, render nodes base and cooperation. - * A good deal of the active engine code is outside the scope of the - * Proc-Layer, e.g. code located in backend services and plugins. - * @todo refactor proc namespaces - */ -namespace engine { } - - - -/** - * Media-Objects, edit operations and high-level session. - * @todo is this interface or implementation ?? - * @todo refactor proc namespaces - */ -namespace mobject { - - +namespace proc { + + + /** - * Namespace of Session and user visible high-level objects. + * The asset subsystem of the Proc-Layer. */ - namespace session { } - - + namespace asset { } + + /** - * Namespace of the Builder, transforming high-level into low-level. + * Proc-Layer dispatcher, controller and administrative facilities. */ - namespace builder { } - -} + namespace control { } + + + /** + * Playback and rendering control subsystem. + * The so called "player" combines and orchestrates services from + * the engine, session and backend to perform playback or rendering + */ + namespace play { + + } + + + /** + * Render engine code as part of the Proc-Layer. + * Backbone of the engine, render nodes base and cooperation. + * A good deal of the active engine code is outside the scope of the + * Proc-Layer, e.g. code located in backend services and plugins. + */ + namespace engine { } + + + + /** + * Media-Objects, edit operations and high-level session. + * @todo is this interface or implementation ?? + */ + namespace mobject { + + + /** + * Namespace of Session and user visible high-level objects. + */ + namespace session { } + + + /** + * Namespace of the Builder, transforming high-level into low-level. + */ + namespace builder { } + + } + +} // proc #endif /*LUMIERA_H*/ diff --git a/src/proc/control/mediaimpllib.hpp b/src/proc/control/mediaimpllib.hpp index 0afa07b8a..4a5fd683f 100644 --- a/src/proc/control/mediaimpllib.hpp +++ b/src/proc/control/mediaimpllib.hpp @@ -25,7 +25,7 @@ #define CONTROL_MEDIAIMPLLIB_H -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" diff --git a/src/proc/control/stypemanager.cpp b/src/proc/control/stypemanager.cpp index 8c4d50672..31b5fc8c4 100644 --- a/src/proc/control/stypemanager.cpp +++ b/src/proc/control/stypemanager.cpp @@ -29,7 +29,6 @@ namespace control { - using lumiera::StreamType; using lib::Symbol; /* ======= stream type manager lifecycle ==========*/ diff --git a/src/proc/control/stypemanager.hpp b/src/proc/control/stypemanager.hpp index 0f40408cc..f3cbd3444 100644 --- a/src/proc/control/stypemanager.hpp +++ b/src/proc/control/stypemanager.hpp @@ -25,7 +25,7 @@ #define CONTROL_STYPEMANAGER_H -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" #include "lib/singleton.hpp" #include @@ -34,7 +34,6 @@ namespace control { using lib::Symbol; - using lumiera::StreamType; class STypeManager diff --git a/src/proc/control/styperegistry.hpp b/src/proc/control/styperegistry.hpp index a5593f9c7..73bf97ba1 100644 --- a/src/proc/control/styperegistry.hpp +++ b/src/proc/control/styperegistry.hpp @@ -50,7 +50,7 @@ namespace control { -// using lumiera::P; +// using lib::P; // using lumiera::Query; // using std::string; diff --git a/src/proc/controllerfacade.cpp b/src/proc/controllerfacade.cpp index 737f85589..84076b44e 100644 --- a/src/proc/controllerfacade.cpp +++ b/src/proc/controllerfacade.cpp @@ -23,8 +23,7 @@ #include "proc/controllerfacade.hpp" -namespace proc_interface - { +namespace proc_interface { /** */ diff --git a/src/proc/engine/buffer-local-key.hpp b/src/proc/engine/buffer-local-key.hpp index 15bfe07ef..b8fc66ee3 100644 --- a/src/proc/engine/buffer-local-key.hpp +++ b/src/proc/engine/buffer-local-key.hpp @@ -34,6 +34,7 @@ namespace lib { typedef size_t HashVal; } +namespace proc { namespace engine { namespace metadata { @@ -124,5 +125,5 @@ namespace engine { }; -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/buffer-metadata.hpp b/src/proc/engine/buffer-metadata.hpp index c33c59ea7..7aad2ceeb 100644 --- a/src/proc/engine/buffer-metadata.hpp +++ b/src/proc/engine/buffer-metadata.hpp @@ -65,6 +65,7 @@ #include +namespace proc { namespace engine { using lib::HashVal; @@ -789,5 +790,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/buffer-provider.cpp b/src/proc/engine/buffer-provider.cpp index 1303d1458..e4224556a 100644 --- a/src/proc/engine/buffer-provider.cpp +++ b/src/proc/engine/buffer-provider.cpp @@ -28,6 +28,7 @@ using util::isSameObject; +namespace proc { namespace engine { @@ -312,4 +313,4 @@ namespace engine { -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/buffer-provider.hpp b/src/proc/engine/buffer-provider.hpp index 37add12f1..e0aaff78d 100644 --- a/src/proc/engine/buffer-provider.hpp +++ b/src/proc/engine/buffer-provider.hpp @@ -52,6 +52,7 @@ #include +namespace proc { namespace engine { using boost::scoped_ptr; @@ -165,5 +166,5 @@ namespace engine { } -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/buffhandle-attach.hpp b/src/proc/engine/buffhandle-attach.hpp index 0b2d3a0ae..aee29c386 100644 --- a/src/proc/engine/buffhandle-attach.hpp +++ b/src/proc/engine/buffhandle-attach.hpp @@ -50,6 +50,7 @@ #include "proc/engine/buffhandle.hpp" +namespace proc { namespace engine { @@ -125,5 +126,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/buffhandle.hpp b/src/proc/engine/buffhandle.hpp index 9ed842cb4..24816854d 100644 --- a/src/proc/engine/buffhandle.hpp +++ b/src/proc/engine/buffhandle.hpp @@ -52,13 +52,14 @@ #include "lib/error.hpp" -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" #include "lib/bool-checkable.hpp" +namespace proc { namespace engine { - namespace error = lumiera::error; + namespace error = ::lumiera::error; using error::LUMIERA_ERROR_LIFECYCLE; typedef size_t HashVal; ////////////TICKET #722 @@ -110,7 +111,7 @@ namespace engine { class BuffHandle : public lib::BoolCheckable { - typedef lumiera::StreamType::ImplFacade::DataBuffer Buff; + typedef StreamType::ImplFacade::DataBuffer Buff; BufferDescriptor descriptor_; Buff* pBuffer_; @@ -180,5 +181,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/bufftable-obsolete.hpp b/src/proc/engine/bufftable-obsolete.hpp index 391808f65..665726804 100644 --- a/src/proc/engine/bufftable-obsolete.hpp +++ b/src/proc/engine/bufftable-obsolete.hpp @@ -38,6 +38,7 @@ ////////////////////////////////WARNING: ...just left in tree to keep it compiling ////////////////////////////////TICKET #826 need to be reworked entirely +namespace proc { namespace engine { using std::pair; @@ -183,5 +184,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/bufftable.hpp b/src/proc/engine/bufftable.hpp index 00738cd64..14ea61977 100644 --- a/src/proc/engine/bufftable.hpp +++ b/src/proc/engine/bufftable.hpp @@ -36,6 +36,7 @@ +namespace proc { namespace engine { using std::pair; @@ -154,5 +155,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/channel-descriptor.hpp b/src/proc/engine/channel-descriptor.hpp index 0a8e9887a..5133bc5f8 100644 --- a/src/proc/engine/channel-descriptor.hpp +++ b/src/proc/engine/channel-descriptor.hpp @@ -37,10 +37,11 @@ #include "lib/error.hpp" -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" #include "lib/bool-checkable.hpp" +namespace proc { namespace engine { namespace error = lumiera::error; @@ -71,5 +72,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/diagnostic-buffer-provider.cpp b/src/proc/engine/diagnostic-buffer-provider.cpp index 98f65cf94..e681cdc0c 100644 --- a/src/proc/engine/diagnostic-buffer-provider.cpp +++ b/src/proc/engine/diagnostic-buffer-provider.cpp @@ -28,6 +28,7 @@ #include "proc/engine/tracking-heap-block-provider.hpp" +namespace proc { namespace engine { @@ -104,4 +105,4 @@ namespace engine { } -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/diagnostic-buffer-provider.hpp b/src/proc/engine/diagnostic-buffer-provider.hpp index cef2c1e0d..8355188b6 100644 --- a/src/proc/engine/diagnostic-buffer-provider.hpp +++ b/src/proc/engine/diagnostic-buffer-provider.hpp @@ -40,6 +40,7 @@ #include +namespace proc { namespace engine { namespace error = lumiera::error; @@ -106,5 +107,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/dispatcher.cpp b/src/proc/engine/dispatcher.cpp index 795b56c68..40f5e3c53 100644 --- a/src/proc/engine/dispatcher.cpp +++ b/src/proc/engine/dispatcher.cpp @@ -27,6 +27,7 @@ +namespace proc { namespace engine { /** */ @@ -34,4 +35,4 @@ namespace engine { -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/dispatcher.hpp b/src/proc/engine/dispatcher.hpp index 7565c70eb..6be0a2634 100644 --- a/src/proc/engine/dispatcher.hpp +++ b/src/proc/engine/dispatcher.hpp @@ -30,6 +30,7 @@ +namespace proc { namespace engine { using lib::time::TimeSpan; @@ -58,5 +59,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/link.cpp b/src/proc/engine/link.cpp index e3e9096c6..0ee39458e 100644 --- a/src/proc/engine/link.cpp +++ b/src/proc/engine/link.cpp @@ -23,6 +23,7 @@ #include "proc/engine/link.hpp" +namespace proc { namespace engine { @@ -31,4 +32,4 @@ namespace engine -} // namespace engine + }} // namespace engine diff --git a/src/proc/engine/link.hpp b/src/proc/engine/link.hpp index ac3f70f01..ea9b17edb 100644 --- a/src/proc/engine/link.hpp +++ b/src/proc/engine/link.hpp @@ -28,8 +28,8 @@ -namespace engine - { +namespace proc { +namespace engine { /** @@ -50,5 +50,5 @@ namespace engine -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/mask.cpp b/src/proc/engine/mask.cpp index e742a9a91..b341f51b9 100644 --- a/src/proc/engine/mask.cpp +++ b/src/proc/engine/mask.cpp @@ -23,12 +23,12 @@ #include "proc/engine/mask.hpp" -namespace engine - { +namespace proc { +namespace engine { /** */ -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/mask.hpp b/src/proc/engine/mask.hpp index b805467a3..364f370a8 100644 --- a/src/proc/engine/mask.hpp +++ b/src/proc/engine/mask.hpp @@ -28,6 +28,7 @@ +namespace proc { namespace engine { @@ -38,5 +39,5 @@ namespace engine -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/nodefactory.cpp b/src/proc/engine/nodefactory.cpp index eb3ec1913..5812bf40a 100644 --- a/src/proc/engine/nodefactory.cpp +++ b/src/proc/engine/nodefactory.cpp @@ -27,6 +27,7 @@ #include "proc/engine/nodewiring.hpp" +namespace proc { namespace engine { namespace { // Details of node fabrication @@ -53,4 +54,4 @@ namespace engine { } -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/nodefactory.hpp b/src/proc/engine/nodefactory.hpp index 49f605ca4..63b5ca719 100644 --- a/src/proc/engine/nodefactory.hpp +++ b/src/proc/engine/nodefactory.hpp @@ -33,6 +33,7 @@ namespace lib { class AllocationCluster; } +namespace proc { namespace mobject { namespace session { @@ -75,5 +76,5 @@ namespace engine { }; -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/nodeinvocation.hpp b/src/proc/engine/nodeinvocation.hpp index 7bb92f1e2..18f1bb75e 100644 --- a/src/proc/engine/nodeinvocation.hpp +++ b/src/proc/engine/nodeinvocation.hpp @@ -61,6 +61,7 @@ +namespace proc { namespace engine { @@ -232,5 +233,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/nodeoperation.hpp b/src/proc/engine/nodeoperation.hpp index 34e8b684f..e656e9813 100644 --- a/src/proc/engine/nodeoperation.hpp +++ b/src/proc/engine/nodeoperation.hpp @@ -70,6 +70,7 @@ +namespace proc { namespace engine { namespace config { diff --git a/src/proc/engine/nodewiring-config.hpp b/src/proc/engine/nodewiring-config.hpp index 62ce24abc..713c68828 100644 --- a/src/proc/engine/nodewiring-config.hpp +++ b/src/proc/engine/nodewiring-config.hpp @@ -60,6 +60,7 @@ #include +namespace proc { namespace engine { namespace config { diff --git a/src/proc/engine/nodewiring-def.hpp b/src/proc/engine/nodewiring-def.hpp index ef0173820..20477aa00 100644 --- a/src/proc/engine/nodewiring-def.hpp +++ b/src/proc/engine/nodewiring-def.hpp @@ -50,6 +50,7 @@ +namespace proc { namespace engine { using lib::RefArray; @@ -184,5 +185,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/nodewiring.cpp b/src/proc/engine/nodewiring.cpp index 9be5dd541..f216c0d14 100644 --- a/src/proc/engine/nodewiring.cpp +++ b/src/proc/engine/nodewiring.cpp @@ -29,6 +29,7 @@ #include "lib/meta/typelist-manip.hpp" +namespace proc { namespace engine { namespace config { @@ -149,4 +150,4 @@ namespace engine { } -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/nodewiring.hpp b/src/proc/engine/nodewiring.hpp index 9f263ab06..d420643f7 100644 --- a/src/proc/engine/nodewiring.hpp +++ b/src/proc/engine/nodewiring.hpp @@ -35,6 +35,7 @@ +namespace proc { namespace engine { @@ -96,5 +97,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/pluginadapter.cpp b/src/proc/engine/pluginadapter.cpp index 7d6a16031..5bbc144e8 100644 --- a/src/proc/engine/pluginadapter.cpp +++ b/src/proc/engine/pluginadapter.cpp @@ -23,12 +23,12 @@ #include "proc/engine/pluginadapter.hpp" -namespace engine - { +namespace proc { +namespace engine { /** */ -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/pluginadapter.hpp b/src/proc/engine/pluginadapter.hpp index 19ed23f3b..38d7152a3 100644 --- a/src/proc/engine/pluginadapter.hpp +++ b/src/proc/engine/pluginadapter.hpp @@ -28,6 +28,7 @@ +namespace proc { namespace engine { @@ -44,5 +45,5 @@ namespace engine -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/procnode.hpp b/src/proc/engine/procnode.hpp index a5eac5bc0..47d7a6d75 100644 --- a/src/proc/engine/procnode.hpp +++ b/src/proc/engine/procnode.hpp @@ -53,6 +53,7 @@ +namespace proc { namespace engine { using std::vector; @@ -172,5 +173,5 @@ namespace engine { } -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/render-invocation.cpp b/src/proc/engine/render-invocation.cpp index 90c9bf147..adf7d67ac 100644 --- a/src/proc/engine/render-invocation.cpp +++ b/src/proc/engine/render-invocation.cpp @@ -25,6 +25,7 @@ #include "proc/engine/stateproxy.hpp" +namespace proc { namespace engine { namespace { // Details... @@ -55,4 +56,4 @@ namespace engine { } -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/render-invocation.hpp b/src/proc/engine/render-invocation.hpp index 481d5e691..deb2b27f7 100644 --- a/src/proc/engine/render-invocation.hpp +++ b/src/proc/engine/render-invocation.hpp @@ -42,6 +42,7 @@ +namespace proc { namespace engine { @@ -74,5 +75,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/renderengine.cpp b/src/proc/engine/renderengine.cpp index 588d1276b..706a87e07 100644 --- a/src/proc/engine/renderengine.cpp +++ b/src/proc/engine/renderengine.cpp @@ -23,6 +23,7 @@ #include "proc/engine/renderengine.hpp" +namespace proc { namespace engine { @@ -30,4 +31,4 @@ namespace engine { -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/renderengine.hpp b/src/proc/engine/renderengine.hpp index ebbd46e5a..abe036bef 100644 --- a/src/proc/engine/renderengine.hpp +++ b/src/proc/engine/renderengine.hpp @@ -37,6 +37,7 @@ using std::list; //////////TODO for the "real" engine API: look at engine-serivce.hpp +namespace proc { namespace engine { @@ -59,5 +60,5 @@ namespace engine { }; -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/rendergraph.cpp b/src/proc/engine/rendergraph.cpp index fefaf7c63..0c100fde3 100644 --- a/src/proc/engine/rendergraph.cpp +++ b/src/proc/engine/rendergraph.cpp @@ -32,6 +32,7 @@ namespace lumiera { } +namespace proc { namespace engine { /** */ @@ -39,4 +40,4 @@ namespace engine { -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/rendergraph.hpp b/src/proc/engine/rendergraph.hpp index eb811de6f..63c039e0f 100644 --- a/src/proc/engine/rendergraph.hpp +++ b/src/proc/engine/rendergraph.hpp @@ -34,6 +34,7 @@ /////////////////////////////TODO consequently this will become some kind of root or anchor point for this network +namespace proc { namespace engine { using lib::time::TimeSpan; @@ -64,5 +65,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/source.cpp b/src/proc/engine/source.cpp index 68cad7a62..477bc768e 100644 --- a/src/proc/engine/source.cpp +++ b/src/proc/engine/source.cpp @@ -23,6 +23,7 @@ #include "proc/engine/source.hpp" +namespace proc { namespace engine { @@ -31,4 +32,4 @@ namespace engine -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/source.hpp b/src/proc/engine/source.hpp index 8587c3d67..fedeb1784 100644 --- a/src/proc/engine/source.hpp +++ b/src/proc/engine/source.hpp @@ -28,6 +28,7 @@ +namespace proc { namespace engine { @@ -47,5 +48,5 @@ namespace engine -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/stateproxy.cpp b/src/proc/engine/stateproxy.cpp index 90e36a094..c62a468a5 100644 --- a/src/proc/engine/stateproxy.cpp +++ b/src/proc/engine/stateproxy.cpp @@ -23,6 +23,7 @@ #include "proc/engine/stateproxy.hpp" +namespace proc { namespace engine { @@ -84,4 +85,4 @@ namespace engine { } -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/stateproxy.hpp b/src/proc/engine/stateproxy.hpp index bca680be3..269e47dae 100644 --- a/src/proc/engine/stateproxy.hpp +++ b/src/proc/engine/stateproxy.hpp @@ -28,6 +28,7 @@ #include "proc/state.hpp" +namespace proc { namespace engine { @@ -56,5 +57,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/tracking-heap-block-provider.cpp b/src/proc/engine/tracking-heap-block-provider.cpp index f9e951889..c9f96aa28 100644 --- a/src/proc/engine/tracking-heap-block-provider.cpp +++ b/src/proc/engine/tracking-heap-block-provider.cpp @@ -43,6 +43,7 @@ using lib::ScopedPtrVect; +namespace proc { namespace engine { namespace error = lumiera::error; @@ -322,4 +323,4 @@ namespace engine { -} // namespace engine +}} // namespace engine diff --git a/src/proc/engine/tracking-heap-block-provider.hpp b/src/proc/engine/tracking-heap-block-provider.hpp index a42fb65f8..d9aa53c26 100644 --- a/src/proc/engine/tracking-heap-block-provider.hpp +++ b/src/proc/engine/tracking-heap-block-provider.hpp @@ -52,6 +52,7 @@ #include +namespace proc { namespace engine { namespace error = lumiera::error; @@ -183,5 +184,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/proc/engine/type-handler.hpp b/src/proc/engine/type-handler.hpp index d7130d308..b02f6e637 100644 --- a/src/proc/engine/type-handler.hpp +++ b/src/proc/engine/type-handler.hpp @@ -49,6 +49,7 @@ #include +namespace proc { namespace engine { using lib::HashVal; @@ -56,7 +57,7 @@ namespace engine { using std::tr1::function; using std::tr1::placeholders::_1; - namespace error = lumiera::error; + namespace error = ::lumiera::error; namespace { // (optional) helpers to build an object embedded into a buffer... @@ -178,5 +179,5 @@ namespace engine { -} // namespace engine +}} // namespace proc::engine #endif diff --git a/src/common/external/libgavl.cpp b/src/proc/external/libgavl.cpp similarity index 94% rename from src/common/external/libgavl.cpp rename to src/proc/external/libgavl.cpp index b60caecea..637e7c559 100644 --- a/src/common/external/libgavl.cpp +++ b/src/proc/external/libgavl.cpp @@ -22,7 +22,7 @@ #include "proc/common.hpp" -#include "common/external/libgavl.hpp" +#include "proc/external/libgavl.hpp" #include "proc/control/stypemanager.hpp" extern "C" { @@ -30,8 +30,8 @@ extern "C" { } -namespace lib { - namespace external { +namespace proc { +namespace external { using control::STypeManager; using control::ON_STREAMTYPES_RESET; @@ -66,6 +66,4 @@ namespace lib { - } // namespace external - -} // namespace lib +}} // namespace proc::external diff --git a/src/common/external/libgavl.hpp b/src/proc/external/libgavl.hpp similarity index 92% rename from src/common/external/libgavl.hpp rename to src/proc/external/libgavl.hpp index ac6a00b03..632a76c66 100644 --- a/src/common/external/libgavl.hpp +++ b/src/proc/external/libgavl.hpp @@ -21,21 +21,20 @@ */ -#ifndef LIB_EXTERN_LIBGAVL_H -#define LIB_EXTERN_LIBGAVL_H +#ifndef PROC_EXTERNAL_LIBGAVL_H +#define PROC_EXTERNAL_LIBGAVL_H #include "proc/control/mediaimpllib.hpp" -namespace lib { - namespace external { +namespace proc { +namespace external { using lib::Symbol; - using lumiera::StreamType; typedef StreamType::ImplFacade ImplFacade; typedef StreamType::ImplFacade::TypeTag TypeTag; @@ -84,7 +83,5 @@ namespace lib { - } // namespace external - -} // namespace lib +}} // namespace proc::external #endif diff --git a/src/proc/facade.cpp b/src/proc/facade.cpp index de6d562ee..e1339d05e 100644 --- a/src/proc/facade.cpp +++ b/src/proc/facade.cpp @@ -32,6 +32,7 @@ namespace proc { using std::string; using lumiera::Subsys; + using lumiera::Option; class BuilderSubsysDescriptor @@ -40,14 +41,14 @@ namespace proc { operator string () const { return "Builder"; } bool - shouldStart (lumiera::Option&) + shouldStart (Option&) { TODO ("determine, if we need a Builder Thread"); return false; } bool - start (lumiera::Option&, Subsys::SigTerm termination) + start (Option&, Subsys::SigTerm termination) { UNIMPLEMENTED ("fire up a Builder in a separate Thread, and register shutdown hook"); return false; @@ -76,14 +77,14 @@ namespace proc { operator string () const { return "Session"; } bool - shouldStart (lumiera::Option&) + shouldStart (Option&) { TODO ("determine, if an existing Session should be loaded"); return false; } bool - start (lumiera::Option&, Subsys::SigTerm termination) + start (Option&, Subsys::SigTerm termination) { UNIMPLEMENTED ("load an existing session as denoted by the options and register shutdown hook"); return false; @@ -119,14 +120,14 @@ namespace proc { * @todo actually define cmdline options and parse/decide here! */ bool - shouldStart (lumiera::Option&) + shouldStart (Option&) { TODO ("extract options about specific output systems to be brought up"); return false; } bool - start (lumiera::Option&, Subsys::SigTerm termination) + start (Option&, Subsys::SigTerm termination) { this->completedSignal_ = termination; return play::OutputDirector::instance().connectUp(); diff --git a/src/proc/facade.hpp b/src/proc/facade.hpp index 18ef46454..0f9e227d8 100644 --- a/src/proc/facade.hpp +++ b/src/proc/facade.hpp @@ -20,6 +20,17 @@ */ +/** @file facade.hpp + ** Top level entrance point and facade for the Proc-Layer. + ** The middle layer of the application holds a session with the + ** high-level model, to be translated by the Builder into a node network, + ** which can be \em performed by the Engine to render output. + ** + ** @see common.hpp + ** + */ + + #ifndef PROC_INTERFACE_FACADE_H #define PROC_INTERFACE_FACADE_H @@ -29,12 +40,6 @@ -/** - * Lumiera Proc-Layer implementation root. - * The middle layer of the application holds a session with the - * high-level model, to be translated by the Builder into a node network, - * which can be \em performed by the Engine to render output. - */ namespace proc { diff --git a/src/proc/mobject/builder/applicable-builder-target-types.hpp b/src/proc/mobject/builder/applicable-builder-target-types.hpp index 57c2e66f9..58058f027 100644 --- a/src/proc/mobject/builder/applicable-builder-target-types.hpp +++ b/src/proc/mobject/builder/applicable-builder-target-types.hpp @@ -63,7 +63,7 @@ /////////////////////////////////TICKET #414 - +namespace proc { namespace mobject { namespace builder { @@ -92,5 +92,5 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace mobject::builder #endif diff --git a/src/proc/mobject/builder/assembler.cpp b/src/proc/mobject/builder/assembler.cpp index b4d05bb07..3ea5a0bd7 100644 --- a/src/proc/mobject/builder/assembler.cpp +++ b/src/proc/mobject/builder/assembler.cpp @@ -23,20 +23,17 @@ #include "proc/mobject/builder/assembler.hpp" -namespace mobject +namespace proc { +namespace mobject { +namespace builder { + + + + engine::RenderEngine & + Assembler::build () { - namespace builder - { + } - engine::RenderEngine & - Assembler::build () - { - } - - - - } // namespace mobject::builder - -} // namespace mobject +}}} // namespace proc::mobject::builder diff --git a/src/proc/mobject/builder/assembler.hpp b/src/proc/mobject/builder/assembler.hpp index f874b99bd..095052581 100644 --- a/src/proc/mobject/builder/assembler.hpp +++ b/src/proc/mobject/builder/assembler.hpp @@ -27,28 +27,24 @@ #include "proc/engine/renderengine.hpp" - -namespace mobject - { - namespace builder +namespace proc { +namespace mobject { +namespace builder { + + + /** + * This is the actual building facility: + * provided the correct tools and associations, + * it serves to build and connect the individual ProcNode objects + */ + class Assembler { - - - /** - * This is the actual building facility: - * provided the correct tools and associations, - * it serves to build and connect the individual ProcNode objects - */ - class Assembler - { - public: - engine::RenderEngine & build () ; - // TODO: allocation, GC??? - }; - - - - } // namespace mobject::builder - -} // namespace mobject + public: + engine::RenderEngine & build () ; + // TODO: allocation, GC??? + }; + + + +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/buildertool.hpp b/src/proc/mobject/builder/buildertool.hpp index 9d51361d4..e707aabcc 100644 --- a/src/proc/mobject/builder/buildertool.hpp +++ b/src/proc/mobject/builder/buildertool.hpp @@ -61,13 +61,14 @@ #include "proc/mobject/explicitplacement.hpp" +namespace proc { namespace mobject { class Buildable; namespace builder { - using lumiera::P; + using lib::P; /** * Policy invoking an catch-all function for processing @@ -105,9 +106,9 @@ namespace mobject { * as we simply store a pointer within the BuilderTool instance. */ class BuilderTool - : public lumiera::visitor::Tool + : public ::lumiera::visitor::Tool { - lumiera::WrapperPtr currentWrapper_; + ::lumiera::WrapperPtr currentWrapper_; public: @@ -146,7 +147,7 @@ namespace mobject { } template - lumiera::P + P getPtr () { P* pP = currentWrapper_.get*>(); @@ -166,11 +167,11 @@ namespace mobject { class TYPELIST // list of all concrete Buildables to be treated > class Applicable - : public lumiera::visitor::Applicable + : public ::lumiera::visitor::Applicable { } ; - using lumiera::typelist::Types; // convenience for the users of "Applicable" + using ::lumiera::typelist::Types; // convenience for the users of "Applicable" }// namespace mobject::builder @@ -181,7 +182,7 @@ namespace mobject { /** * Marker Interface for classes visitable by Builder tools. */ - class Buildable : public lumiera::visitor::Visitable + class Buildable : public ::lumiera::visitor::Visitable { }; @@ -206,5 +207,5 @@ namespace mobject { } -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/common.hpp b/src/proc/mobject/builder/common.hpp index ba09ec9ca..35d51c2a5 100644 --- a/src/proc/mobject/builder/common.hpp +++ b/src/proc/mobject/builder/common.hpp @@ -27,11 +27,11 @@ #include "lib/error.hpp" #include "include/logging.h" - +namespace proc { namespace mobject { namespace builder { -}} // namespace mobject::builder +}}} // namespace mobject::builder #endif diff --git a/src/proc/mobject/builder/conmanager.cpp b/src/proc/mobject/builder/conmanager.cpp index b13c19b67..082512d90 100644 --- a/src/proc/mobject/builder/conmanager.cpp +++ b/src/proc/mobject/builder/conmanager.cpp @@ -24,21 +24,20 @@ #include "proc/mobject/builder/conmanager.hpp" #include "proc/control/stypemanager.hpp" +namespace proc { namespace mobject { - namespace builder { - - - - /** - * TODO !!!!!!!!!!!!!!!!!! - */ - int - ConManager::getConnection () - { - } +namespace builder { + + + + /** + * TODO !!!!!!!!!!!!!!!!!! + */ + int + ConManager::getConnection () + { + } - } // namespace mobject::builder - -} // namespace mobject +}}} // namespace proc::mobject::builder diff --git a/src/proc/mobject/builder/conmanager.hpp b/src/proc/mobject/builder/conmanager.hpp index db699d868..6e9c850c0 100644 --- a/src/proc/mobject/builder/conmanager.hpp +++ b/src/proc/mobject/builder/conmanager.hpp @@ -21,38 +21,37 @@ */ -#ifndef MOBJECT_BUILDER_CONMANAGER_H -#define MOBJECT_BUILDER_CONMANAGER_H +#ifndef PROC_MOBJECT_BUILDER_CONMANAGER_H +#define PROC_MOBJECT_BUILDER_CONMANAGER_H +namespace proc { namespace mobject { - namespace builder { - - - /** - * Connection Manager: used to build the connections between render engine nodes - * if these nodes need to cooperate besides the normal "data pull" operation. - * Esp. the Connection Manager knows how to wire up the effect's parameters - * with the corresponding ParamProviders (automation) in the Session. - * Questions regarding the possibility of a media stream connection are - * delegated internally to the STypeManager. - * \par - * The primary service of the connection manager is to accept a wiring request - * and handle the details of establishing the necessary connections. - */ - class ConManager - { - public: - /** - * TODO just a design sketch, work out signatures etc... - */ - int getConnection () ; - }; +namespace builder { + + + /** + * Connection Manager: used to build the connections between render engine nodes + * if these nodes need to cooperate besides the normal "data pull" operation. + * Esp. the Connection Manager knows how to wire up the effect's parameters + * with the corresponding ParamProviders (automation) in the Session. + * Questions regarding the possibility of a media stream connection are + * delegated internally to the STypeManager. + * \par + * The primary service of the connection manager is to accept a wiring request + * and handle the details of establishing the necessary connections. + */ + class ConManager + { + public: + /** + * TODO just a design sketch, work out signatures etc... + */ + int getConnection () ; + }; - } // namespace mobject::builder - -} // namespace mobject +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/fixture-change-detector.hpp b/src/proc/mobject/builder/fixture-change-detector.hpp index e2da29419..6c1065396 100644 --- a/src/proc/mobject/builder/fixture-change-detector.hpp +++ b/src/proc/mobject/builder/fixture-change-detector.hpp @@ -51,6 +51,7 @@ //#include +namespace proc { namespace mobject { namespace builder { @@ -77,5 +78,5 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/model-port-registry.cpp b/src/proc/mobject/builder/model-port-registry.cpp index c3c16d7eb..f19ef1b2a 100644 --- a/src/proc/mobject/builder/model-port-registry.cpp +++ b/src/proc/mobject/builder/model-port-registry.cpp @@ -43,6 +43,7 @@ #include "proc/mobject/model-port.hpp" #include "proc/mobject/builder/model-port-registry.hpp" +namespace proc { namespace mobject { namespace builder { @@ -79,7 +80,7 @@ namespace mobject { ModelPortRegistry::setActiveInstance (ModelPortRegistry& newRegistry) { LockRegistry global_lock; - ModelPortRegistry *previous = theGlobalRegistry.isValid()? + ModelPortRegistry *previous = theGlobalRegistry.isValid()? &( theGlobalRegistry()) : 0; INFO_IF (!previous, builder, "activating new ModelPort registry."); WARN_IF ( previous, builder, "switching ModelPort registry instance."); @@ -299,4 +300,4 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject diff --git a/src/proc/mobject/builder/model-port-registry.hpp b/src/proc/mobject/builder/model-port-registry.hpp index 078c1928b..694e5d783 100644 --- a/src/proc/mobject/builder/model-port-registry.hpp +++ b/src/proc/mobject/builder/model-port-registry.hpp @@ -57,6 +57,7 @@ #include +namespace proc { namespace mobject { namespace builder { @@ -177,5 +178,5 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/mould.hpp b/src/proc/mobject/builder/mould.hpp index 5db2ece7f..e1bf5cb73 100644 --- a/src/proc/mobject/builder/mould.hpp +++ b/src/proc/mobject/builder/mould.hpp @@ -30,58 +30,57 @@ #include +namespace proc { namespace mobject { - namespace builder { +namespace builder { - using std::vector; - using asset::PProcPatt; - using lib::Symbol; - - - /** - * Interface: a workbench-like tool used by the builder - * for wiring up a specific building situation, followed by - * the application/execution of a single building step. Mould is - * conceived as the passive part, while usually the ProcPatt plays - * the role of the active counterpart. By means of the Mould interface, - * the specifics of a build situation are abstracted away, thus allowing - * the processing pattern to be defined as working on symbolic locations. - * Most commonly this is "current", denoting the render node just being built. - *
  • PipeMould supports attaching an effect to a pipe
  • - *
  • combining pipes via a transition is done by a CombiningMould
  • - *
  • a SourceChainMould allows to start out from a source reader and build a clip
  • - *
  • wiring general connections is supported by the WiringMould
  • - *
- * @see ToolFactory - * @see NodeCreatorTool - */ - class Mould - { - public: - vector operate (); - - OperationPoint& getLocation (Symbol locationID); - }; - - - class PipeMould : public Mould - { - }; - - class CombiningMould : public Mould - { - }; - - class SourceChainMould : public Mould - { - }; - - class WiringMould : public Mould - { - }; - - - } // namespace mobject::builder - -} // namespace mobject + using std::vector; + using asset::PProcPatt; + using lib::Symbol; + + + /** + * Interface: a workbench-like tool used by the builder + * for wiring up a specific building situation, followed by + * the application/execution of a single building step. Mould is + * conceived as the passive part, while usually the ProcPatt plays + * the role of the active counterpart. By means of the Mould interface, + * the specifics of a build situation are abstracted away, thus allowing + * the processing pattern to be defined as working on symbolic locations. + * Most commonly this is "current", denoting the render node just being built. + *
  • PipeMould supports attaching an effect to a pipe
  • + *
  • combining pipes via a transition is done by a CombiningMould
  • + *
  • a SourceChainMould allows to start out from a source reader and build a clip
  • + *
  • wiring general connections is supported by the WiringMould
  • + *
+ * @see ToolFactory + * @see NodeCreatorTool + */ + class Mould + { + public: + vector operate (); + + OperationPoint& getLocation (Symbol locationID); + }; + + + class PipeMould : public Mould + { + }; + + class CombiningMould : public Mould + { + }; + + class SourceChainMould : public Mould + { + }; + + class WiringMould : public Mould + { + }; + + +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/nodecreatortool.cpp b/src/proc/mobject/builder/nodecreatortool.cpp index 9dcb639b7..7f617f28e 100644 --- a/src/proc/mobject/builder/nodecreatortool.cpp +++ b/src/proc/mobject/builder/nodecreatortool.cpp @@ -24,52 +24,52 @@ #include "proc/mobject/builder/nodecreatortool.hpp" -using mobject::Buildable; -using mobject::session::Clip; -using mobject::session::Effect; -using mobject::session::Auto; +namespace proc { namespace mobject { - namespace builder { - - /////////////////////////////////TICKET #414 - - - ////TODO: do we ever get to treat a model root element?? - - - void - NodeCreatorTool::treat (Buildable& something) - { - } +namespace builder { + + using mobject::Buildable; + using mobject::session::Clip; + using mobject::session::Effect; + using mobject::session::Auto; + + /////////////////////////////////TICKET #414 + + + ////TODO: do we ever get to treat a model root element?? + + + void + NodeCreatorTool::treat (Buildable& something) + { + } - void - NodeCreatorTool::treat (Clip& clip) - { - } + void + NodeCreatorTool::treat (Clip& clip) + { + } - void - NodeCreatorTool::treat (Effect& effect) - { - } + void + NodeCreatorTool::treat (Effect& effect) + { + } - void - NodeCreatorTool::treat (Auto& automation) - { - } - - - void - NodeCreatorTool::onUnknown (Buildable& target) - { - UNIMPLEMENTED ("catch-all when partitioning timeline"); ////////TODO: verify why this gets enforced here... - } + void + NodeCreatorTool::treat (Auto& automation) + { + } + + + void + NodeCreatorTool::onUnknown (Buildable& target) + { + UNIMPLEMENTED ("catch-all when partitioning timeline"); ////////TODO: verify why this gets enforced here... + } - } // namespace mobject::builder - -} // namespace mobject +}}} // namespace proc::mobject::builder diff --git a/src/proc/mobject/builder/nodecreatortool.hpp b/src/proc/mobject/builder/nodecreatortool.hpp index fda4c95db..c808dce2e 100644 --- a/src/proc/mobject/builder/nodecreatortool.hpp +++ b/src/proc/mobject/builder/nodecreatortool.hpp @@ -31,6 +31,7 @@ +namespace proc { namespace mobject { namespace builder { @@ -71,5 +72,5 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace proc:mobject::builder #endif diff --git a/src/proc/mobject/builder/operationpoint.cpp b/src/proc/mobject/builder/operationpoint.cpp index e27ffc5b4..db1165ff1 100644 --- a/src/proc/mobject/builder/operationpoint.cpp +++ b/src/proc/mobject/builder/operationpoint.cpp @@ -26,11 +26,12 @@ #include "proc/asset/media.hpp" #include "proc/asset/proc.hpp" #include "proc/engine/nodefactory.hpp" -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" //#include "common/util.hpp" //#include +namespace proc { namespace mobject { namespace builder { @@ -38,7 +39,6 @@ namespace builder { using engine::NodeFactory; using engine::PNode; - using lumiera::StreamType; struct RefPoint @@ -108,4 +108,4 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder diff --git a/src/proc/mobject/builder/operationpoint.hpp b/src/proc/mobject/builder/operationpoint.hpp index 49b5855bb..fc534ffc1 100644 --- a/src/proc/mobject/builder/operationpoint.hpp +++ b/src/proc/mobject/builder/operationpoint.hpp @@ -32,6 +32,8 @@ #include +namespace proc { + namespace asset { class Proc; } namespace asset { class Media; } namespace engine { class NodeFactory; } @@ -76,5 +78,5 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/renderstate.hpp b/src/proc/mobject/builder/renderstate.hpp index 3da0e094b..935aaab7e 100644 --- a/src/proc/mobject/builder/renderstate.hpp +++ b/src/proc/mobject/builder/renderstate.hpp @@ -28,28 +28,27 @@ +namespace proc { namespace mobject { - namespace builder { - - typedef proc_interface::State State; - - - /** - * Encapsulates the logic used to get a "render process". - * The provided StateProxy serves to hold any mutalbe state used - * in the render process, so the rest of the render engine - * can be stateless. - * @todo probably the state management will work different (6/08) - */ - class RenderState - { - public: - State& getRenderProcess () ; - }; +namespace builder { + + typedef proc_interface::State State; + + + /** + * Encapsulates the logic used to get a "render process". + * The provided StateProxy serves to hold any mutalbe state used + * in the render process, so the rest of the render engine + * can be stateless. + * @todo probably the state management will work different (6/08) + */ + class RenderState + { + public: + State& getRenderProcess () ; + }; - } // namespace mobject::session - -} // namespace mobject +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/builder/segmentation-tool.cpp b/src/proc/mobject/builder/segmentation-tool.cpp index 39b47380f..69263068c 100644 --- a/src/proc/mobject/builder/segmentation-tool.cpp +++ b/src/proc/mobject/builder/segmentation-tool.cpp @@ -29,6 +29,7 @@ using mobject::session::Clip; using mobject::session::Effect; +namespace proc { namespace mobject { namespace builder { @@ -76,4 +77,4 @@ namespace builder { } -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder diff --git a/src/proc/mobject/builder/segmentation-tool.hpp b/src/proc/mobject/builder/segmentation-tool.hpp index 52bb1c5c1..720938cc5 100644 --- a/src/proc/mobject/builder/segmentation-tool.hpp +++ b/src/proc/mobject/builder/segmentation-tool.hpp @@ -36,6 +36,7 @@ using std::list; +namespace proc { namespace mobject { namespace builder { @@ -74,5 +75,5 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/segmentation.cpp b/src/proc/mobject/builder/segmentation.cpp index e7cd9cbf1..40228949f 100644 --- a/src/proc/mobject/builder/segmentation.cpp +++ b/src/proc/mobject/builder/segmentation.cpp @@ -38,6 +38,7 @@ #include "proc/mobject/builder/segmentation.hpp" #include "proc/mobject/builder/fixture-change-detector.hpp" +namespace proc { namespace mobject { namespace builder { @@ -82,4 +83,4 @@ namespace builder { -}}// namespace mobject::builder +}}}// namespace proc::mobject::builder diff --git a/src/proc/mobject/builder/segmentation.hpp b/src/proc/mobject/builder/segmentation.hpp index 028e47f26..0eed4ed78 100644 --- a/src/proc/mobject/builder/segmentation.hpp +++ b/src/proc/mobject/builder/segmentation.hpp @@ -45,6 +45,7 @@ //#include +namespace proc { namespace mobject { namespace builder { @@ -83,5 +84,5 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/toolfactory.cpp b/src/proc/mobject/builder/toolfactory.cpp index ab844f574..1a679c864 100644 --- a/src/proc/mobject/builder/toolfactory.cpp +++ b/src/proc/mobject/builder/toolfactory.cpp @@ -26,6 +26,7 @@ //#include +namespace proc { namespace mobject { namespace builder { @@ -91,4 +92,4 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder diff --git a/src/proc/mobject/builder/toolfactory.hpp b/src/proc/mobject/builder/toolfactory.hpp index 201653fde..83ca8303b 100644 --- a/src/proc/mobject/builder/toolfactory.hpp +++ b/src/proc/mobject/builder/toolfactory.hpp @@ -35,6 +35,7 @@ +namespace proc { namespace mobject { namespace builder { @@ -69,5 +70,5 @@ namespace builder { -}} // namespace mobject::builder +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builder/wiringrequest.hpp b/src/proc/mobject/builder/wiringrequest.hpp index 1ebb4515c..25f908994 100644 --- a/src/proc/mobject/builder/wiringrequest.hpp +++ b/src/proc/mobject/builder/wiringrequest.hpp @@ -26,29 +26,28 @@ +namespace proc { namespace mobject { - namespace builder { - - - /** - * A stateful value object denoting the wish to establish a link or connection - * between two entities. Used to organise the proper working of the build process. - * Wiring requests are first to be checked and can be deemed impossible to - * satisfy. Internally, wiring requests contain specific information about - * the objects to be connected. This information is exposed only to the - * ConManager, which is the facility actually wiring the connections. - */ - class WiringRequest - { - public: - /** - * TODO design sketch...... - */ - }; +namespace builder { + + + /** + * A statefull value object denoting the wish to establish a link or connection + * between two entities. Used to organise the proper working of the build process. + * Wiring requests are first to be checked and can be deemed impossible to + * satisfy. Internally, wiring requests contain specific information about + * the objects to be connected. This information is exposed only to the + * ConManager, which is the facility actually wiring the connections. + */ + class WiringRequest + { + public: + /** + * TODO design sketch...... + */ + }; - } // namespace mobject::builder - -} // namespace mobject +}}} // namespace proc::mobject::builder #endif diff --git a/src/proc/mobject/builderfacade.cpp b/src/proc/mobject/builderfacade.cpp index b2f1377d5..ec4c86682 100644 --- a/src/proc/mobject/builderfacade.cpp +++ b/src/proc/mobject/builderfacade.cpp @@ -24,6 +24,7 @@ #include "proc/mobject/builder/common.hpp" #include "proc/mobject/builderfacade.hpp" +namespace proc { namespace mobject { @@ -42,4 +43,4 @@ namespace mobject { -} // namespace mobject +}} // namespace mobject diff --git a/src/proc/mobject/builderfacade.hpp b/src/proc/mobject/builderfacade.hpp index 4a27d8b88..c58ce3692 100644 --- a/src/proc/mobject/builderfacade.hpp +++ b/src/proc/mobject/builderfacade.hpp @@ -28,7 +28,7 @@ #include "proc/engine/renderengine.hpp" - +namespace proc { namespace mobject { LUMIERA_ERROR_DECLARE (BUILDER_LIFECYCLE); ///< Builder activated while in non operational state @@ -54,5 +54,5 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/explicitplacement.hpp b/src/proc/mobject/explicitplacement.hpp index 363e8beef..3d1e5c613 100644 --- a/src/proc/mobject/explicitplacement.hpp +++ b/src/proc/mobject/explicitplacement.hpp @@ -28,6 +28,7 @@ +namespace proc { namespace mobject { @@ -83,5 +84,5 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/interpolator.cpp b/src/proc/mobject/interpolator.cpp index 026111b53..ca061f37e 100644 --- a/src/proc/mobject/interpolator.cpp +++ b/src/proc/mobject/interpolator.cpp @@ -23,11 +23,11 @@ #include "proc/mobject/interpolator.hpp" -namespace mobject - { - +namespace proc { +namespace mobject { + /** */ - - - -} // namespace mobject + + + +}} // namespace proc::mobject diff --git a/src/proc/mobject/interpolator.hpp b/src/proc/mobject/interpolator.hpp index 2244d7e58..ec70070f5 100644 --- a/src/proc/mobject/interpolator.hpp +++ b/src/proc/mobject/interpolator.hpp @@ -26,10 +26,10 @@ -namespace mobject - { - - +namespace proc { +namespace mobject { + + /** * Provides the implementation for getting the acutal value * of a time varying or automated effect/plugin parameter @@ -39,8 +39,8 @@ namespace mobject { /////////////// }; - - - -} // namespace mobject + + + +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/mobject-ref.cpp b/src/proc/mobject/mobject-ref.cpp index 4eb98dcfc..5c6197da1 100644 --- a/src/proc/mobject/mobject-ref.cpp +++ b/src/proc/mobject/mobject-ref.cpp @@ -38,9 +38,8 @@ #include "proc/mobject/mobject.hpp" #include "proc/mobject/placement.hpp" -//#include -//using boost::str; +namespace proc { namespace mobject { /** */ @@ -54,4 +53,4 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject diff --git a/src/proc/mobject/mobject-ref.hpp b/src/proc/mobject/mobject-ref.hpp index 4e8adaeb6..03f0f4e85 100644 --- a/src/proc/mobject/mobject-ref.hpp +++ b/src/proc/mobject/mobject-ref.hpp @@ -69,6 +69,7 @@ ///////////////////////////////////////////TODO: define an C-API representation here, make the header multilingual! +namespace proc { namespace mobject { @@ -105,8 +106,8 @@ namespace mobject { operator-> () const { if (!smPtr_) - throw lumiera::error::State("Lifecycle error: MObject ref not activated" - ,LUMIERA_ERROR_BOTTOM_MOBJECTREF); + throw error::State("Lifecycle error: MObject ref not activated" + ,LUMIERA_ERROR_BOTTOM_MOBJECTREF); ENSURE (INSTANCEOF (MO, smPtr_.get())); return smPtr_.operator-> (); @@ -116,8 +117,8 @@ namespace mobject { Placement& getPlacement() const { if (!isValid()) - throw lumiera::error::State("Accessing inactive MObject ref" - ,LUMIERA_ERROR_BOTTOM_MOBJECTREF); + throw error::State("Accessing inactive MObject ref" + ,LUMIERA_ERROR_BOTTOM_MOBJECTREF); ENSURE (INSTANCEOF (MO, smPtr_.get())); return *pRef_; @@ -163,8 +164,8 @@ namespace mobject { attach (Placement const& newPlacement) { if (!isValid()) - throw lumiera::error::State("Attempt to attach a child to an inactive MObject ref" - , LUMIERA_ERROR_BOTTOM_MOBJECTREF); + throw error::State("Attempt to attach a child to an inactive MObject ref" + , LUMIERA_ERROR_BOTTOM_MOBJECTREF); MORef newInstance; PlacementMO::ID thisScope = pRef_; return newInstance.activate ( @@ -388,5 +389,5 @@ namespace mobject { } -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/mobject.cpp b/src/proc/mobject/mobject.cpp index f844510fa..1a563391d 100644 --- a/src/proc/mobject/mobject.cpp +++ b/src/proc/mobject/mobject.cpp @@ -29,6 +29,7 @@ using lib::time::Time; using util::isnil; +namespace proc { namespace mobject { using ::NOBUG_FLAG(memory); @@ -60,4 +61,4 @@ namespace mobject { -} // namespace mobject +}} // namespace mobject diff --git a/src/proc/mobject/mobject.hpp b/src/proc/mobject/mobject.hpp index 78a98fde7..c860c52a0 100644 --- a/src/proc/mobject/mobject.hpp +++ b/src/proc/mobject/mobject.hpp @@ -28,6 +28,7 @@ #include "proc/mobject/builder/buildertool.hpp" #include "proc/mobject/placement.hpp" #include "proc/asset.hpp" //TODO finally not needed? +#include "lib/p.hpp" #include "lib/time/timevalue.hpp" #include @@ -41,10 +42,11 @@ using proc_interface::IDA; //TODO finally not needed? //using proc_interface::PAsset; //TODO: only temporarily using proc_interface::AssetManager; +namespace proc { namespace mobject { using std::string; - using lumiera::P; + using lib::P; //NOBUG_DECLARE_FLAG (mobjectmem); @@ -105,5 +107,5 @@ namespace mobject { typedef Placement PMO; -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/model-port.hpp b/src/proc/mobject/model-port.hpp index 1ff5a0b3b..995d9dd45 100644 --- a/src/proc/mobject/model-port.hpp +++ b/src/proc/mobject/model-port.hpp @@ -68,8 +68,9 @@ #include "proc/asset/pipe.hpp" #include "lib/bool-checkable.hpp" -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" +namespace proc { namespace mobject { LUMIERA_ERROR_DECLARE (INVALID_MODEL_PORT); ///< Referral to unknown model port @@ -77,7 +78,6 @@ namespace mobject { using asset::ID; - using lumiera::StreamType; /** @@ -148,5 +148,5 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/output-designation.cpp b/src/proc/mobject/output-designation.cpp index 3d628150b..aecd3c1fb 100644 --- a/src/proc/mobject/output-designation.cpp +++ b/src/proc/mobject/output-designation.cpp @@ -54,6 +54,7 @@ using lumiera::query::extractID; using lumiera::ConfigRules; using lumiera::Symbol; +namespace proc { namespace mobject { typedef OutputDesignation::PPipe PPipe; @@ -193,4 +194,4 @@ namespace mobject { -} // namespace mobject +}} // namespace mobject diff --git a/src/proc/mobject/output-designation.hpp b/src/proc/mobject/output-designation.hpp index bfd47b8a5..690e2a353 100644 --- a/src/proc/mobject/output-designation.hpp +++ b/src/proc/mobject/output-designation.hpp @@ -32,6 +32,7 @@ extern "C" { #include "lib/luid.h" } +namespace proc { namespace mobject { namespace mp = lumiera::typelist; @@ -116,5 +117,5 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/output-mapping.hpp b/src/proc/mobject/output-mapping.hpp index 182c007e1..7d40ffdc3 100644 --- a/src/proc/mobject/output-mapping.hpp +++ b/src/proc/mobject/output-mapping.hpp @@ -63,6 +63,7 @@ +namespace proc { namespace mobject { namespace { // Helper to extract and rebind definition types @@ -400,5 +401,5 @@ namespace mobject { } -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/parameter.cpp b/src/proc/mobject/parameter.cpp index 854634f49..5a00644ce 100644 --- a/src/proc/mobject/parameter.cpp +++ b/src/proc/mobject/parameter.cpp @@ -25,6 +25,7 @@ #include "proc/mobject/parameter.hpp" #include "proc/mobject/paramprovider.hpp" +namespace proc { namespace mobject { @@ -37,4 +38,4 @@ namespace mobject { -} // namespace mobject +}} // namespace mobject diff --git a/src/proc/mobject/parameter.hpp b/src/proc/mobject/parameter.hpp index 7a0a852d5..fa256d0f6 100644 --- a/src/proc/mobject/parameter.hpp +++ b/src/proc/mobject/parameter.hpp @@ -27,6 +27,7 @@ +namespace proc { namespace mobject { template class ParamProvider; @@ -50,5 +51,5 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/paramprovider.cpp b/src/proc/mobject/paramprovider.cpp index e0fae70a2..9bdeeb452 100644 --- a/src/proc/mobject/paramprovider.cpp +++ b/src/proc/mobject/paramprovider.cpp @@ -25,8 +25,8 @@ #include "proc/mobject/parameter.hpp" #include "proc/mobject/interpolator.hpp" -namespace mobject - { +namespace proc { +namespace mobject { template @@ -36,4 +36,4 @@ namespace mobject -} // namespace mobject +}} // namespace proc::mobject diff --git a/src/proc/mobject/paramprovider.hpp b/src/proc/mobject/paramprovider.hpp index cbf44a779..3be0b2206 100644 --- a/src/proc/mobject/paramprovider.hpp +++ b/src/proc/mobject/paramprovider.hpp @@ -26,8 +26,8 @@ -namespace mobject - { +namespace proc { +namespace mobject { template class Parameter; template class Interpolator; @@ -51,5 +51,5 @@ namespace mobject -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/placement-ref.hpp b/src/proc/mobject/placement-ref.hpp index 338f4ae60..0887296de 100644 --- a/src/proc/mobject/placement-ref.hpp +++ b/src/proc/mobject/placement-ref.hpp @@ -73,7 +73,11 @@ -namespace mobject { +namespace proc { + namespace error = ::lumiera::error; + + namespace mobject { + class MObject; @@ -209,7 +213,7 @@ namespace mobject { { return access(id_).isValid(); } - catch (lumiera::error::Invalid&) {} + catch (error::Invalid&) {} return false; } @@ -262,15 +266,15 @@ namespace mobject { access (_Id const& placementID) { if (!placementID) - throw lumiera::error::Logic ("Attempt to access a NIL PlacementRef" - ,LUMIERA_ERROR_BOTTOM_PLACEMENTREF); + throw error::Logic ("Attempt to access a NIL PlacementRef" + ,LUMIERA_ERROR_BOTTOM_PLACEMENTREF); Placement & genericPlacement (session::SessionServiceFetch::resolveID (placementID)); // may throw REQUIRE (genericPlacement.isValid()); if (!(genericPlacement.template isCompatible())) - throw lumiera::error::Invalid("actual type of the resolved placement is incompatible" - , LUMIERA_ERROR_INVALID_PLACEMENTREF); + throw error::Invalid("actual type of the resolved placement is incompatible" + , LUMIERA_ERROR_INVALID_PLACEMENTREF); ////////////////////////TODO: 1. better message, including type? ////////////////////////TODO: 2. define a separate error-ID for the type mismatch! @@ -284,5 +288,5 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/placement.cpp b/src/proc/mobject/placement.cpp index e0260ef13..6d9e730a1 100644 --- a/src/proc/mobject/placement.cpp +++ b/src/proc/mobject/placement.cpp @@ -31,6 +31,7 @@ using boost::format; using boost::str; +namespace proc { namespace mobject { @@ -81,4 +82,4 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject diff --git a/src/proc/mobject/placement.hpp b/src/proc/mobject/placement.hpp index 52d4bf805..641f9746f 100644 --- a/src/proc/mobject/placement.hpp +++ b/src/proc/mobject/placement.hpp @@ -77,6 +77,7 @@ #include +namespace proc { namespace mobject { namespace session{ class MObjectFactory; } @@ -283,5 +284,5 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/session.hpp b/src/proc/mobject/session.hpp index 22dd59bdf..5b5c90d70 100644 --- a/src/proc/mobject/session.hpp +++ b/src/proc/mobject/session.hpp @@ -62,9 +62,10 @@ +namespace proc { namespace asset { - class Timeline; typedef lumiera::P PTimeline; - class Sequence; typedef lumiera::P PSequence; + class Timeline; typedef P PTimeline; + class Sequence; typedef P PSequence; } namespace mobject { @@ -205,5 +206,5 @@ namespace mobject { } // namespace mobject::session -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/session/abstractmo.cpp b/src/proc/mobject/session/abstractmo.cpp index aba3d7b2f..454a9e8e9 100644 --- a/src/proc/mobject/session/abstractmo.cpp +++ b/src/proc/mobject/session/abstractmo.cpp @@ -26,9 +26,10 @@ #include -using boost::format; using util::isnil; +using boost::format; +namespace proc { namespace mobject { namespace session { @@ -58,4 +59,4 @@ namespace session { } -}} // namespace mobject::session +}}} // namespace mobject::session diff --git a/src/proc/mobject/session/abstractmo.hpp b/src/proc/mobject/session/abstractmo.hpp index 1140f3c39..a06e8d4ca 100644 --- a/src/proc/mobject/session/abstractmo.hpp +++ b/src/proc/mobject/session/abstractmo.hpp @@ -29,9 +29,12 @@ +namespace proc { namespace mobject { namespace session { + namespace error = ::lumiera::error; + /** * abstract base class of all MObjects for providing common services. @@ -67,8 +70,8 @@ namespace session { throwIfInvalid() const { if (!isValid()) - throw lumiera::error::Fatal ("Invalid MObject in model. Indicates a race " - "or similarly broken internal assumptions."); + throw error::Fatal ("Invalid MObject in model. Indicates a race " + "or similarly broken internal assumptions."); } string buildShortID (lib::Literal typeID, string suffix ="") const; @@ -76,5 +79,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/allocation.cpp b/src/proc/mobject/session/allocation.cpp index 03cbfd88d..5a8b50e61 100644 --- a/src/proc/mobject/session/allocation.cpp +++ b/src/proc/mobject/session/allocation.cpp @@ -23,22 +23,19 @@ #include "proc/mobject/session/allocation.hpp" -namespace mobject +namespace proc { +namespace mobject { +namespace session { + + /** @todo probably a placeholder and to be pushed down....*/ + void + Allocation::intersect (LocatingSolution& solution) const { - namespace session - { - - /** @todo probably a placeholder and to be pushed down....*/ - void - Allocation::intersect (LocatingSolution& solution) const - { - LocatingPin::intersect (solution); - - TODO ("work out how the Allocation types solve for the position..."); - } - - - - } // namespace mobject::session - -} // namespace mobject + LocatingPin::intersect (solution); + + TODO ("work out how the Allocation types solve for the position..."); + } + + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/allocation.hpp b/src/proc/mobject/session/allocation.hpp index a1a668b9d..03f3d302d 100644 --- a/src/proc/mobject/session/allocation.hpp +++ b/src/proc/mobject/session/allocation.hpp @@ -21,8 +21,8 @@ */ -#ifndef MOBJECT_SESSION_ALLOCATION_H -#define MOBJECT_SESSION_ALLOCATION_H +#ifndef PROC_MOBJECT_SESSION_ALLOCATION_H +#define PROC_MOBJECT_SESSION_ALLOCATION_H #include @@ -32,35 +32,32 @@ using std::string; -namespace mobject - { - namespace session +namespace proc { +namespace mobject { +namespace session { + + + /** + * Interface (abstract): any objective, constraint or wish + * of placing a MObject in a specific way. + */ + class Allocation : public LocatingPin { - - - /** - * Interface (abstract): any objective, constraint or wish - * of placing a MObject in a specific way. - */ - class Allocation : public LocatingPin - { - protected: - /** human readable representation of the condition - * characterizing this allocaton, e.g. "t >= 10" - */ - string repr; - - virtual void intersect (LocatingSolution&) const; - - public: - const string& getRepr () const { return repr; } - - virtual Allocation* clone () const = 0; - }; - - - - } // namespace mobject::session - -} // namespace mobject + protected: + /** human readable representation of the condition + * characterising this allocation, e.g. "t >= 10" + */ + string repr; + + virtual void intersect (LocatingSolution&) const; + + public: + const string& getRepr () const { return repr; } + + virtual Allocation* clone () const = 0; + }; + + + +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/auto.cpp b/src/proc/mobject/session/auto.cpp index b46ea5cae..54032b633 100644 --- a/src/proc/mobject/session/auto.cpp +++ b/src/proc/mobject/session/auto.cpp @@ -23,22 +23,19 @@ #include "proc/mobject/session/auto.hpp" -namespace mobject +namespace proc { +namespace mobject { +namespace session { + + + template + VAL + Auto::getValue () { - namespace session - { - - - template - VAL - Auto::getValue () - { - return 0; //////////////TODO - } - - - - - } // namespace mobject::session - -} // namespace mobject + return 0; //////////////TODO + } + + + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/auto.hpp b/src/proc/mobject/session/auto.hpp index 24b82ba9c..152baa851 100644 --- a/src/proc/mobject/session/auto.hpp +++ b/src/proc/mobject/session/auto.hpp @@ -21,42 +21,39 @@ */ -#ifndef MOBJECT_SESSION_AUTO_H -#define MOBJECT_SESSION_AUTO_H +#ifndef PROC_MOBJECT_SESSION_AUTO_H +#define PROC_MOBJECT_SESSION_AUTO_H #include "proc/mobject/session/meta.hpp" #include "proc/mobject/paramprovider.hpp" -namespace mobject - { - namespace session +namespace proc { +namespace mobject { +namespace session { + + + /** + * Automation data for some parameter + * (i.e. the parameter is a time varying function) + */ + template + class Auto : public Meta, public ParamProvider { - - - /** - * Automation data for some parameter - * (i.e. the parameter is a time varying function) - */ - template - class Auto : public Meta, public ParamProvider - { - string - initShortID() const - { - return buildShortID("Auto"); - } - - public: - //////////////////////////////TICKET #566 - - virtual VAL getValue () ; - }; + string + initShortID() const + { + return buildShortID("Auto"); + } + + public: + //////////////////////////////TICKET #566 + + virtual VAL getValue () ; + }; - } // namespace mobject::session - -} // namespace mobject +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/binding.cpp b/src/proc/mobject/session/binding.cpp index 9a763129a..5451f59d3 100644 --- a/src/proc/mobject/session/binding.cpp +++ b/src/proc/mobject/session/binding.cpp @@ -24,6 +24,7 @@ #include "proc/mobject/session/binding.hpp" #include "proc/asset/sequence.hpp" +namespace proc { namespace mobject { namespace session { @@ -49,4 +50,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/binding.hpp b/src/proc/mobject/session/binding.hpp index 0b790da9c..3ef96af36 100644 --- a/src/proc/mobject/session/binding.hpp +++ b/src/proc/mobject/session/binding.hpp @@ -21,17 +21,18 @@ */ -#ifndef MOBJECT_SESSION_BINDING_H -#define MOBJECT_SESSION_BINDING_H +#ifndef PROC_MOBJECT_SESSION_BINDING_H +#define PROC_MOBJECT_SESSION_BINDING_H #include "proc/mobject/session/meta.hpp" #include "proc/mobject/builder/buildertool.hpp" +namespace proc { namespace asset { class Sequence; - typedef lumiera::P PSequence; + typedef P PSequence; } @@ -71,5 +72,5 @@ namespace session { template class Placement; typedef Placement PBinding; -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/session/bus-mo.cpp b/src/proc/mobject/session/bus-mo.cpp index 1ea99c15c..ac06ee6c0 100644 --- a/src/proc/mobject/session/bus-mo.cpp +++ b/src/proc/mobject/session/bus-mo.cpp @@ -23,6 +23,7 @@ #include "proc/mobject/session/bus-mo.hpp" +namespace proc { namespace mobject { namespace session { @@ -47,4 +48,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/bus-mo.hpp b/src/proc/mobject/session/bus-mo.hpp index 30d5c3ae6..42509f1f6 100644 --- a/src/proc/mobject/session/bus-mo.hpp +++ b/src/proc/mobject/session/bus-mo.hpp @@ -21,13 +21,14 @@ */ -#ifndef MOBJECT_SESSION_BUS_MO_H -#define MOBJECT_SESSION_BUS_MO_H +#ifndef PROC_MOBJECT_SESSION_BUS_MO_H +#define PROC_MOBJECT_SESSION_BUS_MO_H #include "proc/mobject/session/meta.hpp" #include "proc/mobject/builder/buildertool.hpp" +namespace proc { namespace asset { class Pipe; @@ -71,5 +72,5 @@ namespace session { template class Placement; typedef Placement PBus; -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/session/clip.cpp b/src/proc/mobject/session/clip.cpp index 426cd8e57..bb5fdeb74 100644 --- a/src/proc/mobject/session/clip.cpp +++ b/src/proc/mobject/session/clip.cpp @@ -31,6 +31,7 @@ using lib::time::Mutation; using util::isnil; +namespace proc { namespace mobject { namespace session { @@ -82,5 +83,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/clip.hpp b/src/proc/mobject/session/clip.hpp index 52e134926..c6e2a3ba9 100644 --- a/src/proc/mobject/session/clip.hpp +++ b/src/proc/mobject/session/clip.hpp @@ -21,13 +21,14 @@ */ -#ifndef MOBJECT_SESSION_CLIP_H -#define MOBJECT_SESSION_CLIP_H +#ifndef PROC_MOBJECT_SESSION_CLIP_H +#define PROC_MOBJECT_SESSION_CLIP_H #include "proc/mobject/session/abstractmo.hpp" #include "lib/time/timevalue.hpp" +namespace proc { namespace asset { class Media; class Clip; @@ -101,10 +102,10 @@ namespace session { DEFINE_PROCESSABLE_BY (builder::BuilderTool); }; - + typedef Placement PClipMO; -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/compoundclip.cpp b/src/proc/mobject/session/compoundclip.cpp deleted file mode 100644 index 6de47a052..000000000 --- a/src/proc/mobject/session/compoundclip.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - CompoundClip - compound of several clips (multichannel) - - Copyright (C) Lumiera.org - 2008, Hermann Vosseler - - 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 "proc/mobject/session/compoundclip.hpp" - -namespace mobject - { - - namespace session - { - - /** */ - - - - } // namespace mobject::session - -} // namespace mobject diff --git a/src/proc/mobject/session/compoundclip.hpp b/src/proc/mobject/session/compoundclip.hpp deleted file mode 100644 index 9e4f32f77..000000000 --- a/src/proc/mobject/session/compoundclip.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - COMPOUNDCLIP.hpp - compound of several clips (multichannel) - - Copyright (C) Lumiera.org - 2008, Hermann Vosseler - - 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. - -*/ - - -#ifndef MOBJECT_SESSION_COMPOUNDCLIP_H -#define MOBJECT_SESSION_COMPOUNDCLIP_H - -#include "proc/mobject/session/clip.hpp" - - - -namespace mobject - { - - namespace session - { - - - /** - * Clip MObject which is actually a compound of several elementary clips, - * e.g. the several streams found within multichannels media. - */ - class CompoundClip : public Clip - { - protected: - Clip* components; - - }; - - - } // namespace mobject::session - -} // namespace mobject -#endif diff --git a/src/proc/mobject/session/constraint.cpp b/src/proc/mobject/session/constraint.cpp index 4a1241cf3..1bedefbe1 100644 --- a/src/proc/mobject/session/constraint.cpp +++ b/src/proc/mobject/session/constraint.cpp @@ -23,15 +23,12 @@ #include "proc/mobject/session/constraint.hpp" -namespace mobject - { - namespace session - { - - /** */ - - - - } // namespace mobject::session - -} // namespace mobject +namespace proc { +namespace mobject { +namespace session { + + /** */ + + + +}}} // namespace mobject::session diff --git a/src/proc/mobject/session/constraint.hpp b/src/proc/mobject/session/constraint.hpp index eabddc617..827a48fc1 100644 --- a/src/proc/mobject/session/constraint.hpp +++ b/src/proc/mobject/session/constraint.hpp @@ -21,27 +21,24 @@ */ -#ifndef MOBJECT_SESSION_CONSTRAINT_H -#define MOBJECT_SESSION_CONSTRAINT_H +#ifndef PROC_MOBJECT_SESSION_CONSTRAINT_H +#define PROC_MOBJECT_SESSION_CONSTRAINT_H #include "proc/mobject/session/allocation.hpp" -namespace mobject - { - namespace session - { - - - /** - * LocatingPin representing an directive by the user - * that must not be violated - */ - class Constraint : public Allocation - {}; - - } // namespace mobject::session - -} // namespace mobject +namespace proc { +namespace mobject { +namespace session { + + + /** + * LocatingPin representing an directive by the user + * that must not be violated + */ + class Constraint : public Allocation + {}; + +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/defs-manager.cpp b/src/proc/mobject/session/defs-manager.cpp index 5dd350947..4c762d6c1 100644 --- a/src/proc/mobject/session/defs-manager.cpp +++ b/src/proc/mobject/session/defs-manager.cpp @@ -35,10 +35,10 @@ using lumiera::query::QueryHandler; using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY; +namespace proc { namespace mobject { namespace session { - using lumiera::P; @@ -127,7 +127,7 @@ namespace session { return res; } -}} // namespace mobject::session +}}} // namespace mobject::session @@ -144,6 +144,7 @@ namespace session { #include "proc/asset/sequence.hpp" #include "proc/mobject/session/track.hpp" +namespace proc { namespace mobject { namespace session { @@ -170,4 +171,4 @@ namespace session { template bool DefsManager::forget (PPipe const&); -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/defs-manager.hpp b/src/proc/mobject/session/defs-manager.hpp index 0fbcb1ab5..fd473a625 100644 --- a/src/proc/mobject/session/defs-manager.hpp +++ b/src/proc/mobject/session/defs-manager.hpp @@ -21,8 +21,8 @@ */ -#ifndef MOBJECT_SESSION_DEFS_MANAGER_H -#define MOBJECT_SESSION_DEFS_MANAGER_H +#ifndef PROC_MOBJECT_SESSION_DEFS_MANAGER_H +#define PROC_MOBJECT_SESSION_DEFS_MANAGER_H #include "lib/p.hpp" @@ -33,11 +33,13 @@ +namespace proc { namespace mobject { namespace session { - using lumiera::P; + using lib::P; + using ::lumiera::Query; using boost::scoped_ptr; namespace impl { class DefsRegistry; } @@ -72,14 +74,14 @@ namespace session { * is considered \e misconfiguration. */ template - P operator() (lumiera::Query const&); + P operator() (Query const&); /** search through the registered defaults, never create anything. * @return object fulfilling the query, \c empty ptr if not found. */ template - P search (lumiera::Query const&); + P search (Query const&); /** retrieve an object fulfilling the query and register it as default. * The resolution is delegated to the ConfigQuery system (which may cause @@ -87,7 +89,7 @@ namespace session { * @return object fulfilling the query, \c empty ptr if no solution. */ template - P create (lumiera::Query const&); + P create (Query const&); /** register the given object as default, after ensuring it fulfils the * query. The latter may cause some properties of the object to be set, @@ -96,7 +98,7 @@ namespace session { * @note only a weak ref to the object is stored */ template - bool define (P const&, lumiera::Query const& =lumiera::Query()); + bool define (P const&, Query const& =Query()); /** remove the defaults registration of the given object, if there was such * @return false if nothing has been changed because the object wasn't registered @@ -124,5 +126,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/defs-registry.hpp b/src/proc/mobject/session/defs-registry.hpp index a6fc169cb..53bfa7a93 100644 --- a/src/proc/mobject/session/defs-registry.hpp +++ b/src/proc/mobject/session/defs-registry.hpp @@ -36,8 +36,8 @@ -#ifndef MOBJECT_SESSION_DEFS_REGISTRY_H -#define MOBJECT_SESSION_DEFS_REGISTRY_H +#ifndef PROC_MOBJECT_SESSION_DEFS_REGISTRY_H +#define PROC_MOBJECT_SESSION_DEFS_REGISTRY_H #include "lib/sync-classlock.hpp" @@ -54,10 +54,11 @@ #include +namespace proc { namespace mobject { namespace session { - using lumiera::P; + using lib::P; using lumiera::Query; using lib::ClassLock; using std::tr1::weak_ptr; @@ -340,5 +341,5 @@ namespace session { using impl::DefsRegistry; -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/effect.cpp b/src/proc/mobject/session/effect.cpp index d190274dd..fe78b195b 100644 --- a/src/proc/mobject/session/effect.cpp +++ b/src/proc/mobject/session/effect.cpp @@ -23,22 +23,19 @@ #include "proc/mobject/session/effect.hpp" -namespace mobject +namespace proc { +namespace mobject { +namespace session { + + /** + * @TODO: clarify asset->mobject relation and asset dependencies; Ticket #255 + */ + asset::Proc const& + Effect::getProcAsset() const { - namespace session - { - - /** - * @TODO: clarify asset->mobject relation and asset dependencies; Ticket #255 - */ - asset::Proc const& - Effect::getProcAsset() const - { - UNIMPLEMENTED ("how to access the processing asset assotiated to a given Effect-MObject"); - } - - - - } // namespace mobject::session - -} // namespace mobject + UNIMPLEMENTED ("how to access the processing asset assotiated to a given Effect-MObject"); + } + + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/effect.hpp b/src/proc/mobject/session/effect.hpp index 9c22e847e..c1a84b31b 100644 --- a/src/proc/mobject/session/effect.hpp +++ b/src/proc/mobject/session/effect.hpp @@ -21,8 +21,8 @@ */ -#ifndef MOBJECT_SESSION_EFFECT_H -#define MOBJECT_SESSION_EFFECT_H +#ifndef PROC_MOBJECT_SESSION_EFFECT_H +#define PROC_MOBJECT_SESSION_EFFECT_H #include "proc/mobject/session/abstractmo.hpp" @@ -33,7 +33,7 @@ using std::string; - +namespace proc { namespace mobject { namespace session { @@ -64,5 +64,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/element-query.hpp b/src/proc/mobject/session/element-query.hpp index fbb3fbe3a..d99b9669f 100644 --- a/src/proc/mobject/session/element-query.hpp +++ b/src/proc/mobject/session/element-query.hpp @@ -21,8 +21,8 @@ */ -#ifndef MOBJECT_SESSION_ELEMENT_QUERY_H -#define MOBJECT_SESSION_ELEMENT_QUERY_H +#ifndef PROC_MOBJECT_SESSION_ELEMENT_QUERY_H +#define PROC_MOBJECT_SESSION_ELEMENT_QUERY_H #include "proc/mobject/placement.hpp" @@ -35,6 +35,7 @@ +namespace proc { namespace mobject { namespace session { @@ -126,5 +127,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/fixedlocation.cpp b/src/proc/mobject/session/fixedlocation.cpp index 1cd7eb98c..59bd299b9 100644 --- a/src/proc/mobject/session/fixedlocation.cpp +++ b/src/proc/mobject/session/fixedlocation.cpp @@ -23,37 +23,35 @@ #include "proc/mobject/session/fixedlocation.hpp" -namespace mobject +namespace proc { +namespace mobject { +namespace session { + + + FixedLocation* + FixedLocation::clone () const + { + return new FixedLocation (*this); + } + + + /** */ + void + FixedLocation::intersect (LocatingSolution& solution) const { - namespace session - { - - FixedLocation* - FixedLocation::clone () const - { - return new FixedLocation (*this); - } + LocatingPin::intersect (solution); - - /** */ - void - FixedLocation::intersect (LocatingSolution& solution) const - { - LocatingPin::intersect (solution); - - TODO ("either set position or make overconstrained"); - if (solution.minTime <= this->time_) - solution.minTime = this->time_; - else - solution.impo = true; - if (solution.maxTime >= this->time_) - solution.maxTime = this->time_; - else - solution.impo = true; - } - - - - } // namespace mobject::session - -} // namespace mobject + TODO ("either set position or make overconstrained"); + if (solution.minTime <= this->time_) + solution.minTime = this->time_; + else + solution.impo = true; + if (solution.maxTime >= this->time_) + solution.maxTime = this->time_; + else + solution.impo = true; + } + + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/fixedlocation.hpp b/src/proc/mobject/session/fixedlocation.hpp index ab9b9cc6d..531669ded 100644 --- a/src/proc/mobject/session/fixedlocation.hpp +++ b/src/proc/mobject/session/fixedlocation.hpp @@ -21,20 +21,20 @@ */ -#ifndef MOBJECT_SESSION_FIXEDLOCATION_H -#define MOBJECT_SESSION_FIXEDLOCATION_H +#ifndef PROC_MOBJECT_SESSION_FIXEDLOCATION_H +#define PROC_MOBJECT_SESSION_FIXEDLOCATION_H #include "proc/mobject/session/locatingpin.hpp" -namespace mobject - { - class ExplicitPlacement; //TODO trac #100 +namespace proc { +namespace mobject { + + class ExplicitPlacement; //TODO trac #100 + + namespace session { - namespace session - { - /** * The most common case of positioning a MObject * in the Session: directly specifying a constant position. @@ -59,10 +59,8 @@ namespace mobject virtual FixedLocation* clone () const; }; - - - - } // namespace mobject::session - -} // namespace mobject + + + +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/fixture.cpp b/src/proc/mobject/session/fixture.cpp index 053bd3827..3f4aac79e 100644 --- a/src/proc/mobject/session/fixture.cpp +++ b/src/proc/mobject/session/fixture.cpp @@ -24,6 +24,7 @@ #include "proc/mobject/session/fixture.hpp" #include "include/logging.h" +namespace proc { namespace mobject { namespace session { @@ -54,8 +55,8 @@ namespace session { TODO ("actually do a self-verification of the Fixture"); return true; } - - - - -}} // namespace mobject::session + + + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/fixture.hpp b/src/proc/mobject/session/fixture.hpp index d6ecdc847..201d5a425 100644 --- a/src/proc/mobject/session/fixture.hpp +++ b/src/proc/mobject/session/fixture.hpp @@ -39,11 +39,12 @@ using std::tr1::shared_ptr; +namespace proc { namespace mobject { namespace session { - - - + + + class Fixture : boost::noncopyable { @@ -74,5 +75,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/generator-mo.cpp b/src/proc/mobject/session/generator-mo.cpp index 728e58b94..a57ff41c9 100644 --- a/src/proc/mobject/session/generator-mo.cpp +++ b/src/proc/mobject/session/generator-mo.cpp @@ -31,6 +31,7 @@ //using lib::time::Mutation; //using util::isnil; +namespace proc { namespace mobject { namespace session { @@ -41,5 +42,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace mobject::session diff --git a/src/proc/mobject/session/generator-mo.hpp b/src/proc/mobject/session/generator-mo.hpp index 876a497f3..c0c64a4f9 100644 --- a/src/proc/mobject/session/generator-mo.hpp +++ b/src/proc/mobject/session/generator-mo.hpp @@ -21,13 +21,14 @@ */ -#ifndef MOBJECT_SESSION_GENERATOR_MO_H -#define MOBJECT_SESSION_GENERATOR_MO_H +#ifndef PROC_MOBJECT_SESSION_GENERATOR_MO_H +#define PROC_MOBJECT_SESSION_GENERATOR_MO_H #include "proc/mobject/session/abstractmo.hpp" #include "lib/time/timevalue.hpp" +namespace proc { namespace asset { class Media; class Clip; @@ -87,5 +88,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/label.cpp b/src/proc/mobject/session/label.cpp index 58e3cd86f..3ffa028e6 100644 --- a/src/proc/mobject/session/label.cpp +++ b/src/proc/mobject/session/label.cpp @@ -26,6 +26,7 @@ using util::isnil; +namespace proc { namespace mobject { namespace session { @@ -39,4 +40,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/label.hpp b/src/proc/mobject/session/label.hpp index df790d74f..74c7e0bae 100644 --- a/src/proc/mobject/session/label.hpp +++ b/src/proc/mobject/session/label.hpp @@ -21,14 +21,15 @@ */ -#ifndef MOBJECT_SESSION_LABEL_H -#define MOBJECT_SESSION_LABEL_H +#ifndef PROC_MOBJECT_SESSION_LABEL_H +#define PROC_MOBJECT_SESSION_LABEL_H #include "proc/mobject/session/meta.hpp" #include "lib/symbol.hpp" +namespace proc { namespace mobject { namespace session { @@ -68,5 +69,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/lifecycle-advisor.hpp b/src/proc/mobject/session/lifecycle-advisor.hpp index 0e8364fae..7955ada11 100644 --- a/src/proc/mobject/session/lifecycle-advisor.hpp +++ b/src/proc/mobject/session/lifecycle-advisor.hpp @@ -46,8 +46,8 @@ */ -#ifndef MOBJECT_SESSION_LIFECYCLE_ADVISOR_H -#define MOBJECT_SESSION_LIFECYCLE_ADVISOR_H +#ifndef PROC_MOBJECT_SESSION_LIFECYCLE_ADVISOR_H +#define PROC_MOBJECT_SESSION_LIFECYCLE_ADVISOR_H #include "lib/error.hpp" #include "include/lifecycle.h" @@ -57,6 +57,7 @@ #include +namespace proc { namespace mobject { namespace session { @@ -180,5 +181,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace mobject::session #endif diff --git a/src/proc/mobject/session/locatingpin.cpp b/src/proc/mobject/session/locatingpin.cpp index 059e38290..93f6437e5 100644 --- a/src/proc/mobject/session/locatingpin.cpp +++ b/src/proc/mobject/session/locatingpin.cpp @@ -28,6 +28,7 @@ #include "proc/mobject/session/relativelocation.hpp" +namespace proc { namespace mobject { namespace session { @@ -198,4 +199,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/locatingpin.hpp b/src/proc/mobject/session/locatingpin.hpp index dc58ac944..52b0f2add 100644 --- a/src/proc/mobject/session/locatingpin.hpp +++ b/src/proc/mobject/session/locatingpin.hpp @@ -43,8 +43,8 @@ -#ifndef MOBJECT_SESSION_LOCATINGPIN_H -#define MOBJECT_SESSION_LOCATINGPIN_H +#ifndef PROC_MOBJECT_SESSION_LOCATINGPIN_H +#define PROC_MOBJECT_SESSION_LOCATINGPIN_H #include "proc/common.hpp" @@ -57,6 +57,7 @@ using boost::scoped_ptr; +namespace proc { namespace asset { class Pipe; } namespace mobject { @@ -187,7 +188,5 @@ protected: - } // namespace mobject::session - -} // namespace mobject +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/meta.cpp b/src/proc/mobject/session/meta.cpp index 88d87c443..275e585aa 100644 --- a/src/proc/mobject/session/meta.cpp +++ b/src/proc/mobject/session/meta.cpp @@ -23,15 +23,12 @@ #include "proc/mobject/session/meta.hpp" -namespace mobject - { - namespace session - { - - /** */ - - - - } // namespace mobject::session - -} // namespace mobject +namespace proc { +namespace mobject { +namespace session { + + /** */ + + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/meta.hpp b/src/proc/mobject/session/meta.hpp index 3015bb127..db49c9ed5 100644 --- a/src/proc/mobject/session/meta.hpp +++ b/src/proc/mobject/session/meta.hpp @@ -21,17 +21,17 @@ */ -#ifndef MOBJECT_SESSION_META_H -#define MOBJECT_SESSION_META_H +#ifndef PROC_MOBJECT_SESSION_META_H +#define PROC_MOBJECT_SESSION_META_H #include "proc/mobject/session/abstractmo.hpp" - +namespace proc { namespace mobject { namespace session { - - + + /** * Meta-MObject doesn't represent real Media Content, * but rather all sorts of Processing Instructions @@ -53,5 +53,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace mobject::session #endif diff --git a/src/proc/mobject/session/mobjectfactory.cpp b/src/proc/mobject/session/mobjectfactory.cpp index 8c47a3d8e..4890e3c3a 100644 --- a/src/proc/mobject/session/mobjectfactory.cpp +++ b/src/proc/mobject/session/mobjectfactory.cpp @@ -31,6 +31,7 @@ #include "proc/asset/clip.hpp" #include "proc/asset/effect.hpp" +namespace proc { namespace mobject { namespace session { ////////////////////////////////////////////////////////////////////////////////TICKET #414 @@ -107,4 +108,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace mobject::session diff --git a/src/proc/mobject/session/mobjectfactory.hpp b/src/proc/mobject/session/mobjectfactory.hpp index 82efd7c0c..217ddd33d 100644 --- a/src/proc/mobject/session/mobjectfactory.hpp +++ b/src/proc/mobject/session/mobjectfactory.hpp @@ -21,8 +21,8 @@ */ -#ifndef MOBJECT_SESSION_MOBJECTFACTORY_H -#define MOBJECT_SESSION_MOBJECTFACTORY_H +#ifndef PROC_MOBJECT_SESSION_MOBJECTFACTORY_H +#define PROC_MOBJECT_SESSION_MOBJECTFACTORY_H #include "proc/mobject/mobject.hpp" #include "proc/asset/entry-id.hpp" @@ -30,6 +30,7 @@ +namespace proc { namespace asset { class Clip; @@ -76,5 +77,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/placement-index-query-resolver.cpp b/src/proc/mobject/session/placement-index-query-resolver.cpp index 35fa5ecdc..4eda27cf0 100644 --- a/src/proc/mobject/session/placement-index-query-resolver.cpp +++ b/src/proc/mobject/session/placement-index-query-resolver.cpp @@ -33,6 +33,7 @@ #include +namespace proc { namespace mobject { namespace session { @@ -396,4 +397,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/placement-index-query-resolver.hpp b/src/proc/mobject/session/placement-index-query-resolver.hpp index bac26d96d..b451e7c7e 100644 --- a/src/proc/mobject/session/placement-index-query-resolver.hpp +++ b/src/proc/mobject/session/placement-index-query-resolver.hpp @@ -63,6 +63,7 @@ #include +namespace proc { namespace mobject { namespace session { @@ -113,5 +114,5 @@ namespace session { }; -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/placement-index.cpp b/src/proc/mobject/session/placement-index.cpp index fab3adda6..8554674dd 100644 --- a/src/proc/mobject/session/placement-index.cpp +++ b/src/proc/mobject/session/placement-index.cpp @@ -68,6 +68,7 @@ #include +namespace proc { namespace mobject { namespace session { @@ -728,4 +729,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/placement-index.hpp b/src/proc/mobject/session/placement-index.hpp index 9dbc283ae..2d0fbea69 100644 --- a/src/proc/mobject/session/placement-index.hpp +++ b/src/proc/mobject/session/placement-index.hpp @@ -102,8 +102,8 @@ -#ifndef MOBJECT_PLACEMENT_INDEX_H -#define MOBJECT_PLACEMENT_INDEX_H +#ifndef PROC_MOBJECT_PLACEMENT_INDEX_H +#define PROC_MOBJECT_PLACEMENT_INDEX_H #include "lib/util.hpp" #include "lib/error.hpp" @@ -117,6 +117,7 @@ #include +namespace proc { namespace mobject { class MObject; @@ -326,5 +327,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/plug.cpp b/src/proc/mobject/session/plug.cpp index d642ed1e3..0e449c9fc 100644 --- a/src/proc/mobject/session/plug.cpp +++ b/src/proc/mobject/session/plug.cpp @@ -24,15 +24,12 @@ #include "proc/mobject/session/plug.hpp" #include "proc/asset/pipe.hpp" -namespace mobject - { - namespace session - { - - /** */ - - - - } // namespace mobject::session - -} // namespace mobject +namespace proc { +namespace mobject { +namespace session { + + /** */ + + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/plug.hpp b/src/proc/mobject/session/plug.hpp index fb0835c55..315a582c0 100644 --- a/src/proc/mobject/session/plug.hpp +++ b/src/proc/mobject/session/plug.hpp @@ -28,25 +28,22 @@ +namespace proc { namespace asset { class Pipe; } -namespace mobject - { - namespace session +namespace mobject { +namespace session { + + /** + * LocatingPin for requesting connection to some Pipe + */ + class Plug : public Wish { - - /** - * LocatingPin for requesting connection to some Pipe - */ - class Plug : public Wish - { - protected: - /** the Pipe this MObject wants to be conected to */ - asset::Pipe* outPipe; ////////////////////////////////TODO: shared_ptr - - }; - - } // namespace mobject::session - -} // namespace mobject + protected: + /** the Pipe this MObject wants to be conected to */ + asset::Pipe* outPipe; ////////////////////////////////TODO: shared_ptr + + }; + +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/query-focus-stack.hpp b/src/proc/mobject/session/query-focus-stack.hpp index 42dedc962..e6c2e79c9 100644 --- a/src/proc/mobject/session/query-focus-stack.hpp +++ b/src/proc/mobject/session/query-focus-stack.hpp @@ -32,6 +32,7 @@ using std::list; +namespace proc { namespace mobject { namespace session { @@ -192,5 +193,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace mobject::session #endif diff --git a/src/proc/mobject/session/query-focus.cpp b/src/proc/mobject/session/query-focus.cpp index 2972d2f35..5ab530589 100644 --- a/src/proc/mobject/session/query-focus.cpp +++ b/src/proc/mobject/session/query-focus.cpp @@ -30,6 +30,7 @@ using boost::format; using boost::str; +namespace proc { namespace mobject { namespace session { @@ -170,4 +171,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/query-focus.hpp b/src/proc/mobject/session/query-focus.hpp index 9fc74decc..e8fcfbc2a 100644 --- a/src/proc/mobject/session/query-focus.hpp +++ b/src/proc/mobject/session/query-focus.hpp @@ -32,6 +32,7 @@ #include #include +namespace proc { namespace mobject { namespace session { @@ -194,5 +195,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/query-resolver.cpp b/src/proc/mobject/session/query-resolver.cpp index 787c58f6d..eeeef53ad 100644 --- a/src/proc/mobject/session/query-resolver.cpp +++ b/src/proc/mobject/session/query-resolver.cpp @@ -24,6 +24,7 @@ #include "proc/mobject/session/query-resolver.hpp" #include "lib/multifact-arg.hpp" +namespace proc { namespace mobject { namespace session { @@ -122,4 +123,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/query-resolver.hpp b/src/proc/mobject/session/query-resolver.hpp index eedd6811a..18908d760 100644 --- a/src/proc/mobject/session/query-resolver.hpp +++ b/src/proc/mobject/session/query-resolver.hpp @@ -41,6 +41,7 @@ //using std::vector; //using std::string; +namespace proc { namespace mobject { namespace session { @@ -335,5 +336,5 @@ namespace session { } -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/relativelocation.cpp b/src/proc/mobject/session/relativelocation.cpp index 557d3b66d..1d40b67ca 100644 --- a/src/proc/mobject/session/relativelocation.cpp +++ b/src/proc/mobject/session/relativelocation.cpp @@ -24,27 +24,24 @@ #include "proc/mobject/session/relativelocation.hpp" #include "proc/mobject/mobject.hpp" -namespace mobject +namespace proc { +namespace mobject { +namespace session { + + RelativeLocation* + RelativeLocation::clone () const + { + return new RelativeLocation (*this); + } + + + void + RelativeLocation::intersect (LocatingSolution& solution) const { - namespace session - { - - RelativeLocation* - RelativeLocation::clone () const - { - return new RelativeLocation (*this); - } + LocatingPin::intersect (solution); - - void - RelativeLocation::intersect (LocatingSolution& solution) const - { - LocatingPin::intersect (solution); - - TODO ("either set position or make overconstrained"); - } - - - } // namespace mobject::session - -} // namespace mobject + TODO ("either set position or make overconstrained"); + } + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/relativelocation.hpp b/src/proc/mobject/session/relativelocation.hpp index bea3e134b..09eb45bfe 100644 --- a/src/proc/mobject/session/relativelocation.hpp +++ b/src/proc/mobject/session/relativelocation.hpp @@ -30,6 +30,7 @@ +namespace proc { namespace mobject { namespace session { @@ -79,5 +80,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/root.cpp b/src/proc/mobject/session/root.cpp index 5b6aa6290..32ac83494 100644 --- a/src/proc/mobject/session/root.cpp +++ b/src/proc/mobject/session/root.cpp @@ -25,6 +25,7 @@ #include "proc/mobject/session/defs-manager.hpp" +namespace proc { namespace mobject { namespace session { @@ -52,4 +53,4 @@ namespace session { /////////////////////////////////TODO more to come..... -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/root.hpp b/src/proc/mobject/session/root.hpp index c8dc18631..2169b9334 100644 --- a/src/proc/mobject/session/root.hpp +++ b/src/proc/mobject/session/root.hpp @@ -21,13 +21,14 @@ */ -#ifndef MOBJECT_SESSION_ROOT_H -#define MOBJECT_SESSION_ROOT_H +#ifndef PROC_MOBJECT_SESSION_ROOT_H +#define PROC_MOBJECT_SESSION_ROOT_H #include "proc/mobject/session/meta.hpp" #include "proc/mobject/builder/buildertool.hpp" +namespace proc { namespace mobject { namespace session { @@ -50,10 +51,10 @@ namespace session { class Root : public Meta { DefsManager& defaults_; - + ///////////TODO: timespan fields here or already in class Meta?? ///////////TODO: any idea about the purpose of root's "timespan"?? ///////TICKET #448 - + string initShortID() const { @@ -76,5 +77,5 @@ namespace session { template class Placement; typedef Placement PRoot; -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/session/scope-locator.hpp b/src/proc/mobject/session/scope-locator.hpp index a3c427722..183b8ebd4 100644 --- a/src/proc/mobject/session/scope-locator.hpp +++ b/src/proc/mobject/session/scope-locator.hpp @@ -21,8 +21,8 @@ */ -#ifndef MOBJECT_SESSION_SCOPE_LOCATOR_H -#define MOBJECT_SESSION_SCOPE_LOCATOR_H +#ifndef PROC_MOBJECT_SESSION_SCOPE_LOCATOR_H +#define PROC_MOBJECT_SESSION_SCOPE_LOCATOR_H #include "proc/mobject/session/scope.hpp" #include "proc/mobject/session/scope-query.hpp" @@ -33,6 +33,7 @@ #include +namespace proc { namespace mobject { namespace session { @@ -147,5 +148,5 @@ namespace session { } -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/scope-path.cpp b/src/proc/mobject/session/scope-path.cpp index 5c750d920..44ec04c2d 100644 --- a/src/proc/mobject/session/scope-path.cpp +++ b/src/proc/mobject/session/scope-path.cpp @@ -33,6 +33,7 @@ #include +namespace proc { namespace mobject { namespace session { @@ -340,4 +341,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace mobject::session diff --git a/src/proc/mobject/session/scope-path.hpp b/src/proc/mobject/session/scope-path.hpp index da23516d8..5546037f5 100644 --- a/src/proc/mobject/session/scope-path.hpp +++ b/src/proc/mobject/session/scope-path.hpp @@ -84,8 +84,8 @@ */ -#ifndef MOBJECT_SESSION_SCOPE_PATH_H -#define MOBJECT_SESSION_SCOPE_PATH_H +#ifndef PROC_MOBJECT_SESSION_SCOPE_PATH_H +#define PROC_MOBJECT_SESSION_SCOPE_PATH_H #include "proc/mobject/session/scope.hpp" #include "lib/bool-checkable.hpp" @@ -99,7 +99,7 @@ namespace lib { namespace iter{ - using mobject::session::Scope; + using proc::mobject::session::Scope; /** * this explicit specialisation allows to build a RangeIter @@ -118,6 +118,7 @@ namespace iter{ }; }} +namespace proc { namespace mobject { namespace session { @@ -297,5 +298,5 @@ namespace session { } -}} // namespace mobject::session +}}} // namespace mobject::session #endif diff --git a/src/proc/mobject/session/scope-query.hpp b/src/proc/mobject/session/scope-query.hpp index 166e2615a..1c153ba48 100644 --- a/src/proc/mobject/session/scope-query.hpp +++ b/src/proc/mobject/session/scope-query.hpp @@ -38,8 +38,8 @@ -#ifndef MOBJECT_SESSION_SCOPE_QUERY_H -#define MOBJECT_SESSION_SCOPE_QUERY_H +#ifndef PROC_MOBJECT_SESSION_SCOPE_QUERY_H +#define PROC_MOBJECT_SESSION_SCOPE_QUERY_H #include "proc/mobject/placement.hpp" @@ -48,6 +48,7 @@ #include +namespace proc { namespace mobject { namespace session { @@ -211,5 +212,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/scope.cpp b/src/proc/mobject/session/scope.cpp index 24b684a03..6b27c9a86 100644 --- a/src/proc/mobject/session/scope.cpp +++ b/src/proc/mobject/session/scope.cpp @@ -52,6 +52,7 @@ using std::vector; using lib::IterSource; using lib::iter_source::wrapIter; +namespace proc { namespace mobject { namespace session { @@ -253,4 +254,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/scope.hpp b/src/proc/mobject/session/scope.hpp index d3b463dc2..20651ceb2 100644 --- a/src/proc/mobject/session/scope.hpp +++ b/src/proc/mobject/session/scope.hpp @@ -21,8 +21,8 @@ */ -#ifndef MOBJECT_SESSION_SCOPE_H -#define MOBJECT_SESSION_SCOPE_H +#ifndef PROC_MOBJECT_SESSION_SCOPE_H +#define PROC_MOBJECT_SESSION_SCOPE_H #include "proc/mobject/placement.hpp" #include "proc/mobject/placement-ref.hpp" @@ -31,6 +31,7 @@ #include +namespace proc { namespace mobject { namespace session { @@ -116,5 +117,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/segment.cpp b/src/proc/mobject/session/segment.cpp index 07320761d..87977a008 100644 --- a/src/proc/mobject/session/segment.cpp +++ b/src/proc/mobject/session/segment.cpp @@ -25,13 +25,12 @@ +namespace proc { namespace mobject { - namespace session { - - /** */ - - - - } // namespace mobject::session - -} // namespace mobject +namespace session { + + /** */ + + + +} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/segment.hpp b/src/proc/mobject/session/segment.hpp index 9c39533e2..900cb76b0 100644 --- a/src/proc/mobject/session/segment.hpp +++ b/src/proc/mobject/session/segment.hpp @@ -30,38 +30,35 @@ #include "proc/mobject/explicitplacement.hpp" #include "lib/time/timevalue.hpp" - using std::list; - +namespace proc { namespace mobject { - namespace session { - - - /** - * For the purpose of building and rendering, the fixture (for each timeline) - * is partitioned such that each segment is structurally constant. - * For each segment there is a RenderGraph (unit of the render engine) which - * is able to render all ExitNodes for this segment. - */ - class Segment - { - protected: - typedef lib::time::TimeSpan Span; - - /** begin of this timeline segment. */ - Span span_; - - /** relevant MObjects comprising this segment. */ - list elements; - // TODO: actually necessary?? - // TODO: ownership?? - - }; - - - - } // namespace mobject::session - -} // namespace mobject +namespace session { + + + /** + * For the purpose of building and rendering, the fixture (for each timeline) + * is partitioned such that each segment is structurally constant. + * For each segment there is a RenderGraph (unit of the render engine) which + * is able to render all ExitNodes for this segment. + */ + class Segment + { + protected: + typedef lib::time::TimeSpan Span; + + /** begin of this timeline segment. */ + Span span_; + + /** relevant MObjects comprising this segment. */ + list elements; + // TODO: actually necessary?? + // TODO: ownership?? + + }; + + + +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/segmentation.cpp b/src/proc/mobject/session/segmentation.cpp index b8c8fd660..16bb9c1e4 100644 --- a/src/proc/mobject/session/segmentation.cpp +++ b/src/proc/mobject/session/segmentation.cpp @@ -24,13 +24,12 @@ +namespace proc { namespace mobject { - namespace session { - - /** */ - - - - } // namespace mobject::session - -} // namespace mobject +namespace session { + + /** */ + + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/segmentation.hpp b/src/proc/mobject/session/segmentation.hpp index 4312a6205..75238b53d 100644 --- a/src/proc/mobject/session/segmentation.hpp +++ b/src/proc/mobject/session/segmentation.hpp @@ -32,29 +32,28 @@ using std::list; +namespace proc { namespace mobject { - namespace session { - - - /** - * For the purpose of building and rendering, the fixture (for each timeline) - * is partitioned such that each segment is structurally constant. - * The Segmentation defines and maintains this partitioning. Further, - * it is the general entry point for accessing the correct part of the engine - * responsible for a given timeline time point. - * @see SegmentationTool actually calculating the Segmentation - */ - class Segmentation - { - - /** segments of the engine in ordered sequence. */ - list segments_; - - }; - - - - } // namespace mobject::session - -} // namespace mobject +namespace session { + + + /** + * For the purpose of building and rendering, the fixture (for each timeline) + * is partitioned such that each segment is structurally constant. + * The Segmentation defines and maintains this partitioning. Further, + * it is the general entry point for accessing the correct part of the engine + * responsible for a given timeline time point. + * @see SegmentationTool actually calculating the Segmentation + */ + class Segmentation + { + + /** segments of the engine in ordered sequence. */ + list segments_; + + }; + + + +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/sess-manager-impl.cpp b/src/proc/mobject/session/sess-manager-impl.cpp index 9ce3c61ec..6999a2cb5 100644 --- a/src/proc/mobject/session/sess-manager-impl.cpp +++ b/src/proc/mobject/session/sess-manager-impl.cpp @@ -51,6 +51,7 @@ using boost::scoped_ptr; +namespace proc { namespace mobject { namespace session { @@ -286,4 +287,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/sess-manager-impl.hpp b/src/proc/mobject/session/sess-manager-impl.hpp index 403f835c8..dc340af39 100644 --- a/src/proc/mobject/session/sess-manager-impl.hpp +++ b/src/proc/mobject/session/sess-manager-impl.hpp @@ -28,6 +28,7 @@ #include "lib/sync.hpp" +namespace proc { namespace mobject { namespace session { @@ -69,5 +70,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session-impl.cpp b/src/proc/mobject/session/session-impl.cpp index e091414b2..4c44e06e6 100644 --- a/src/proc/mobject/session/session-impl.cpp +++ b/src/proc/mobject/session/session-impl.cpp @@ -30,6 +30,7 @@ using namespace lumiera; +namespace proc { namespace mobject { namespace session { @@ -149,4 +150,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/session-impl.hpp b/src/proc/mobject/session/session-impl.hpp index b5416057e..4a24fadbd 100644 --- a/src/proc/mobject/session/session-impl.hpp +++ b/src/proc/mobject/session/session-impl.hpp @@ -43,8 +43,8 @@ */ -#ifndef MOBJECT_SESSION_SESSIONIMPL_H -#define MOBJECT_SESSION_SESSIONIMPL_H +#ifndef PROC_MOBJECT_SESSION_SESSIONIMPL_H +#define PROC_MOBJECT_SESSION_SESSIONIMPL_H #include "proc/mobject/session.hpp" #include "proc/mobject/session/fixture.hpp" @@ -63,6 +63,7 @@ +namespace proc { namespace mobject { namespace session { @@ -289,5 +290,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session-interface-modules.hpp b/src/proc/mobject/session/session-interface-modules.hpp index daa05b18f..598095f71 100644 --- a/src/proc/mobject/session/session-interface-modules.hpp +++ b/src/proc/mobject/session/session-interface-modules.hpp @@ -67,8 +67,8 @@ */ -#ifndef MOBJECT_SESSION_INTERFACE_MODULES_H -#define MOBJECT_SESSION_INTERFACE_MODULES_H +#ifndef PROC_MOBJECT_SESSION_INTERFACE_MODULES_H +#define PROC_MOBJECT_SESSION_INTERFACE_MODULES_H #include "lib/element-tracker.hpp" #include "proc/asset/timeline.hpp" @@ -79,6 +79,7 @@ +namespace proc { namespace mobject { namespace session { @@ -129,5 +130,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session-query.hpp b/src/proc/mobject/session/session-query.hpp index 15cf82d69..e52d06472 100644 --- a/src/proc/mobject/session/session-query.hpp +++ b/src/proc/mobject/session/session-query.hpp @@ -48,6 +48,7 @@ +namespace proc { namespace mobject { namespace session { @@ -79,5 +80,5 @@ namespace session { return bind (_compareTrackID, _1, trackID); } -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session-service-defaults.hpp b/src/proc/mobject/session/session-service-defaults.hpp index 70cbd1b4a..80457864e 100644 --- a/src/proc/mobject/session/session-service-defaults.hpp +++ b/src/proc/mobject/session/session-service-defaults.hpp @@ -41,6 +41,7 @@ +namespace proc { namespace mobject { namespace session { @@ -55,5 +56,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session-service-explore-scope.hpp b/src/proc/mobject/session/session-service-explore-scope.hpp index e3330fe27..10d483fba 100644 --- a/src/proc/mobject/session/session-service-explore-scope.hpp +++ b/src/proc/mobject/session/session-service-explore-scope.hpp @@ -52,11 +52,12 @@ +namespace proc { namespace mobject { namespace session { - + /** * Implementation-level service for issuing contents/discovery queries. * Actually, the implementation of this service is backed by the PlacementIndex @@ -76,5 +77,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session-service-fetch.hpp b/src/proc/mobject/session/session-service-fetch.hpp index fd883dffb..93d6cb7c2 100644 --- a/src/proc/mobject/session/session-service-fetch.hpp +++ b/src/proc/mobject/session/session-service-fetch.hpp @@ -44,6 +44,7 @@ +namespace proc { namespace mobject { namespace session { @@ -69,5 +70,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session-service-mock-index.hpp b/src/proc/mobject/session/session-service-mock-index.hpp index 44d4ab446..3c9d88d36 100644 --- a/src/proc/mobject/session/session-service-mock-index.hpp +++ b/src/proc/mobject/session/session-service-mock-index.hpp @@ -51,6 +51,7 @@ +namespace proc { namespace mobject { namespace session { @@ -74,5 +75,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session-service-mutate.hpp b/src/proc/mobject/session/session-service-mutate.hpp index dbd063592..54db65c36 100644 --- a/src/proc/mobject/session/session-service-mutate.hpp +++ b/src/proc/mobject/session/session-service-mutate.hpp @@ -46,6 +46,7 @@ +namespace proc { namespace mobject { namespace session { @@ -70,5 +71,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session-services.cpp b/src/proc/mobject/session/session-services.cpp index c75a6c9bd..5ab2470b1 100644 --- a/src/proc/mobject/session/session-services.cpp +++ b/src/proc/mobject/session/session-services.cpp @@ -36,6 +36,7 @@ using lib::Symbol; +namespace proc { namespace mobject { namespace session { @@ -178,4 +179,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/session-services.hpp b/src/proc/mobject/session/session-services.hpp index a44fddae8..ed95186c1 100644 --- a/src/proc/mobject/session/session-services.hpp +++ b/src/proc/mobject/session/session-services.hpp @@ -82,6 +82,7 @@ +namespace proc { namespace mobject { namespace session { @@ -136,5 +137,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/session.cpp b/src/proc/mobject/session/session.cpp index 891ba1349..322f3c150 100644 --- a/src/proc/mobject/session/session.cpp +++ b/src/proc/mobject/session/session.cpp @@ -46,6 +46,7 @@ using mobject::session::SessManager; using mobject::session::SessManagerImpl; using mobject::session::SessionImplAPI; +namespace proc { namespace mobject { @@ -138,4 +139,4 @@ namespace mobject { -} // namespace mobject +}} // namespace proc::mobject diff --git a/src/proc/mobject/session/simpleclip.cpp b/src/proc/mobject/session/simpleclip.cpp deleted file mode 100644 index e404532bf..000000000 --- a/src/proc/mobject/session/simpleclip.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - SimpleClip - Elementary clip (single media stream only) - - Copyright (C) Lumiera.org - 2008, Hermann Vosseler - - 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 "proc/mobject/session/simpleclip.hpp" - -namespace mobject - { - - namespace session - { - - /** */ - - - - } // namespace mobject::session - -} // namespace mobject diff --git a/src/proc/mobject/session/simpleclip.hpp b/src/proc/mobject/session/simpleclip.hpp deleted file mode 100644 index 6b6c23913..000000000 --- a/src/proc/mobject/session/simpleclip.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - SIMPLECLIP.hpp - Elementary clip (single media stream only) - - Copyright (C) Lumiera.org - 2008, Hermann Vosseler - - 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. - -*/ - - -#ifndef MOBJECT_SESSION_SIMPLECLIP_H -#define MOBJECT_SESSION_SIMPLECLIP_H - -#include "proc/mobject/session/clip.hpp" - - - -namespace mobject - { - - namespace session - { - - - /** - * Elementary clip consisting of only one media stream - */ - class SimpleClip : public Clip - { - }; - - - - } // namespace mobject::session - -} // namespace mobject -#endif diff --git a/src/proc/mobject/session/specific-contents-query.hpp b/src/proc/mobject/session/specific-contents-query.hpp index 4437441bc..84503c6b8 100644 --- a/src/proc/mobject/session/specific-contents-query.hpp +++ b/src/proc/mobject/session/specific-contents-query.hpp @@ -31,6 +31,7 @@ #include +namespace proc { namespace mobject { namespace session { @@ -170,5 +171,5 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/track.cpp b/src/proc/mobject/session/track.cpp index 78ca7a52a..27ab2f300 100644 --- a/src/proc/mobject/session/track.cpp +++ b/src/proc/mobject/session/track.cpp @@ -24,6 +24,7 @@ #include "proc/mobject/session/track.hpp" +namespace proc { namespace mobject { namespace session { @@ -47,4 +48,4 @@ namespace session { -}} // namespace mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/track.hpp b/src/proc/mobject/session/track.hpp index 998c51899..f11bf99a6 100644 --- a/src/proc/mobject/session/track.hpp +++ b/src/proc/mobject/session/track.hpp @@ -30,18 +30,19 @@ +namespace proc { namespace mobject { namespace session { //////////////////////////////////////////////////////TICKET #637 - - using lumiera::P; - using lib::time::Time; - - class Track; - - typedef P PTrack; - + + using lib::P; + using lib::time::Time; + + class Track; + + typedef P PTrack; + }} - + namespace asset { //////////////////////////////////////////////////////TICKET #637 typedef EntryID TrackID; @@ -51,8 +52,8 @@ namespace asset { //////////////////////////////////////////////////////TI namespace mobject { namespace session { - using asset::TrackID; - + using asset::TrackID; + //////////////////////////////////////////////////////TICKET #646 //////////////////////////////////////////////////////TICKET #715 @@ -109,13 +110,13 @@ namespace session { { return refID == id_.getSym(); } - - + + } // namespace mobject::session /** Placement defined to be subclass of Placement */ template class Placement; typedef Placement PTrack; -} // namespace mobject +}} // namespace proc::mobject #endif diff --git a/src/proc/mobject/session/wish.cpp b/src/proc/mobject/session/wish.cpp index 3704c77e6..9973feee2 100644 --- a/src/proc/mobject/session/wish.cpp +++ b/src/proc/mobject/session/wish.cpp @@ -23,15 +23,12 @@ #include "proc/mobject/session/wish.hpp" -namespace mobject - { - namespace session - { - - /** */ - - - - } // namespace mobject::session - -} // namespace mobject +namespace proc { +namespace mobject { +namespace session { + + /** */ + + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/wish.hpp b/src/proc/mobject/session/wish.hpp index ae5ffbeab..7040589f1 100644 --- a/src/proc/mobject/session/wish.hpp +++ b/src/proc/mobject/session/wish.hpp @@ -28,25 +28,22 @@ -namespace mobject - { - namespace session +namespace proc { +namespace mobject { +namespace session { + + + /** + * LocatingPin representing a low-priority directive by the user, + * to be fulfilled only if possible (and after satisfying the + * more important LocatingPins) + */ + class Wish : public Allocation { - - - /** - * LocatingPin representing a low-priority directive by the user, - * to be fulfilled only if possible (and after satisfying the - * more important LocatingPins) - */ - class Wish : public Allocation - { - - }; - - - - } // namespace mobject::session - -} // namespace mobject + + }; + + + +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/test-dummy-mobject.hpp b/src/proc/mobject/test-dummy-mobject.hpp index 325244691..3c2bce447 100644 --- a/src/proc/mobject/test-dummy-mobject.hpp +++ b/src/proc/mobject/test-dummy-mobject.hpp @@ -60,6 +60,7 @@ using std::cout; +namespace proc { namespace mobject { namespace test { @@ -162,5 +163,5 @@ namespace test { -}} // namespace mobject::test +}}} // namespace proc::mobject::test #endif diff --git a/src/proc/play/dummy-play-connection.cpp b/src/proc/play/dummy-play-connection.cpp index 72dab3d41..065cd0b40 100644 --- a/src/proc/play/dummy-play-connection.cpp +++ b/src/proc/play/dummy-play-connection.cpp @@ -33,26 +33,18 @@ -namespace proc { - namespace play{ +namespace proc { +namespace play { -// using std::string; -// using lumiera::Subsys; -// using std::auto_ptr; -// using boost::scoped_ptr; -// using std::tr1::bind; - - - namespace { // hidden local details of the service implementation.... - - } // (End) hidden service impl details - - - - - /** */ + namespace { // hidden local details of the service implementation.... - } // namespace play + } // (End) hidden service impl details -} // namespace proc + + + + /** */ + + +}} // namespace proc::play diff --git a/src/proc/play/output-director.hpp b/src/proc/play/output-director.hpp index 2783b097c..c88e4f13d 100644 --- a/src/proc/play/output-director.hpp +++ b/src/proc/play/output-director.hpp @@ -73,7 +73,7 @@ namespace play { : boost::noncopyable , public lib::Sync<> { - typedef lumiera::Subsys::SigTerm SigTerm; + typedef ::lumiera::Subsys::SigTerm SigTerm; scoped_ptr player_; diff --git a/src/proc/play/output-slot-connection.hpp b/src/proc/play/output-slot-connection.hpp index 34a574d9d..4ab5bdc8b 100644 --- a/src/proc/play/output-slot-connection.hpp +++ b/src/proc/play/output-slot-connection.hpp @@ -59,8 +59,8 @@ namespace proc { namespace play { - using ::engine::BuffHandle; -//using ::engine::BufferProvider; + using proc::engine::BuffHandle; +//using proc::engine::BufferProvider; //using lib::time::Time; //using std::string; using lib::transform; diff --git a/src/proc/play/output-slot.hpp b/src/proc/play/output-slot.hpp index bd51a03b9..095bfb5e1 100644 --- a/src/proc/play/output-slot.hpp +++ b/src/proc/play/output-slot.hpp @@ -54,8 +54,8 @@ namespace proc { namespace play { - using ::engine::BuffHandle; - using ::engine::BufferProvider; + using proc::engine::BuffHandle; + using proc::engine::BufferProvider; using lib::time::TimeValue; //using std::string; diff --git a/src/proc/play/play-process.hpp b/src/proc/play/play-process.hpp index ae8b8d3a6..193dc252e 100644 --- a/src/proc/play/play-process.hpp +++ b/src/proc/play/play-process.hpp @@ -75,7 +75,7 @@ namespace play { // using lumiera::Display; // using lumiera::DummyPlayer; using util::isnil; - using mobject::ModelPort; + using proc::mobject::ModelPort; typedef proc::play::POutputManager POutputManager; typedef lib::IterSource::iterator ModelPorts; diff --git a/src/proc/state.cpp b/src/proc/state.cpp index 939bd6721..15dc9ba3a 100644 --- a/src/proc/state.cpp +++ b/src/proc/state.cpp @@ -23,8 +23,7 @@ #include "proc/state.hpp" -namespace proc_interface - { +namespace proc_interface { ////////////////////////////////TODO: State is a high -level interface, so can we get rid of this implementation file? /** */ diff --git a/src/proc/state.hpp b/src/proc/state.hpp index 4cee7bc9a..07175c66a 100644 --- a/src/proc/state.hpp +++ b/src/proc/state.hpp @@ -32,10 +32,11 @@ #include +namespace proc { namespace engine { - using lumiera::FrameID; - using lumiera::NodeID; + using ::lumiera::FrameID; + using ::lumiera::NodeID; class StateAdapter; class BuffTableStorage; @@ -109,13 +110,13 @@ namespace engine { friend class engine::StateAdapter; }; -} // namespace engine +}} // namespace proc::engine namespace proc_interface { - using engine::State; + using proc::engine::State; } // namespace proc_interface diff --git a/src/lib/streamtype.cpp b/src/proc/streamtype.cpp similarity index 93% rename from src/lib/streamtype.cpp rename to src/proc/streamtype.cpp index 410227567..0213ba211 100644 --- a/src/lib/streamtype.cpp +++ b/src/proc/streamtype.cpp @@ -21,11 +21,10 @@ * *****************************************************/ -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" -namespace lumiera - { +namespace proc { /** @internal defined here non-inline place the vtable in this object file.*/ StreamType::ImplFacade::ImplFacade (Symbol libID) @@ -34,4 +33,4 @@ namespace lumiera -} // namespace lumiera +} // namespace proc diff --git a/src/lib/streamtype.hpp b/src/proc/streamtype.hpp similarity index 97% rename from src/lib/streamtype.hpp rename to src/proc/streamtype.hpp index e344b811d..3950914f8 100644 --- a/src/lib/streamtype.hpp +++ b/src/proc/streamtype.hpp @@ -31,8 +31,8 @@ */ -#ifndef LUMIERA_STREAMTYPE_HPP -#define LUMIERA_STREAMTYPE_HPP +#ifndef PROC_STREAMTYPE_HPP +#define PROC_STREAMTYPE_HPP #include "lib/symbol.hpp" @@ -42,7 +42,7 @@ #include -namespace lumiera { +namespace proc { using lib::Symbol; @@ -190,5 +190,5 @@ namespace lumiera { -} // namespace lumiera +} // namespace proc #endif diff --git a/tests/components/proc/asset/asset-diagnostics.hpp b/tests/components/proc/asset/asset-diagnostics.hpp index 76788d3f5..1429c622d 100644 --- a/tests/components/proc/asset/asset-diagnostics.hpp +++ b/tests/components/proc/asset/asset-diagnostics.hpp @@ -87,5 +87,5 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset #endif diff --git a/tests/components/proc/asset/basicpipetest.cpp b/tests/components/proc/asset/basicpipetest.cpp index 6084dba5e..5c5a59456 100644 --- a/tests/components/proc/asset/basicpipetest.cpp +++ b/tests/components/proc/asset/basicpipetest.cpp @@ -48,8 +48,7 @@ namespace test { using mobject::Session; using lumiera::Query; using lumiera::query::normaliseID; - using lumiera::StreamType; - + /*********************************************************************** diff --git a/tests/components/proc/asset/testasset.hpp b/tests/components/proc/asset/testasset.hpp index ff1044e83..f352d3cb8 100644 --- a/tests/components/proc/asset/testasset.hpp +++ b/tests/components/proc/asset/testasset.hpp @@ -74,5 +74,5 @@ namespace asset } // namespace test -} // namespace asset +}} // namespace proc::asset #endif diff --git a/tests/components/proc/asset/testclipasset.hpp b/tests/components/proc/asset/testclipasset.hpp index eb5167abc..a43dd4d7e 100644 --- a/tests/components/proc/asset/testclipasset.hpp +++ b/tests/components/proc/asset/testclipasset.hpp @@ -53,5 +53,5 @@ namespace asset -} // namespace asset +}} // namespace proc::asset #endif diff --git a/tests/components/proc/asset/typed-id-test.cpp b/tests/components/proc/asset/typed-id-test.cpp index 7835c162b..f5de32f52 100644 --- a/tests/components/proc/asset/typed-id-test.cpp +++ b/tests/components/proc/asset/typed-id-test.cpp @@ -47,7 +47,7 @@ using util::for_each; using util::isnil; //using lib::Literal; using lib::Symbol; -using lumiera::P; +using lib::P; //using std::string; using std::cout; using std::endl; diff --git a/tests/components/proc/control/command-basic-test.cpp b/tests/components/proc/control/command-basic-test.cpp index ef392906e..121a83b7a 100644 --- a/tests/components/proc/control/command-basic-test.cpp +++ b/tests/components/proc/control/command-basic-test.cpp @@ -34,7 +34,7 @@ using std::rand; namespace control { namespace test { - using lumiera::P; + using lib::P; using lib::time::Time; using lib::time::TimeVar; using lib::time::TimeValue; diff --git a/tests/components/proc/mobject/session/defs-manager-impl-test.cpp b/tests/components/proc/mobject/session/defs-manager-impl-test.cpp index 48ad7f98c..3c6835255 100644 --- a/tests/components/proc/mobject/session/defs-manager-impl-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-impl-test.cpp @@ -30,7 +30,7 @@ #include "common/configrules.hpp" #include "proc/assetmanager.hpp" #include "proc/mobject/session.hpp" -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" #include @@ -54,7 +54,6 @@ namespace test { using lumiera::ConfigRules; using lumiera::query::QueryHandler; - using lumiera::StreamType; diff --git a/tests/components/proc/mobject/session/defs-manager-test.cpp b/tests/components/proc/mobject/session/defs-manager-test.cpp index e2d618a1b..15431d354 100644 --- a/tests/components/proc/mobject/session/defs-manager-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-test.cpp @@ -31,7 +31,7 @@ #include "proc/asset/struct.hpp" #include "proc/assetmanager.hpp" #include "proc/mobject/session.hpp" -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" #include @@ -55,7 +55,6 @@ namespace test { using asset::Struct; using lumiera::Query; using lumiera::query::normaliseID; - using lumiera::StreamType; /** shortcut: run just a query diff --git a/tests/components/proc/mobject/session/defs-registry-impl-test.cpp b/tests/components/proc/mobject/session/defs-registry-impl-test.cpp index 8025bfbf0..ccf3f7817 100644 --- a/tests/components/proc/mobject/session/defs-registry-impl-test.cpp +++ b/tests/components/proc/mobject/session/defs-registry-impl-test.cpp @@ -35,10 +35,10 @@ #include #include -using lumiera::P; using lumiera::Query; using lumiera::query::test::garbage_query; using util::isnil; +using lib::P; using boost::scoped_ptr; using boost::format; diff --git a/tests/lib/advice/advice-configuration-test.cpp b/tests/lib/advice/advice-configuration-test.cpp index 0ea2be33d..8e90f2aa3 100644 --- a/tests/lib/advice/advice-configuration-test.cpp +++ b/tests/lib/advice/advice-configuration-test.cpp @@ -45,7 +45,7 @@ //using util::isnil; //using lib::Literal; //using lib::Symbol; -//using lumiera::P; +//using lib::P; //using std::string; //using std::cout; //using std::endl; diff --git a/tests/lib/advice/advice-multiplicity-test.cpp b/tests/lib/advice/advice-multiplicity-test.cpp index c95da30e3..00b789ab6 100644 --- a/tests/lib/advice/advice-multiplicity-test.cpp +++ b/tests/lib/advice/advice-multiplicity-test.cpp @@ -45,7 +45,7 @@ //using util::isnil; //using lib::Literal; //using lib::Symbol; -//using lumiera::P; +//using lib::P; //using std::string; //using std::cout; //using std::endl; diff --git a/tests/lib/advice/advice-situations-test.cpp b/tests/lib/advice/advice-situations-test.cpp index 88de5debb..e39a4000c 100644 --- a/tests/lib/advice/advice-situations-test.cpp +++ b/tests/lib/advice/advice-situations-test.cpp @@ -45,7 +45,7 @@ //using util::isnil; //using lib::Literal; //using lib::Symbol; -//using lumiera::P; +//using liab::P; //using std::string; //using std::cout; //using std::endl; diff --git a/tests/lib/custom-shared-ptr-test.cpp b/tests/lib/custom-shared-ptr-test.cpp index 45bf5da25..9a8a2c1df 100644 --- a/tests/lib/custom-shared-ptr-test.cpp +++ b/tests/lib/custom-shared-ptr-test.cpp @@ -34,7 +34,6 @@ namespace lib { namespace test{ - using lumiera::P; using std::string; using std::tr1::shared_ptr; using std::tr1::weak_ptr; diff --git a/tests/lib/teststreamtypes.hpp b/tests/lib/teststreamtypes.hpp index fda471b74..11aec0fd6 100644 --- a/tests/lib/teststreamtypes.hpp +++ b/tests/lib/teststreamtypes.hpp @@ -27,7 +27,7 @@ //#include "lib/util.hpp" -#include "lib/streamtype.hpp" +#include "proc/streamtype.hpp" #include "proc/control/stypemanager.hpp" extern "C" { From b9d1899486a03ce24719bfb72d5d9e73741cdcb8 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 2 Dec 2011 17:50:44 +0100 Subject: [PATCH 03/87] cleanup: rectify Proc-Layer namespaces (II) --- src/include/play-facade.h | 12 +- src/lib/advice/index.hpp | 3 +- src/lib/time/formats.hpp | 2 +- src/lib/typed-counter.hpp | 20 +- src/lib/wrapperptr.hpp | 8 +- src/proc/asset/inventory.hpp | 2 +- src/proc/asset/meta.cpp | 3 +- src/proc/asset/struct-scheme.hpp | 7 +- src/proc/control/argument-erasure.hpp | 3 +- src/proc/control/argument-tuple-accept.hpp | 3 +- src/proc/control/command-argument-holder.hpp | 3 +- src/proc/control/command-closure.hpp | 3 +- src/proc/control/command-def.hpp | 3 +- .../control/command-impl-clone-builder.hpp | 3 +- src/proc/control/command-impl.cpp | 3 +- src/proc/control/command-impl.hpp | 3 +- src/proc/control/command-invocation.hpp | 3 +- src/proc/control/command-mutation.hpp | 3 +- src/proc/control/command-registry.hpp | 3 +- src/proc/control/command-signature.hpp | 3 +- src/proc/control/command.cpp | 5 +- src/proc/control/command.hpp | 3 +- src/proc/control/handling-pattern.cpp | 5 +- src/proc/control/handling-pattern.hpp | 3 +- src/proc/control/handling-patterns.hpp | 3 +- src/proc/control/mediaimpllib.hpp | 9 +- src/proc/control/memento-tie.hpp | 3 +- src/proc/control/pathmanager.cpp | 3 +- src/proc/control/pathmanager.hpp | 3 +- src/proc/control/proc-dispatcher.cpp | 3 +- src/proc/control/proc-dispatcher.hpp | 3 +- src/proc/control/stypemanager.cpp | 5 +- src/proc/control/stypemanager.hpp | 9 +- src/proc/control/styperegistry.hpp | 10 +- src/proc/engine/buffhandle.hpp | 2 +- src/proc/engine/nodeoperation.hpp | 2 +- src/proc/engine/nodewiring-config.hpp | 12 +- src/proc/engine/nodewiring.cpp | 2 +- src/proc/engine/type-handler.hpp | 2 +- src/proc/mobject/builder/buildertool.hpp | 11 +- .../mobject/builder/segmentation-tool.cpp | 12 +- src/proc/mobject/mobject-ref.hpp | 2 + src/proc/mobject/placement-ref.hpp | 2 +- src/proc/mobject/session/abstractmo.hpp | 2 +- src/proc/mobject/session/bus-mo.hpp | 2 +- src/proc/mobject/session/defs-manager.hpp | 9 +- src/proc/mobject/session/placement-index.cpp | 4 +- src/proc/mobject/session/placement-index.hpp | 8 +- src/proc/mobject/session/query-resolver.hpp | 9 +- src/proc/mobject/session/scope-path.cpp | 1 - src/proc/mobject/session/segment.cpp | 2 +- src/proc/mobject/session/session-impl.cpp | 1 - src/proc/mobject/session/session.cpp | 12 +- src/proc/play/output-director.hpp | 2 +- src/proc/state.hpp | 4 +- src/proc/streamtype.hpp | 4 +- tests/40components.tests | 2 +- tests/41asset.tests | 10 +- tests/43session.tests | 42 +- .../components/backend/media-access-mock.cpp | 2 +- .../proc/asset/asset-category-test.cpp | 3 +- .../proc/asset/asset-diagnostics.hpp | 1 + tests/components/proc/asset/basicpipetest.cpp | 331 ++++++----- .../proc/asset/compoundmediatest.cpp | 135 +++-- .../proc/asset/create-asset-test.cpp | 5 +- .../components/proc/asset/deleteassettest.cpp | 61 +- .../proc/asset/dependent-assets-test.cpp | 352 ++++++------ tests/components/proc/asset/entry-id-test.cpp | 5 +- .../proc/asset/identityofassetstest.cpp | 5 +- tests/components/proc/asset/makecliptest.cpp | 97 ++-- .../proc/asset/mediastructurequerytest.cpp | 59 +- .../proc/asset/meta/time-grid-basics-test.cpp | 3 +- .../proc/asset/orderingofassetstest.cpp | 189 ++++--- tests/components/proc/asset/testasset.cpp | 144 +++-- tests/components/proc/asset/testasset.hpp | 71 ++- tests/components/proc/asset/testclipasset.hpp | 14 +- tests/components/proc/asset/typed-id-test.cpp | 12 +- .../control/argument-tuple-accept-test.cpp | 3 +- .../proc/control/command-argument-test.cpp | 195 +++---- .../proc/control/command-basic-test.cpp | 3 +- .../proc/control/command-binding-test.cpp | 3 +- .../control/command-clone-builder-test.cpp | 5 +- .../proc/control/command-equality-test.cpp | 3 +- .../proc/control/command-mutation-test.cpp | 3 +- .../proc/control/command-registry-test.cpp | 3 +- .../proc/control/command-use1-test.cpp | 3 +- .../proc/control/command-use2-test.cpp | 3 +- .../proc/control/command-use3-test.cpp | 3 +- .../control/handling-pattern-basics-test.cpp | 3 +- .../handling-pattern-standard-impl-test.cpp | 7 +- .../proc/control/memento-tie-test.cpp | 3 +- .../proc/control/test-dummy-commands.cpp | 3 +- .../proc/control/test-dummy-commands.hpp | 3 +- .../proc/engine/buff-table-test.cpp | 3 +- .../proc/engine/buffer-metadata-key-test.cpp | 3 +- .../proc/engine/buffer-metadata-test.cpp | 3 +- .../engine/buffer-provider-protocol-test.cpp | 5 +- .../proc/engine/node-basic-test.cpp | 3 +- .../proc/engine/node-fabrication-test.cpp | 3 +- .../proc/engine/node-operation-test.cpp | 3 +- .../proc/engine/node-source-test.cpp | 3 +- .../components/proc/engine/testframe-test.cpp | 3 +- tests/components/proc/engine/testframe.cpp | 3 +- tests/components/proc/engine/testframe.hpp | 5 +- .../tracking-heap-block-provider-test.cpp | 3 +- .../proc/mobject/builder/buildertooltest.cpp | 3 +- .../proc/mobject/builder/buildsegmenttest.cpp | 56 +- .../builder/fixture-change-detector-test.cpp | 3 +- .../builder/model-port-registry-test.cpp | 3 +- .../segmentation-datastructure-test.cpp | 3 +- .../mobject/controller/rendersegmenttest.cpp | 68 ++- .../proc/mobject/mobject-interface-test.cpp | 3 +- .../proc/mobject/mobject-ref-test.cpp | 3 +- .../proc/mobject/output-mapping-test.cpp | 5 +- .../proc/mobject/placement-basic-test.cpp | 3 +- .../proc/mobject/placement-hierarchy-test.cpp | 3 +- .../placement-object-identity-test.cpp | 3 +- .../proc/mobject/placement-ref-test.cpp | 7 +- .../proc/mobject/session/addcliptest.cpp | 66 +-- .../session/defs-manager-impl-test.cpp | 3 +- .../mobject/session/defs-manager-test.cpp | 3 +- .../session/defs-registry-impl-test.cpp | 13 +- .../proc/mobject/session/deletecliptest.cpp | 3 +- .../session/placement-index-query-test.cpp | 3 +- .../mobject/session/placement-index-test.cpp | 3 +- .../mobject/session/placement-scope-test.cpp | 3 +- .../session/query-focus-stack-test.cpp | 3 +- .../proc/mobject/session/query-focus-test.cpp | 3 +- .../mobject/session/query-resolver-test.cpp | 3 +- .../mobject/session/rebuildfixturetest.cpp | 3 +- .../proc/mobject/session/scope-path-test.cpp | 3 +- .../proc/mobject/session/scope-query-test.cpp | 3 +- .../session/session-element-query-test.cpp | 3 +- .../session/session-element-tracker-test.cpp | 5 +- .../session/session-modify-parts-test.cpp | 5 +- .../session/session-service-access-test.cpp | 5 +- .../session/session-structure-test.cpp | 3 +- .../mobject/session/sessionmanagertest.cpp | 3 +- .../mobject/session/test-scope-invalid.hpp | 3 +- .../proc/mobject/session/test-scopes.cpp | 5 +- .../proc/mobject/session/test-scopes.hpp | 3 +- .../proc/mobject/session/testclip.cpp | 3 +- .../proc/mobject/session/testclip.hpp | 3 +- .../proc/mobject/session/testroot.hpp | 3 +- .../proc/mobject/session/testsession1.hpp | 3 +- .../timeline-sequence-handling-test.cpp | 9 +- .../proc/play/diagnostic-output-slot.hpp | 6 +- .../proc/play/output-slot-protocol-test.cpp | 8 +- tests/lib/meta/config-flags-test.cpp | 525 +++++++++--------- .../lib/meta/iterable-classification-test.cpp | 4 +- tests/{common => lib}/ref-array-test.cpp | 0 tests/lib/streamtypebasicstest.cpp | 168 +++--- tests/lib/streamtypelifecycletest.cpp | 154 ++--- tests/lib/test/test-helper-test.cpp | 4 +- tests/lib/teststreamtypes.hpp | 100 ++-- tests/lib/time/time-control-test.cpp | 2 +- tests/lib/time/time-formats-test.cpp | 2 +- tests/lib/time/time-mutation-test.cpp | 2 +- tests/lib/time/time-parsing-test.cpp | 2 +- tests/lib/time/time-quantisation-test.cpp | 2 +- 160 files changed, 1740 insertions(+), 1669 deletions(-) rename tests/{common => lib}/ref-array-test.cpp (100%) diff --git a/src/include/play-facade.h b/src/include/play-facade.h index e2b03713b..c5c2c0f00 100644 --- a/src/include/play-facade.h +++ b/src/include/play-facade.h @@ -119,13 +119,13 @@ namespace lumiera { }; - typedef lib::IterSource::iterator ModelPorts; - typedef lib::IterSource::iterator Pipes; + typedef lib::IterSource::iterator ModelPorts; + typedef lib::IterSource::iterator Pipes; typedef proc::play::POutputManager Output; - typedef mobject::session::PClipMO Clip; - typedef mobject::PTrack Track; - typedef asset::PTimeline Timeline; - typedef asset::PViewer Viewer; + typedef proc::mobject::session::PClipMO Clip; + typedef proc::mobject::PTrack Track; + typedef proc::asset::PTimeline Timeline; + typedef proc::asset::PViewer Viewer; /** core operation: create a new playback process * outputting to the given viewer/display */ diff --git a/src/lib/advice/index.hpp b/src/lib/advice/index.hpp index 5f3fa249a..a98c6fc54 100644 --- a/src/lib/advice/index.hpp +++ b/src/lib/advice/index.hpp @@ -103,6 +103,8 @@ namespace lib { namespace advice { + namespace error = lumiera::error; + using std::tr1::placeholders::_1; using std::tr1::unordered_map; using lib::iter_stl::eachVal; @@ -118,7 +120,6 @@ namespace advice { using std::cout; using std::endl; - using namespace lumiera; diff --git a/src/lib/time/formats.hpp b/src/lib/time/formats.hpp index a2af01c6f..12ac1b9b8 100644 --- a/src/lib/time/formats.hpp +++ b/src/lib/time/formats.hpp @@ -187,7 +187,7 @@ namespace time { std::bitset flags_; template - size_t + IxID typeID() const { return TypedContext::ID::get(); diff --git a/src/lib/typed-counter.hpp b/src/lib/typed-counter.hpp index 8201e6eb3..82ee099bb 100644 --- a/src/lib/typed-counter.hpp +++ b/src/lib/typed-counter.hpp @@ -65,6 +65,8 @@ namespace lib { + typedef size_t IxID; //////////////////////TICKET #863 + using std::vector; @@ -80,11 +82,11 @@ namespace lib { template class TypedContext { - static size_t lastGeneratedTypeID; + static IxID lastGeneratedTypeID; public: - static size_t - newTypeID (size_t& typeID) + static IxID + newTypeID (IxID& typeID) { ClassLock synchronised(); if (!typeID) @@ -96,10 +98,10 @@ namespace lib { template class ID { - static size_t typeID; + static IxID typeID; public: - static size_t + static IxID get() { if (typeID) @@ -112,12 +114,12 @@ namespace lib { /** storage for the type-ID generation mechanism */ template - size_t TypedContext::lastGeneratedTypeID (0); + IxID TypedContext::lastGeneratedTypeID (0); /** table holding all the generated type-IDs */ template template - size_t TypedContext::ID::typeID (0); + IxID TypedContext::ID::typeID (0); @@ -131,10 +133,10 @@ namespace lib { mutable vector counters_; template - size_t + IxID slot() const { - size_t typeID = TypedContext::ID::get(); + IxID typeID = TypedContext::ID::get(); if (size() < typeID) counters_.resize (typeID); diff --git a/src/lib/wrapperptr.hpp b/src/lib/wrapperptr.hpp index 5ee48f544..6248438f3 100644 --- a/src/lib/wrapperptr.hpp +++ b/src/lib/wrapperptr.hpp @@ -39,10 +39,10 @@ namespace proc { namespace mobject { class MObject; } - typedef ::lumiera::typelist::Types < mobject::Placement* - , lib::P* - > ::List - WrapperTypes; + typedef lumiera::typelist::Types < mobject::Placement* + , lib::P* + > ::List + WrapperTypes; } namespace lumiera { diff --git a/src/proc/asset/inventory.hpp b/src/proc/asset/inventory.hpp index 6858aeeb0..c3224ecb7 100644 --- a/src/proc/asset/inventory.hpp +++ b/src/proc/asset/inventory.hpp @@ -41,7 +41,7 @@ namespace asset { {}; - typedef lumiera::P PInv; + typedef P PInv; }} // namespace proc::asset diff --git a/src/proc/asset/meta.cpp b/src/proc/asset/meta.cpp index 75ff42c6f..1b0bbaa13 100644 --- a/src/proc/asset/meta.cpp +++ b/src/proc/asset/meta.cpp @@ -80,7 +80,7 @@ namespace asset { -} // namespace asset +}} // namespace proc::asset @@ -95,6 +95,7 @@ namespace asset { //#include "proc/asset/sequence.hpp" +namespace proc { namespace asset { using meta::Descriptor; diff --git a/src/proc/asset/struct-scheme.hpp b/src/proc/asset/struct-scheme.hpp index d0354833a..b0a8fe20f 100644 --- a/src/proc/asset/struct-scheme.hpp +++ b/src/proc/asset/struct-scheme.hpp @@ -45,6 +45,10 @@ using boost::format; +namespace lumiera { + class StreamType; +} + namespace proc { namespace mobject { namespace session { @@ -53,9 +57,6 @@ namespace session { class Clip; }} -namespace lumiera { - class StreamType; -} namespace asset{ diff --git a/src/proc/control/argument-erasure.hpp b/src/proc/control/argument-erasure.hpp index 1a9d15b60..6d74bdf9a 100644 --- a/src/proc/control/argument-erasure.hpp +++ b/src/proc/control/argument-erasure.hpp @@ -29,6 +29,7 @@ +namespace proc { namespace control { @@ -84,5 +85,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/argument-tuple-accept.hpp b/src/proc/control/argument-tuple-accept.hpp index 5db90d0c8..7003c32f7 100644 --- a/src/proc/control/argument-tuple-accept.hpp +++ b/src/proc/control/argument-tuple-accept.hpp @@ -63,6 +63,7 @@ +namespace proc { namespace control { @@ -670,5 +671,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command-argument-holder.hpp b/src/proc/control/command-argument-holder.hpp index d40fd0433..17b53a822 100644 --- a/src/proc/control/command-argument-holder.hpp +++ b/src/proc/control/command-argument-holder.hpp @@ -52,6 +52,7 @@ +namespace proc { namespace control { using lib::InPlaceBuffer; @@ -278,5 +279,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command-closure.hpp b/src/proc/control/command-closure.hpp index eb59a1c54..291717bb2 100644 --- a/src/proc/control/command-closure.hpp +++ b/src/proc/control/command-closure.hpp @@ -88,6 +88,7 @@ +namespace proc { namespace control { using lumiera::typelist::FunctionSignature; @@ -302,5 +303,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command-def.hpp b/src/proc/control/command-def.hpp index 2f87f89d6..959d98505 100644 --- a/src/proc/control/command-def.hpp +++ b/src/proc/control/command-def.hpp @@ -76,6 +76,7 @@ +namespace proc { namespace control { using std::tr1::shared_ptr; @@ -325,5 +326,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command-impl-clone-builder.hpp b/src/proc/control/command-impl-clone-builder.hpp index cbc6ba378..549a8e30a 100644 --- a/src/proc/control/command-impl-clone-builder.hpp +++ b/src/proc/control/command-impl-clone-builder.hpp @@ -60,6 +60,7 @@ //#include +namespace proc { namespace control { using lib::TypedAllocationManager; @@ -187,5 +188,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command-impl.cpp b/src/proc/control/command-impl.cpp index 36406ced5..3a8f66e36 100644 --- a/src/proc/control/command-impl.cpp +++ b/src/proc/control/command-impl.cpp @@ -39,6 +39,7 @@ //#include //using boost::str; +namespace proc { namespace control { @@ -55,4 +56,4 @@ namespace control { -} // namespace control +}} // namespace proc::control diff --git a/src/proc/control/command-impl.hpp b/src/proc/control/command-impl.hpp index a25d92fad..bec6be23d 100644 --- a/src/proc/control/command-impl.hpp +++ b/src/proc/control/command-impl.hpp @@ -55,6 +55,7 @@ #include +namespace proc { namespace control { using std::tr1::function; @@ -237,5 +238,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command-invocation.hpp b/src/proc/control/command-invocation.hpp index e357fcd9f..41e1e521f 100644 --- a/src/proc/control/command-invocation.hpp +++ b/src/proc/control/command-invocation.hpp @@ -53,6 +53,7 @@ +namespace proc { namespace control { using namespace lumiera::typelist; @@ -220,5 +221,5 @@ namespace control { } -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command-mutation.hpp b/src/proc/control/command-mutation.hpp index fd4df2760..b80259a09 100644 --- a/src/proc/control/command-mutation.hpp +++ b/src/proc/control/command-mutation.hpp @@ -55,6 +55,7 @@ +namespace proc { namespace control { using std::ostream; @@ -155,5 +156,5 @@ namespace control { }; -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command-registry.hpp b/src/proc/control/command-registry.hpp index 833840528..c2231bd6e 100644 --- a/src/proc/control/command-registry.hpp +++ b/src/proc/control/command-registry.hpp @@ -78,6 +78,7 @@ +namespace proc { namespace control { using boost::hash; @@ -268,5 +269,5 @@ namespace control { }; -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command-signature.hpp b/src/proc/control/command-signature.hpp index f37f82c85..b756cf0ec 100644 --- a/src/proc/control/command-signature.hpp +++ b/src/proc/control/command-signature.hpp @@ -56,6 +56,7 @@ +namespace proc { namespace control { using std::tr1::function; @@ -151,5 +152,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/command.cpp b/src/proc/control/command.cpp index 291edfb7e..6489a3fee 100644 --- a/src/proc/control/command.cpp +++ b/src/proc/control/command.cpp @@ -54,7 +54,6 @@ #include #include -using namespace lumiera; using std::ostringstream; using std::string; using boost::format; @@ -62,7 +61,9 @@ using boost::str; using util::cStr; +namespace proc { namespace control { + namespace error = lumiera::error; LUMIERA_ERROR_DEFINE (INVALID_COMMAND, "Unknown or insufficiently defined command"); LUMIERA_ERROR_DEFINE (DUPLICATE_COMMAND, "Attempt to redefine an already existing command definition"); @@ -412,4 +413,4 @@ namespace control { -} // namespace control +}} // namespace proc::control diff --git a/src/proc/control/command.hpp b/src/proc/control/command.hpp index 2ab26d0dd..aa4c6075b 100644 --- a/src/proc/control/command.hpp +++ b/src/proc/control/command.hpp @@ -68,6 +68,7 @@ +namespace proc { namespace control { using std::string; @@ -274,5 +275,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/handling-pattern.cpp b/src/proc/control/handling-pattern.cpp index b71cc6d4c..a5fb54d2f 100644 --- a/src/proc/control/handling-pattern.cpp +++ b/src/proc/control/handling-pattern.cpp @@ -33,12 +33,13 @@ using boost::str; using boost::format; -using namespace lumiera; using util::isnil; using util::cStr; +namespace proc { namespace control { + namespace error = lumiera::error; /** retrieve pre-configured pattern */ HandlingPattern const& @@ -124,4 +125,4 @@ namespace control { } -} // namespace control +}} // namespace proc::control diff --git a/src/proc/control/handling-pattern.hpp b/src/proc/control/handling-pattern.hpp index 84ae17237..331243480 100644 --- a/src/proc/control/handling-pattern.hpp +++ b/src/proc/control/handling-pattern.hpp @@ -52,6 +52,7 @@ +namespace proc { namespace control { using std::string; @@ -146,5 +147,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/handling-patterns.hpp b/src/proc/control/handling-patterns.hpp index 41a87fbeb..daaa58f8a 100644 --- a/src/proc/control/handling-patterns.hpp +++ b/src/proc/control/handling-patterns.hpp @@ -49,6 +49,7 @@ +namespace proc { namespace control { namespace { // concrete command handling patterns @@ -238,5 +239,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/mediaimpllib.hpp b/src/proc/control/mediaimpllib.hpp index 4a5fd683f..e01e3dcb2 100644 --- a/src/proc/control/mediaimpllib.hpp +++ b/src/proc/control/mediaimpllib.hpp @@ -29,6 +29,7 @@ +namespace proc { namespace control { using lib::Symbol; @@ -39,9 +40,9 @@ namespace control { protected: virtual ~MediaImplLib() {}; - typedef lumiera::StreamType::ImplFacade ImplFacade; - typedef lumiera::StreamType::ImplFacade::TypeTag TypeTag; - typedef lumiera::StreamType::ImplFacade::DataBuffer DataBuffer; + typedef StreamType::ImplFacade ImplFacade; + typedef StreamType::ImplFacade::TypeTag TypeTag; + typedef StreamType::ImplFacade::DataBuffer DataBuffer; public: virtual Symbol getLibID() const =0; @@ -50,5 +51,5 @@ namespace control { }; -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/memento-tie.hpp b/src/proc/control/memento-tie.hpp index af63d38d1..917fa1428 100644 --- a/src/proc/control/memento-tie.hpp +++ b/src/proc/control/memento-tie.hpp @@ -53,6 +53,7 @@ #include +namespace proc { namespace control { using boost::equality_comparable; @@ -213,5 +214,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/pathmanager.cpp b/src/proc/control/pathmanager.cpp index 0e3375083..17870694a 100644 --- a/src/proc/control/pathmanager.cpp +++ b/src/proc/control/pathmanager.cpp @@ -23,6 +23,7 @@ #include "proc/control/pathmanager.hpp" +namespace proc { namespace control { @@ -30,4 +31,4 @@ namespace control { /** */ -} // namespace control +}} // namespace proc::control diff --git a/src/proc/control/pathmanager.hpp b/src/proc/control/pathmanager.hpp index 63ea761c2..1c0e11722 100644 --- a/src/proc/control/pathmanager.hpp +++ b/src/proc/control/pathmanager.hpp @@ -27,6 +27,7 @@ +namespace proc { namespace control { @@ -44,5 +45,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/proc-dispatcher.cpp b/src/proc/control/proc-dispatcher.cpp index b7bb53fc4..6d558678a 100644 --- a/src/proc/control/proc-dispatcher.cpp +++ b/src/proc/control/proc-dispatcher.cpp @@ -32,6 +32,7 @@ //#include //using boost::str; +namespace proc { namespace control { @@ -94,4 +95,4 @@ namespace control { -} // namespace control +}} // namespace proc::control diff --git a/src/proc/control/proc-dispatcher.hpp b/src/proc/control/proc-dispatcher.hpp index e955b66c5..14f76d09e 100644 --- a/src/proc/control/proc-dispatcher.hpp +++ b/src/proc/control/proc-dispatcher.hpp @@ -43,6 +43,7 @@ +namespace proc { namespace control { // using lib::Symbol; @@ -74,5 +75,5 @@ namespace control { -} // namespace control +}} // namespace proc::control #endif diff --git a/src/proc/control/stypemanager.cpp b/src/proc/control/stypemanager.cpp index 31b5fc8c4..5b386c99b 100644 --- a/src/proc/control/stypemanager.cpp +++ b/src/proc/control/stypemanager.cpp @@ -27,6 +27,7 @@ #include "include/lifecycle.h" +namespace proc { namespace control { using lib::Symbol; @@ -113,7 +114,7 @@ namespace control { UNIMPLEMENTED ("STypeManager basic functionality: wire up implementation facade (impl type) from given raw type of the library"); } -} // namespace control +}} // namespace proc::control // ==== C interface for registering setup of basic stream type configuration ======= @@ -121,5 +122,5 @@ namespace control { void lumiera_StreamType_registerInitFunction (void setupFun(void)) { - lumiera::LifecycleHook (control::ON_STREAMTYPES_RESET, setupFun); + lumiera::LifecycleHook (proc::control::ON_STREAMTYPES_RESET, setupFun); } diff --git a/src/proc/control/stypemanager.hpp b/src/proc/control/stypemanager.hpp index f3cbd3444..d59120b65 100644 --- a/src/proc/control/stypemanager.hpp +++ b/src/proc/control/stypemanager.hpp @@ -21,8 +21,8 @@ */ -#ifndef CONTROL_STYPEMANAGER_H -#define CONTROL_STYPEMANAGER_H +#ifndef PROC_CONTROL_STYPEMANAGER_H +#define PROC_CONTROL_STYPEMANAGER_H #include "proc/streamtype.hpp" @@ -31,6 +31,7 @@ #include +namespace proc { namespace control { using lib::Symbol; @@ -102,12 +103,12 @@ namespace control { } -} // namespace control +}} // namespace proc::control namespace proc_interface { - using control::STypeManager; + using proc::control::STypeManager; } // namespace proc_interface diff --git a/src/proc/control/styperegistry.hpp b/src/proc/control/styperegistry.hpp index 73bf97ba1..205260701 100644 --- a/src/proc/control/styperegistry.hpp +++ b/src/proc/control/styperegistry.hpp @@ -37,6 +37,7 @@ #define CONTROL_STYPEREGISTRY_H +#include "proc/control/stypemanager.hpp" //#include "lib/query.hpp" //#include "lib/util.hpp" //#include "lib/p.hpp" @@ -48,6 +49,7 @@ #include +namespace proc { namespace control { // using lib::P; @@ -63,7 +65,7 @@ namespace control { /** * @internal Helper for organising preconfigured default objects. - * Maintaines a collection of objects known or encountered as "default" + * Maintains a collection of objects known or encountered as "default" * for a given type. This collection is ordered by "degree of constriction", * which is implemented by counting the number of predicates in the query * used to define or identify each object. @@ -73,7 +75,8 @@ namespace control { * @todo as of 3/2008 the real query implementation is missing, and the * exact behaviour has to be defined. */ - class STypeManager::Registry : private boost::noncopyable + class STypeManager::Registry + : boost::noncopyable { public: @@ -81,6 +84,5 @@ namespace control { -} // namespace control - +}} // namespace proc::control #endif diff --git a/src/proc/engine/buffhandle.hpp b/src/proc/engine/buffhandle.hpp index 24816854d..ec8228ca7 100644 --- a/src/proc/engine/buffhandle.hpp +++ b/src/proc/engine/buffhandle.hpp @@ -59,7 +59,7 @@ namespace proc { namespace engine { - namespace error = ::lumiera::error; + namespace error = lumiera::error; using error::LUMIERA_ERROR_LIFECYCLE; typedef size_t HashVal; ////////////TICKET #722 diff --git a/src/proc/engine/nodeoperation.hpp b/src/proc/engine/nodeoperation.hpp index e656e9813..f6ef36cf9 100644 --- a/src/proc/engine/nodeoperation.hpp +++ b/src/proc/engine/nodeoperation.hpp @@ -336,5 +336,5 @@ namespace config { -}} // namespace engine::config +}}} // namespace proc::engine::config #endif diff --git a/src/proc/engine/nodewiring-config.hpp b/src/proc/engine/nodewiring-config.hpp index 713c68828..5a3b7e7e8 100644 --- a/src/proc/engine/nodewiring-config.hpp +++ b/src/proc/engine/nodewiring-config.hpp @@ -52,8 +52,8 @@ #define ENGINE_NODEWIRING_CONFIG_H -#include "lib/util.hpp" #include "lib/meta/configflags.hpp" +#include "lib/util.hpp" #include #include @@ -69,6 +69,8 @@ namespace config { using lumiera::typelist::CONFIG_FLAGS_MAX; + typedef size_t IxID; ///////////////////////////////TICKET #863 + /** * Helper for fabricating ProcNode Wiring configurations. @@ -125,7 +127,7 @@ namespace config { typedef std::tr1::shared_ptr PFunc; - typedef std::map ConfigTable; + typedef std::map ConfigTable; ConfigTable possibleConfig_; ///< Table of factories @@ -148,7 +150,7 @@ namespace config { template void - visit (size_t code) + visit (IxID code) { PFunc pFactory (new FactoryHolder > (ctor_param_)); factories_[code] = pFactory; @@ -170,7 +172,7 @@ namespace config { } FacFunction& - operator[] (size_t configFlags) ///< retrieve the factory corresponding to the given config + operator[] (IxID configFlags) ///< retrieve the factory corresponding to the given config { if (contains (possibleConfig_, configFlags)) return *possibleConfig_[configFlags]; @@ -182,5 +184,5 @@ namespace config { -}} // namespace engine::config +}}} // namespace proc::engine::config #endif diff --git a/src/proc/engine/nodewiring.cpp b/src/proc/engine/nodewiring.cpp index f216c0d14..a3a3b01c1 100644 --- a/src/proc/engine/nodewiring.cpp +++ b/src/proc/engine/nodewiring.cpp @@ -150,4 +150,4 @@ namespace engine { } -}} // namespace engine +}} // namespace proc::engine diff --git a/src/proc/engine/type-handler.hpp b/src/proc/engine/type-handler.hpp index b02f6e637..c3835d683 100644 --- a/src/proc/engine/type-handler.hpp +++ b/src/proc/engine/type-handler.hpp @@ -57,7 +57,7 @@ namespace engine { using std::tr1::function; using std::tr1::placeholders::_1; - namespace error = ::lumiera::error; + namespace error = lumiera::error; namespace { // (optional) helpers to build an object embedded into a buffer... diff --git a/src/proc/mobject/builder/buildertool.hpp b/src/proc/mobject/builder/buildertool.hpp index e707aabcc..8ba2b6ac3 100644 --- a/src/proc/mobject/builder/buildertool.hpp +++ b/src/proc/mobject/builder/buildertool.hpp @@ -106,9 +106,8 @@ namespace mobject { * as we simply store a pointer within the BuilderTool instance. */ class BuilderTool - : public ::lumiera::visitor::Tool - { - ::lumiera::WrapperPtr currentWrapper_; + : public lumiera::visitor::Tool + { lumiera::WrapperPtr currentWrapper_; public: @@ -167,11 +166,11 @@ namespace mobject { class TYPELIST // list of all concrete Buildables to be treated > class Applicable - : public ::lumiera::visitor::Applicable + : public lumiera::visitor::Applicable { } ; - using ::lumiera::typelist::Types; // convenience for the users of "Applicable" + using lumiera::typelist::Types; // convenience for the users of "Applicable" }// namespace mobject::builder @@ -182,7 +181,7 @@ namespace mobject { /** * Marker Interface for classes visitable by Builder tools. */ - class Buildable : public ::lumiera::visitor::Visitable + class Buildable : public lumiera::visitor::Visitable { }; diff --git a/src/proc/mobject/builder/segmentation-tool.cpp b/src/proc/mobject/builder/segmentation-tool.cpp index 69263068c..895a2fe53 100644 --- a/src/proc/mobject/builder/segmentation-tool.cpp +++ b/src/proc/mobject/builder/segmentation-tool.cpp @@ -24,19 +24,19 @@ #include "proc/mobject/builder/segmentation-tool.hpp" -using mobject::Buildable; -using mobject::session::Clip; -using mobject::session::Effect; - - namespace proc { namespace mobject { namespace builder { + using mobject::Buildable; + using session::Clip; + using session::Effect; + using session::Fixture; + /////////////////////////////////TICKET #414 - SegmentationTool::SegmentationTool(mobject::session::Fixture&) + SegmentationTool::SegmentationTool(Fixture&) { UNIMPLEMENTED ("create new SegmentationTool"); } diff --git a/src/proc/mobject/mobject-ref.hpp b/src/proc/mobject/mobject-ref.hpp index 03f0f4e85..457fe8f31 100644 --- a/src/proc/mobject/mobject-ref.hpp +++ b/src/proc/mobject/mobject-ref.hpp @@ -72,6 +72,8 @@ namespace proc { namespace mobject { + namespace error = lumiera::error; + class MObject; diff --git a/src/proc/mobject/placement-ref.hpp b/src/proc/mobject/placement-ref.hpp index 0887296de..bd859e52b 100644 --- a/src/proc/mobject/placement-ref.hpp +++ b/src/proc/mobject/placement-ref.hpp @@ -74,7 +74,7 @@ namespace proc { - namespace error = ::lumiera::error; + namespace error = lumiera::error; namespace mobject { diff --git a/src/proc/mobject/session/abstractmo.hpp b/src/proc/mobject/session/abstractmo.hpp index a06e8d4ca..7c6b9ef70 100644 --- a/src/proc/mobject/session/abstractmo.hpp +++ b/src/proc/mobject/session/abstractmo.hpp @@ -33,7 +33,7 @@ namespace proc { namespace mobject { namespace session { - namespace error = ::lumiera::error; + namespace error = lumiera::error; /** diff --git a/src/proc/mobject/session/bus-mo.hpp b/src/proc/mobject/session/bus-mo.hpp index 42509f1f6..eb8ef4bac 100644 --- a/src/proc/mobject/session/bus-mo.hpp +++ b/src/proc/mobject/session/bus-mo.hpp @@ -32,7 +32,7 @@ namespace proc { namespace asset { class Pipe; - typedef lumiera::P PPipe; + typedef P PPipe; } diff --git a/src/proc/mobject/session/defs-manager.hpp b/src/proc/mobject/session/defs-manager.hpp index fd473a625..f37c624be 100644 --- a/src/proc/mobject/session/defs-manager.hpp +++ b/src/proc/mobject/session/defs-manager.hpp @@ -39,7 +39,6 @@ namespace session { using lib::P; - using ::lumiera::Query; using boost::scoped_ptr; namespace impl { class DefsRegistry; } @@ -74,14 +73,14 @@ namespace session { * is considered \e misconfiguration. */ template - P operator() (Query const&); + P operator() (lumiera::Query const&); /** search through the registered defaults, never create anything. * @return object fulfilling the query, \c empty ptr if not found. */ template - P search (Query const&); + P search (lumiera::Query const&); /** retrieve an object fulfilling the query and register it as default. * The resolution is delegated to the ConfigQuery system (which may cause @@ -89,7 +88,7 @@ namespace session { * @return object fulfilling the query, \c empty ptr if no solution. */ template - P create (Query const&); + P create (lumiera::Query const&); /** register the given object as default, after ensuring it fulfils the * query. The latter may cause some properties of the object to be set, @@ -98,7 +97,7 @@ namespace session { * @note only a weak ref to the object is stored */ template - bool define (P const&, Query const& =Query()); + bool define (P const&, lumiera::Query const& =lumiera::Query()); /** remove the defaults registration of the given object, if there was such * @return false if nothing has been changed because the object wasn't registered diff --git a/src/proc/mobject/session/placement-index.cpp b/src/proc/mobject/session/placement-index.cpp index 8554674dd..8b12ece8f 100644 --- a/src/proc/mobject/session/placement-index.cpp +++ b/src/proc/mobject/session/placement-index.cpp @@ -90,8 +90,6 @@ namespace session { using util::for_each; using util::has_any; - using namespace lumiera; - LUMIERA_ERROR_DEFINE (NOT_IN_SESSION, "referring to a Placement not known to the current session"); LUMIERA_ERROR_DEFINE (PLACEMENT_TYPE, "requested Placement (pointee) type not compatible with data or context"); LUMIERA_ERROR_DEFINE (NONEMPTY_SCOPE, "Placement scope (still) contains other elements"); @@ -575,7 +573,7 @@ namespace session { struct SelfCheckFailure : error::Fatal { - SelfCheckFailure (Literal currentTest, string failure) + SelfCheckFailure (lib::Literal currentTest, string failure) : error::Fatal (string("Failed test: ")+currentTest+ " : "+failure ,LUMIERA_ERROR_INDEX_CORRUPTED) { } diff --git a/src/proc/mobject/session/placement-index.hpp b/src/proc/mobject/session/placement-index.hpp index 2d0fbea69..f6a416628 100644 --- a/src/proc/mobject/session/placement-index.hpp +++ b/src/proc/mobject/session/placement-index.hpp @@ -107,6 +107,7 @@ #include "lib/util.hpp" #include "lib/error.hpp" +#include "lib/symbol.hpp" #include "lib/itertools.hpp" #include "proc/mobject/placement.hpp" #include "proc/mobject/placement-ref.hpp" @@ -170,8 +171,9 @@ namespace session { typedef PlacementMO::ID _PID; - typedef std::tr1::unordered_multimap<_PID,_PID>::const_iterator ScopeIter; - typedef lib::RangeIter ScopeRangeIter; + typedef std::tr1::unordered_multimap<_PID,_PID>::const_iterator ScopeIter; + typedef lib::RangeIter ScopeRangeIter; + typedef lib::TransformIter _ID_TableIterator; @@ -179,7 +181,7 @@ namespace session { typedef PlacementRef PRef; typedef PlacementMO::ID const& ID; - typedef lib::TransformIter iterator; + typedef _ID_TableIterator iterator; /* == query operations == */ diff --git a/src/proc/mobject/session/query-resolver.hpp b/src/proc/mobject/session/query-resolver.hpp index 18908d760..7fe5631dc 100644 --- a/src/proc/mobject/session/query-resolver.hpp +++ b/src/proc/mobject/session/query-resolver.hpp @@ -21,8 +21,8 @@ */ -#ifndef MOBJECT_SESSION_QUERY_RESOLVER_H -#define MOBJECT_SESSION_QUERY_RESOLVER_H +#ifndef PROC_MOBJECT_SESSION_QUERY_RESOLVER_H +#define PROC_MOBJECT_SESSION_QUERY_RESOLVER_H //#include "proc/mobject/mobject.hpp" //#include "proc/mobject/placement.hpp" @@ -45,6 +45,7 @@ namespace proc { namespace mobject { namespace session { + using lib::IxID; using util::unConst; using boost::noncopyable; using boost::scoped_ptr; @@ -89,7 +90,7 @@ namespace session { struct QueryID { Kind kind; - size_t type; + IxID type; }; QueryID const& @@ -159,7 +160,7 @@ namespace session { typedef lib::TypedContext ResultType; template - inline size_t + inline IxID getResultTypeID() ///< @return unique ID denoting result type RES { return ResultType::ID::get(); diff --git a/src/proc/mobject/session/scope-path.cpp b/src/proc/mobject/session/scope-path.cpp index 44ec04c2d..badf0b1db 100644 --- a/src/proc/mobject/session/scope-path.cpp +++ b/src/proc/mobject/session/scope-path.cpp @@ -42,7 +42,6 @@ namespace session { using util::isSameObject; using util::isnil; - using namespace lumiera; LUMIERA_ERROR_DEFINE (EMPTY_SCOPE_PATH, "Placement scope not locatable (empty model path)"); diff --git a/src/proc/mobject/session/segment.cpp b/src/proc/mobject/session/segment.cpp index 87977a008..9ef7e8a0d 100644 --- a/src/proc/mobject/session/segment.cpp +++ b/src/proc/mobject/session/segment.cpp @@ -33,4 +33,4 @@ namespace session { -} // namespace proc::mobject::session +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/session-impl.cpp b/src/proc/mobject/session/session-impl.cpp index 4c44e06e6..d1a73760e 100644 --- a/src/proc/mobject/session/session-impl.cpp +++ b/src/proc/mobject/session/session-impl.cpp @@ -28,7 +28,6 @@ #include "proc/mobject/mobject.hpp" #include "lib/error.hpp" -using namespace lumiera; namespace proc { namespace mobject { diff --git a/src/proc/mobject/session/session.cpp b/src/proc/mobject/session/session.cpp index 322f3c150..583f7f3e9 100644 --- a/src/proc/mobject/session/session.cpp +++ b/src/proc/mobject/session/session.cpp @@ -40,15 +40,17 @@ #include "lib/singleton.hpp" -using lib::Symbol; -using lib::Singleton; -using mobject::session::SessManager; -using mobject::session::SessManagerImpl; -using mobject::session::SessionImplAPI; namespace proc { namespace mobject { + using lib::Symbol; + using lib::Singleton; + using session::SessManager; + using session::SessManagerImpl; + using session::SessionImplAPI; + + /** temporary fix for init problems * @todo really solve the basic init of session manager TICKET #518 diff --git a/src/proc/play/output-director.hpp b/src/proc/play/output-director.hpp index c88e4f13d..2783b097c 100644 --- a/src/proc/play/output-director.hpp +++ b/src/proc/play/output-director.hpp @@ -73,7 +73,7 @@ namespace play { : boost::noncopyable , public lib::Sync<> { - typedef ::lumiera::Subsys::SigTerm SigTerm; + typedef lumiera::Subsys::SigTerm SigTerm; scoped_ptr player_; diff --git a/src/proc/state.hpp b/src/proc/state.hpp index 07175c66a..e2e7414f4 100644 --- a/src/proc/state.hpp +++ b/src/proc/state.hpp @@ -35,8 +35,8 @@ namespace proc { namespace engine { - using ::lumiera::FrameID; - using ::lumiera::NodeID; + using lumiera::FrameID; + using lumiera::NodeID; class StateAdapter; class BuffTableStorage; diff --git a/src/proc/streamtype.hpp b/src/proc/streamtype.hpp index 3950914f8..29dcffa5d 100644 --- a/src/proc/streamtype.hpp +++ b/src/proc/streamtype.hpp @@ -31,8 +31,8 @@ */ -#ifndef PROC_STREAMTYPE_HPP -#define PROC_STREAMTYPE_HPP +#ifndef PROC_STREAMTYPE_H +#define PROC_STREAMTYPE_H #include "lib/symbol.hpp" diff --git a/tests/40components.tests b/tests/40components.tests index 615fe5bfe..da70c1ce4 100644 --- a/tests/40components.tests +++ b/tests/40components.tests @@ -511,7 +511,7 @@ return: 0 END -PLANNED "RefArray_test" RefArray_test <-..asset.+Dummy.\.001 -out: ID<..asset.+Dummy.>-strange -out: ID<..asset.+Dummy.>-..asset.+Dummy.\.002 +out: ID<..proc.asset.+Dummy.>-..proc.asset.+Dummy.\.001 +out: ID<..proc.asset.+Dummy.>-strange +out: ID<..proc.asset.+Dummy.>-..proc.asset.+Dummy.\.002 out: ID-track\.001 out: ID-track\.002 out: ID-special -out: sizeof\( ..asset.+EntryID.+mobject.+session.+Track.+ \) = -out: sizeof\( ..asset.+BareEntryID. \) = +out: sizeof\( ..proc.asset.+EntryID.+mobject.+session.+Track.+ \) = +out: sizeof\( ..proc.asset.+BareEntryID. \) = return: 0 END diff --git a/tests/43session.tests b/tests/43session.tests index 0ecfa5964..016864d6d 100644 --- a/tests/43session.tests +++ b/tests/43session.tests @@ -44,40 +44,40 @@ END TEST "external MObject references" MObjectRef_test < ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: Asset\(VIDEO:lumi.test-1 v1\) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: MRef-NIL out: sizeof\( .+MORef.+session.Clip.+ \) = (32|24) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: Asset\(VIDEO:lumi.test-2 v1\) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: MRef-NIL out: sizeof\( .+MORef.+session.Clip.+ \) = (32|24) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: Asset\(VIDEO:lumi.test-1 v1\) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: MRef-NIL out: sizeof\( .+MORef.+session.Clip.+ \) = (32|24) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: Asset\(VIDEO:lumi.test-2 v1\) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: MRef-NIL out: sizeof\( .+MORef.+session.Clip.+ \) = (32|24) out: Placement<.+Clip.>.+ use-cnt=4 out: Asset\(VIDEO:lumi.test-1 v1\) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: MRef-NIL out: sizeof\( .+MORef.+session.Clip.+ \) = (32|24) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: Asset\(VIDEO:lumi.test-1 v1\) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: MRef-NIL out: sizeof\( .+MORef.+session.Clip.+ \) = (32|24) -out: Placement<.+Clip.> ............... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=4 out: Asset\(VIDEO:lumi.test-2 v1\) -out: Placement<.+Clip.> ............... use-cnt=4 -out: Placement<.+Clip.> ............... use-cnt=5 +out: Placement<.+Clip.> .......... use-cnt=4 +out: Placement<.+Clip.> .......... use-cnt=5 out: \(VIDEO:lumi.test-1 v1\) END @@ -105,7 +105,7 @@ END TEST "PlacementRef_test" PlacementRef_test < .......... use-cnt=2 +out: Placement<.+TestSubMO21.> ..... use-cnt=2 out: specialAPI() END @@ -127,13 +127,13 @@ END TEST "Querying the index" PlacementIndexQuery_test < .......... use-cnt=1 -out: Placement<.+TestSubMO2.> ........... use-cnt=1 -out: Placement<.+TestSubMO1.> ........... use-cnt=1 -out: Placement<.+DummyMO.> ............... use-cnt=1 +out: Placement<.+TestSubMO21.> ..... use-cnt=1 +out: Placement<.+TestSubMO2.> ...... use-cnt=1 +out: Placement<.+TestSubMO1.> ...... use-cnt=1 +out: Placement<.+DummyMO.> .......... use-cnt=1 out: path to root starting at Placement<.+TestSubMO1 -out: Placement<.+TestSubMO2.> ........... use-cnt=1 -out: Placement<.+session.Label.> .............. use-cnt=1 +out: Placement<.+TestSubMO2.> ...... use-cnt=1 +out: Placement<.+session.Label.> ......... use-cnt=1 END diff --git a/tests/components/backend/media-access-mock.cpp b/tests/components/backend/media-access-mock.cpp index 096ecf197..837b27af4 100644 --- a/tests/components/backend/media-access-mock.cpp +++ b/tests/components/backend/media-access-mock.cpp @@ -90,7 +90,7 @@ namespace test { }; int Response::_i_(0); const ChanDesc NULLResponse; - using mobject::session::test::LENGTH_TestClip; + using proc::mobject::session::test::LENGTH_TestClip; struct TestCases : map diff --git a/tests/components/proc/asset/asset-category-test.cpp b/tests/components/proc/asset/asset-category-test.cpp index 7bfb68f4e..98ac06b2e 100644 --- a/tests/components/proc/asset/asset-category-test.cpp +++ b/tests/components/proc/asset/asset-category-test.cpp @@ -36,6 +36,7 @@ using std::string; using std::cout; +namespace proc { namespace asset{ namespace test { @@ -138,4 +139,4 @@ namespace test { -}} // namespace asset::test +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/asset-diagnostics.hpp b/tests/components/proc/asset/asset-diagnostics.hpp index 1429c622d..36ff66a33 100644 --- a/tests/components/proc/asset/asset-diagnostics.hpp +++ b/tests/components/proc/asset/asset-diagnostics.hpp @@ -50,6 +50,7 @@ using std::string; using std::cout; +namespace proc { namespace asset { inline void diff --git a/tests/components/proc/asset/basicpipetest.cpp b/tests/components/proc/asset/basicpipetest.cpp index 5c5a59456..316c24fde 100644 --- a/tests/components/proc/asset/basicpipetest.cpp +++ b/tests/components/proc/asset/basicpipetest.cpp @@ -42,174 +42,173 @@ using std::string; using std::cout; +namespace proc { namespace asset { namespace test { - using mobject::Session; - using lumiera::Query; - using lumiera::query::normaliseID; + using mobject::Session; + using lumiera::Query; + using lumiera::query::normaliseID; + + + + /*********************************************************************** + * @test basic properties of Pipe (structural) Assets. + *
  • created by referral
  • + *
  • access existing pipe by referral
  • + *
  • create with full properties
  • + *
  • access ProcPatt
  • + *
  • check dependency
  • + *
+ */ + class BasicPipe_test : public Test + { + virtual void run(Arg arg) + { + string pipeID = isnil(arg)? "Black Hole" : arg[1]; + string streamID = 2>arg.size()? "teststream" : arg[2] ; + + createExplicit (pipeID,streamID); + create_or_ref (pipeID); + create_using_default (); + dependProcPatt (pipeID); + } - - - /*********************************************************************** - * @test basic properties of Pipe (structural) Assets. - *
  • created by referral
  • - *
  • access existing pipe by referral
  • - *
  • create with full properties
  • - *
  • access ProcPatt
  • - *
  • check dependency
  • - *
- */ - class BasicPipe_test : public Test - { - virtual void run(Arg arg) - { - string pipeID = isnil(arg)? "Black Hole" : arg[1]; - string streamID = 2>arg.size()? "teststream" : arg[2] ; - - createExplicit (pipeID,streamID); - create_or_ref (pipeID); - create_using_default (); - dependProcPatt (pipeID); - } - - - - - void createExplicit (string pID, string sID) - { - string pID_sane (pID); - normaliseID (pID_sane); - CHECK (pID_sane != pID); - - PPipe thePipe = asset::Struct::retrieve.newPipe (pID,sID); - - CHECK (thePipe); - CHECK (thePipe->getProcPatt()); - CHECK (thePipe->getPipeID() == pID_sane); - CHECK (thePipe->getStreamID() == StreamType::ID(sID)); - CHECK (thePipe->shortDesc == pID_sane); - - Asset::Ident idi = thePipe->ident; - CHECK (idi.org == "lumi"); - CHECK (contains (idi.name, thePipe->getPipeID())); - CHECK (contains (idi.name, thePipe->getStreamID())); - - Category cat (idi.category); - Category refcat (STRUCT,"pipes"); - CHECK ( cat.hasKind(STRUCT) ); - CHECK ( cat.isWithin(refcat) ); - } - - - void create_or_ref(string pID) - { - normaliseID (pID); - - PPipe pipe1 = Pipe::query ("pipe("+pID+")"); - CHECK (pipe1); - CHECK (pipe1->getPipeID() == pID); - - string pID2 = "another-" + pID; - PPipe pipe2 = Pipe::query ("pipe("+pID2+")"); - CHECK (pipe2); - CHECK (pipe2 != pipe1); - Category c1 = pipe1->ident.category; - Category c2 = pipe2->ident.category; - CHECK (c1 == c2); - - PPipe pipe3 = Pipe::query ("pipe("+pID2+")"); + + + + void createExplicit (string pID, string sID) + { + string pID_sane (pID); + normaliseID (pID_sane); + CHECK (pID_sane != pID); + + PPipe thePipe = asset::Struct::retrieve.newPipe (pID,sID); + + CHECK (thePipe); + CHECK (thePipe->getProcPatt()); + CHECK (thePipe->getPipeID() == pID_sane); + CHECK (thePipe->getStreamID() == StreamType::ID(sID)); + CHECK (thePipe->shortDesc == pID_sane); + + Asset::Ident idi = thePipe->ident; + CHECK (idi.org == "lumi"); + CHECK (contains (idi.name, thePipe->getPipeID())); + CHECK (contains (idi.name, thePipe->getStreamID())); + + Category cat (idi.category); + Category refcat (STRUCT,"pipes"); + CHECK ( cat.hasKind(STRUCT) ); + CHECK ( cat.isWithin(refcat) ); + } + + + void create_or_ref(string pID) + { + normaliseID (pID); + + PPipe pipe1 = Pipe::query ("pipe("+pID+")"); + CHECK (pipe1); + CHECK (pipe1->getPipeID() == pID); + + string pID2 = "another-" + pID; + PPipe pipe2 = Pipe::query ("pipe("+pID2+")"); + CHECK (pipe2); + CHECK (pipe2 != pipe1); + Category c1 = pipe1->ident.category; + Category c2 = pipe2->ident.category; + CHECK (c1 == c2); + + PPipe pipe3 = Pipe::query ("pipe("+pID2+")"); //////////////////////////////////////////////////////////////TODO: that's broken; creating a new one instead to find the existing one, as it should be - CHECK (pipe3 == pipe2); - } - - - void create_using_default() - { - PPipe pipe1 = Pipe::query (""); // "the default pipe" - PPipe pipe2; - CHECK (pipe1); - CHECK (pipe1 == Session::current->defaults (Query())); - CHECK (pipe1->ident.category.hasKind(VIDEO)); - CHECK (pipe1->getProcPatt()); - PProcPatt propa = Session::current->defaults (Query("pipe(default)")); - CHECK (propa == pipe1->getProcPatt()); - - // several variants to query for "the default pipe" - pipe2 = Session::current->defaults(Query ()); - CHECK (pipe2 == pipe1); - pipe2 = asset::Struct::retrieve (Query ()); - CHECK (pipe2 == pipe1); - pipe2 = asset::Struct::retrieve (Query ("pipe(default)")); - CHECK (pipe2 == pipe1); - - string sID = pipe1->getStreamID(); // sort of a "default stream type" - PPipe pipe3 = Pipe::query ("stream("+sID+")"); - CHECK (pipe3); - CHECK (pipe3->getStreamID() == StreamType::ID(sID)); - CHECK (pipe3->getProcPatt() == Session::current->defaults (Query("stream("+sID+")"))); - } - - - void dependProcPatt(string pID) - { - typedef P PPipe; /////TODO: transition to P<> - typedef P PProcPatt; - - PPipe thePipe = Pipe::query ("pipe("+pID+")"); - CHECK (thePipe); - PProcPatt thePatt = thePipe->getProcPatt(); - CHECK (thePatt); - CHECK (dependencyCheck (thePipe, thePatt)); - - PProcPatt pattern2 = thePatt->newCopy("another"); - CHECK (thePatt != pattern2); - CHECK (!dependencyCheck (thePipe, pattern2)); - TODO ("add something to the new pattern, e.g. an effect"); - - // now querying for a pipe using this pattern (created on-the-fly) - // note: because the pattern is new, this new pipe will be used as - // default pipe for this pattern automatically - PPipe pipe2x = Pipe::query ("pattern(another)"); - CHECK (pattern2 == pipe2x->getProcPatt()); - CHECK (pipe2x == Session::current->defaults (Query("pattern(another)"))); - - thePipe->switchProcPatt(pattern2); - CHECK ( dependencyCheck (thePipe, pattern2)); - CHECK (!dependencyCheck (thePipe, thePatt)); - - AssetManager& aMang = AssetManager::instance(); - CHECK ( aMang.known (thePipe->getID())); - CHECK ( aMang.known (thePatt->getID())); - CHECK ( aMang.known (pattern2->getID())); - aMang.remove (pattern2->getID()); - CHECK ( aMang.known (thePatt->getID())); - CHECK (!aMang.known (pattern2->getID())); - CHECK (!aMang.known (thePipe->getID())); // has been unlinked too, because dependant on pattern2 - - CHECK (thePipe); - PProcPatt pattern3 = thePipe->getProcPatt(); /////TODO: transition to P<> - CHECK (thePipe->getProcPatt()); - CHECK ( pattern3 == pattern2); // but is still valid, as long as the ref is alive.... - - PPipe pipe3x = Pipe::query ("pattern(another)"); - pattern3 = pipe3x->getProcPatt(); /////TODO: transition to P<> - CHECK (pattern3 != pattern2); // because pattern2 is already unlinked... - CHECK (pipe3x == Session::current->defaults (Query("pattern(another)"))); - CHECK (pipe3x != pipe2x); // ..we got a new default pipe for "pattern(another)" too! - - - TRACE (asset_mem, "leaving BasicPipe_test::dependProcPatt()"); - // expect now pipe2x and pattern2 to be destroyed... - } - }; - - - /** Register this test class... */ - LAUNCHER (BasicPipe_test, "unit asset"); - - - - } // namespace test - -} // namespace asset + CHECK (pipe3 == pipe2); + } + + + void create_using_default() + { + PPipe pipe1 = Pipe::query (""); // "the default pipe" + PPipe pipe2; + CHECK (pipe1); + CHECK (pipe1 == Session::current->defaults (Query())); + CHECK (pipe1->ident.category.hasKind(VIDEO)); + CHECK (pipe1->getProcPatt()); + PProcPatt propa = Session::current->defaults (Query("pipe(default)")); + CHECK (propa == pipe1->getProcPatt()); + + // several variants to query for "the default pipe" + pipe2 = Session::current->defaults(Query ()); + CHECK (pipe2 == pipe1); + pipe2 = asset::Struct::retrieve (Query ()); + CHECK (pipe2 == pipe1); + pipe2 = asset::Struct::retrieve (Query ("pipe(default)")); + CHECK (pipe2 == pipe1); + + string sID = pipe1->getStreamID(); // sort of a "default stream type" + PPipe pipe3 = Pipe::query ("stream("+sID+")"); + CHECK (pipe3); + CHECK (pipe3->getStreamID() == StreamType::ID(sID)); + CHECK (pipe3->getProcPatt() == Session::current->defaults (Query("stream("+sID+")"))); + } + + + void dependProcPatt(string pID) + { + typedef P PPipe; /////TODO: transition to P<> + typedef P PProcPatt; + + PPipe thePipe = Pipe::query ("pipe("+pID+")"); + CHECK (thePipe); + PProcPatt thePatt = thePipe->getProcPatt(); + CHECK (thePatt); + CHECK (dependencyCheck (thePipe, thePatt)); + + PProcPatt pattern2 = thePatt->newCopy("another"); + CHECK (thePatt != pattern2); + CHECK (!dependencyCheck (thePipe, pattern2)); + TODO ("add something to the new pattern, e.g. an effect"); + + // now querying for a pipe using this pattern (created on-the-fly) + // note: because the pattern is new, this new pipe will be used as + // default pipe for this pattern automatically + PPipe pipe2x = Pipe::query ("pattern(another)"); + CHECK (pattern2 == pipe2x->getProcPatt()); + CHECK (pipe2x == Session::current->defaults (Query("pattern(another)"))); + + thePipe->switchProcPatt(pattern2); + CHECK ( dependencyCheck (thePipe, pattern2)); + CHECK (!dependencyCheck (thePipe, thePatt)); + + AssetManager& aMang = AssetManager::instance(); + CHECK ( aMang.known (thePipe->getID())); + CHECK ( aMang.known (thePatt->getID())); + CHECK ( aMang.known (pattern2->getID())); + aMang.remove (pattern2->getID()); + CHECK ( aMang.known (thePatt->getID())); + CHECK (!aMang.known (pattern2->getID())); + CHECK (!aMang.known (thePipe->getID())); // has been unlinked too, because dependant on pattern2 + + CHECK (thePipe); + PProcPatt pattern3 = thePipe->getProcPatt(); /////TODO: transition to P<> + CHECK (thePipe->getProcPatt()); + CHECK ( pattern3 == pattern2); // but is still valid, as long as the ref is alive.... + + PPipe pipe3x = Pipe::query ("pattern(another)"); + pattern3 = pipe3x->getProcPatt(); /////TODO: transition to P<> + CHECK (pattern3 != pattern2); // because pattern2 is already unlinked... + CHECK (pipe3x == Session::current->defaults (Query("pattern(another)"))); + CHECK (pipe3x != pipe2x); // ..we got a new default pipe for "pattern(another)" too! + + + TRACE (asset_mem, "leaving BasicPipe_test::dependProcPatt()"); + // expect now pipe2x and pattern2 to be destroyed... + } + }; + + + /** Register this test class... */ + LAUNCHER (BasicPipe_test, "unit asset"); + + + +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/compoundmediatest.cpp b/tests/components/proc/asset/compoundmediatest.cpp index f7bf248d0..d75274d80 100644 --- a/tests/components/proc/asset/compoundmediatest.cpp +++ b/tests/components/proc/asset/compoundmediatest.cpp @@ -35,73 +35,70 @@ using util::isnil; using std::string; -namespace asset - { - namespace test +namespace proc { +namespace asset{ +namespace test { + + + + + /*********************************************************************** + * Verifying the special operations available for compound media assets + * comprised of several elementary media assets. + */ + class CompoundMedia_test : public Test { - - - - - /*********************************************************************** - * Verifying the special operations available for compound media assets - * comprised of several elementary media assets. - */ - class CompoundMedia_test : public Test - { - virtual void run(Arg arg) - { - buildCompound(); - modifyCompound(); - verifyClipStructure(); - - if (!isnil (arg)) - dumpAssetManager(); - TRACE (asset_mem, "leaving CreateAsset_test::run()"); - } - - - - typedef shared_ptr PM; - - /** @test building a compound media asset by using a special - * factory, normally intended for loading existing sessions. - */ - void buildCompound() - { - UNIMPLEMENTED ("create new compound media"); - } - - /** @test adding and removing elementary media. - */ - void modifyCompound() - { - UNIMPLEMENTED ("add and remove elementary media to compound media asset"); - } - - - /** @test create a (compound) clip from some compound media asset - * and verify the clip mirrors the media asset's structure - */ - void verifyClipStructure() - { - UNIMPLEMENTED ("create compound clip from compound media and verify structure"); - } - - - bool checkProperties (PM object, Asset::Ident identity, string filename) - { - return identity == object->ident - && filename == object->getFilename(); - } - }; - - - /** Register this test class... */ - LAUNCHER (CompoundMedia_test, "unit asset"); - - - - } // namespace test - -} // namespace asset + virtual void run(Arg arg) + { + buildCompound(); + modifyCompound(); + verifyClipStructure(); + + if (!isnil (arg)) + dumpAssetManager(); + TRACE (asset_mem, "leaving CreateAsset_test::run()"); + } + + + + typedef shared_ptr PM; + + /** @test building a compound media asset by using a special + * factory, normally intended for loading existing sessions. + */ + void buildCompound() + { + UNIMPLEMENTED ("create new compound media"); + } + + /** @test adding and removing elementary media. + */ + void modifyCompound() + { + UNIMPLEMENTED ("add and remove elementary media to compound media asset"); + } + + + /** @test create a (compound) clip from some compound media asset + * and verify the clip mirrors the media asset's structure + */ + void verifyClipStructure() + { + UNIMPLEMENTED ("create compound clip from compound media and verify structure"); + } + + + bool checkProperties (PM object, Asset::Ident identity, string filename) + { + return identity == object->ident + && filename == object->getFilename(); + } + }; + + + /** Register this test class... */ + LAUNCHER (CompoundMedia_test, "unit asset"); + + + +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/create-asset-test.cpp b/tests/components/proc/asset/create-asset-test.cpp index f03893198..07b68d428 100644 --- a/tests/components/proc/asset/create-asset-test.cpp +++ b/tests/components/proc/asset/create-asset-test.cpp @@ -37,7 +37,8 @@ using util::isnil; using std::string; -namespace asset { +namespace proc { +namespace asset{ namespace test { @@ -205,4 +206,4 @@ namespace test { -}} // namespace asset::test +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/deleteassettest.cpp b/tests/components/proc/asset/deleteassettest.cpp index b47a93755..8b16d822f 100644 --- a/tests/components/proc/asset/deleteassettest.cpp +++ b/tests/components/proc/asset/deleteassettest.cpp @@ -32,36 +32,33 @@ using std::string; using std::cout; -namespace asset - { - namespace test +namespace proc { +namespace asset{ +namespace test { + + + + + /******************************************************************* + * @test deleting an Asset includes removing all dependent Assets + * and all MObjects relying on these. Especially this means + * breaking all links between the involved Objects, so the + * shared-ptrs can do the actual cleanup. + * @see asset::Asset#unlink + * @see mobject::MObject#unlink + */ + class DeleteAsset_test : public Test { - - - - - /******************************************************************* - * @test deleting an Asset includes removing all dependent Assets - * and all MObjects relying on these. Especially this means - * breaking all links between the involved Objects, so the - * shared-ptrs can do the actual cleanup. - * @see asset::Asset#unlink - * @see mobject::MObject#unlink - */ - class DeleteAsset_test : public Test - { - virtual void run(Arg) - { - UNIMPLEMENTED ("delete asset and update all dependencies"); - } - }; - - - /** Register this test class... */ - LAUNCHER (DeleteAsset_test, "function asset"); - - - - } // namespace test - -} // namespace asset + virtual void run(Arg) + { + UNIMPLEMENTED ("delete asset and update all dependencies"); + } + }; + + + /** Register this test class... */ + LAUNCHER (DeleteAsset_test, "function asset"); + + + +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/dependent-assets-test.cpp b/tests/components/proc/asset/dependent-assets-test.cpp index 0644dbcda..d50ab6d98 100644 --- a/tests/components/proc/asset/dependent-assets-test.cpp +++ b/tests/components/proc/asset/dependent-assets-test.cpp @@ -35,181 +35,181 @@ using util::isnil; +namespace proc { namespace asset{ namespace test { - - - - - /******************************************************************* - * @test the handling of Assets dependent on other Assets and the - * enabling/disabling of Assets. - * @see asset::Asset - * @see asset::Clip - */ - class DependentAssets_test : public Test - { - virtual void run (Arg) - { - checkDependencyMechanics (); - checkUnlinking (); - checkEnablementPropagation (); - checkRealAssetDependencyRegistration (); - } - - typedef TestAsset TA; - typedef TA::PA PTestA; - - - /** @test check operation of basic asset dependency support - */ - void checkDependencyMechanics () - { - PAsset a1 = TA::create(); - CHECK (isnil (a1->getParents())); - CHECK (isnil (a1->getDependant())); - - PTestA a2 = TA::create(a1); - CHECK (a1 == a2->getParents()[0]); // TestAsset registered a1 as parent - CHECK (a2 == a1->getDependant()[0]); - - PAsset a3 = TA::create(); - a2->set_depend(a3); - CHECK (a3 == a2->getParents()[1]); - CHECK (a2 == a3->getDependant()[0]); - CHECK (!contains (a1->getDependant(), a3)); - } - - - /** @test unlink operation removing inter asset links - */ - void checkUnlinking () - { - PTestA a1_ = TA::create(); - PAsset a1 (a1_); - PTestA a2_ = TA::create(a1); - PAsset a2 (a2_); - PAsset a3 = TA::create(a2); - CHECK (a1 == a2->getParents()[0]); - CHECK (a2 == a1->getDependant()[0]); - CHECK (a2 == a3->getParents()[0]); - CHECK (a3 == a2->getDependant()[0]); - - a2_->call_unlink(); - CHECK (isnil (a2->getDependant())); - CHECK (!contains (a1->getDependant(), a2)); // has been propagated up - CHECK (!isnil (a2->getParents())); - CHECK (contains (a3->getParents(), a2)); // but up-links remain intact - - a2_->call_unlink(a1->getID()); - a2_->set_depend(a1); - PAsset a4 = TA::create(a1); - CHECK (a1 == a2->getParents()[0]); - CHECK (a1 == a4->getParents()[0]); - CHECK (a2 == a1->getDependant()[0]); - CHECK (a4 == a1->getDependant()[1]); - - a1_->call_unlink(a4->getID()); - CHECK (!contains (a1->getDependant(), a4)); // selectively removed - CHECK ( contains (a1->getDependant(), a2)); - CHECK (a1 == a4->getParents()[0]); // no propagation - } - - - /** @test enabling and disabling an asset should - * propagate to dependant assets - */ - void checkEnablementPropagation () - { - PAsset a1 = TA::create(); - PTestA a2_= TA::create(a1); - PAsset a2 (a2_); - PAsset a3 = TA::create(); // not dependant - - CHECK (a1->isActive()); - CHECK (a2->isActive()); - CHECK (a3->isActive()); - - a1->enable(false); - CHECK (!a1->isActive()); - CHECK (!a2->isActive()); - CHECK (a3->isActive()); - - a2->enable(true); - CHECK (!a1->isActive()); - CHECK (!a2->isActive()); // ignored because parent is disabled - - a1->enable(true); - CHECK (a1->isActive()); - CHECK (a2->isActive()); - - a2->enable(false); - CHECK (a1->isActive()); - CHECK (!a2->isActive()); // disabling not propagated to parent - a2->enable(true); - CHECK (a1->isActive()); - CHECK (a2->isActive()); - - a3->enable(false); - CHECK (a1->isActive()); - CHECK (a2->isActive()); - CHECK (!a3->isActive()); // no dependency... - - a1->enable(false); - a3->enable(); - CHECK (!a1->isActive()); - CHECK (!a2->isActive()); - CHECK (a3->isActive()); - - a1->enable(); - a2_->set_depend(a3); // now add a new parent dependency - a3->enable(false); - CHECK (a1->isActive()); - CHECK (!a2->isActive()); // has been propagated via the new dependency - CHECK (!a3->isActive()); - - a2->enable(true); - CHECK (a1->isActive()); // no change because one of the parents is disbled - CHECK (!a2->isActive()); - CHECK (!a3->isActive()); - a1->enable(false); - CHECK (!a1->isActive()); - a3->enable(true); - CHECK (!a1->isActive()); // no propagation because the disabled other parent (a1) - CHECK (!a2->isActive()); - CHECK (a3->isActive()); - a1->enable(true); - CHECK (a1->isActive()); // but now propagation is possible - CHECK (a2->isActive()); - CHECK (a3->isActive()); - } - - - /** @test each real world asset subclass has to care - * for registering and deregistering any additional - * dependencies. Here we collect some more prominent - * examples (and hopefully don't fail to cover any - * important special cases...) - */ - void checkRealAssetDependencyRegistration () - { - Use4Test within_this_scope; - - // -----Media and Clip-------------------------------- - typedef P PM; - typedef P PC; - PM mm = asset::Media::create("test-1", VIDEO); - PC cc = mm->createClip()->findClipAsset(); - CHECK (dependencyCheck (cc,mm)); - - } - - }; - - - /** Register this test class... */ - LAUNCHER (DependentAssets_test, "unit function asset"); - - - -}} // namespace asset::test + + + + + /******************************************************************* + * @test the handling of Assets dependent on other Assets and the + * enabling/disabling of Assets. + * @see asset::Asset + * @see asset::Clip + */ + class DependentAssets_test : public Test + { + virtual void run (Arg) + { + checkDependencyMechanics (); + checkUnlinking (); + checkEnablementPropagation (); + checkRealAssetDependencyRegistration (); + } + + typedef TestAsset TA; + typedef TA::PA PTestA; + + + /** @test check operation of basic asset dependency support + */ + void checkDependencyMechanics () + { + PAsset a1 = TA::create(); + CHECK (isnil (a1->getParents())); + CHECK (isnil (a1->getDependant())); + + PTestA a2 = TA::create(a1); + CHECK (a1 == a2->getParents()[0]); // TestAsset registered a1 as parent + CHECK (a2 == a1->getDependant()[0]); + + PAsset a3 = TA::create(); + a2->set_depend(a3); + CHECK (a3 == a2->getParents()[1]); + CHECK (a2 == a3->getDependant()[0]); + CHECK (!contains (a1->getDependant(), a3)); + } + + + /** @test unlink operation removing inter asset links + */ + void checkUnlinking () + { + PTestA a1_ = TA::create(); + PAsset a1 (a1_); + PTestA a2_ = TA::create(a1); + PAsset a2 (a2_); + PAsset a3 = TA::create(a2); + CHECK (a1 == a2->getParents()[0]); + CHECK (a2 == a1->getDependant()[0]); + CHECK (a2 == a3->getParents()[0]); + CHECK (a3 == a2->getDependant()[0]); + + a2_->call_unlink(); + CHECK (isnil (a2->getDependant())); + CHECK (!contains (a1->getDependant(), a2)); // has been propagated up + CHECK (!isnil (a2->getParents())); + CHECK (contains (a3->getParents(), a2)); // but up-links remain intact + + a2_->call_unlink(a1->getID()); + a2_->set_depend(a1); + PAsset a4 = TA::create(a1); + CHECK (a1 == a2->getParents()[0]); + CHECK (a1 == a4->getParents()[0]); + CHECK (a2 == a1->getDependant()[0]); + CHECK (a4 == a1->getDependant()[1]); + + a1_->call_unlink(a4->getID()); + CHECK (!contains (a1->getDependant(), a4)); // selectively removed + CHECK ( contains (a1->getDependant(), a2)); + CHECK (a1 == a4->getParents()[0]); // no propagation + } + + + /** @test enabling and disabling an asset should + * propagate to dependant assets + */ + void checkEnablementPropagation () + { + PAsset a1 = TA::create(); + PTestA a2_= TA::create(a1); + PAsset a2 (a2_); + PAsset a3 = TA::create(); // not dependant + + CHECK (a1->isActive()); + CHECK (a2->isActive()); + CHECK (a3->isActive()); + + a1->enable(false); + CHECK (!a1->isActive()); + CHECK (!a2->isActive()); + CHECK (a3->isActive()); + + a2->enable(true); + CHECK (!a1->isActive()); + CHECK (!a2->isActive()); // ignored because parent is disabled + + a1->enable(true); + CHECK (a1->isActive()); + CHECK (a2->isActive()); + + a2->enable(false); + CHECK (a1->isActive()); + CHECK (!a2->isActive()); // disabling not propagated to parent + a2->enable(true); + CHECK (a1->isActive()); + CHECK (a2->isActive()); + + a3->enable(false); + CHECK (a1->isActive()); + CHECK (a2->isActive()); + CHECK (!a3->isActive()); // no dependency... + + a1->enable(false); + a3->enable(); + CHECK (!a1->isActive()); + CHECK (!a2->isActive()); + CHECK (a3->isActive()); + + a1->enable(); + a2_->set_depend(a3); // now add a new parent dependency + a3->enable(false); + CHECK (a1->isActive()); + CHECK (!a2->isActive()); // has been propagated via the new dependency + CHECK (!a3->isActive()); + + a2->enable(true); + CHECK (a1->isActive()); // no change because one of the parents is disbled + CHECK (!a2->isActive()); + CHECK (!a3->isActive()); + a1->enable(false); + CHECK (!a1->isActive()); + a3->enable(true); + CHECK (!a1->isActive()); // no propagation because the disabled other parent (a1) + CHECK (!a2->isActive()); + CHECK (a3->isActive()); + a1->enable(true); + CHECK (a1->isActive()); // but now propagation is possible + CHECK (a2->isActive()); + CHECK (a3->isActive()); + } + + + /** @test each real world asset subclass has to care + * for registering and deregistering any additional + * dependencies. Here we collect some more prominent + * examples (and hopefully don't fail to cover any + * important special cases...) + */ + void checkRealAssetDependencyRegistration () + { + Use4Test within_this_scope; + + // -----Media and Clip-------------------------------- + typedef P PM; + typedef P PC; + PM mm = asset::Media::create("test-1", VIDEO); + PC cc = mm->createClip()->findClipAsset(); + CHECK (dependencyCheck (cc,mm)); + } + + }; + + + /** Register this test class... */ + LAUNCHER (DependentAssets_test, "unit function asset"); + + + +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/entry-id-test.cpp b/tests/components/proc/asset/entry-id-test.cpp index c25e9f82c..757d38092 100644 --- a/tests/components/proc/asset/entry-id-test.cpp +++ b/tests/components/proc/asset/entry-id-test.cpp @@ -46,9 +46,12 @@ using std::endl; +namespace proc { namespace asset{ namespace test { + using lumiera::error::LUMIERA_ERROR_WRONG_TYPE; + namespace { // Test definitions... struct Dummy { }; @@ -280,4 +283,4 @@ namespace test { LAUNCHER (EntryID_test, "unit asset"); -}} // namespace asset::test +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/identityofassetstest.cpp b/tests/components/proc/asset/identityofassetstest.cpp index 2e1b4739c..27e70c69c 100644 --- a/tests/components/proc/asset/identityofassetstest.cpp +++ b/tests/components/proc/asset/identityofassetstest.cpp @@ -37,7 +37,8 @@ using util::isnil; using std::string; -namespace asset { +namespace proc { +namespace asset{ namespace test { @@ -105,4 +106,4 @@ namespace test { -}} // namespace asset::test +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/makecliptest.cpp b/tests/components/proc/asset/makecliptest.cpp index 99a7a3812..609df4c9e 100644 --- a/tests/components/proc/asset/makecliptest.cpp +++ b/tests/components/proc/asset/makecliptest.cpp @@ -39,54 +39,53 @@ using std::string; using std::tr1::static_pointer_cast; //TODO only temporarily; -namespace asset { - namespace test { - - //using mobject::NOBUG_FLAG(mobject_mem); - - - - /*********************************************************************** - * @test creating a Clip MObject and an associated Clip Asset from - * a given asset::Media. - * @see asset::Media#createClip - */ - class MakeClip_test : public Test - { - typedef P PM; - typedef asset::Media::PClipMO PC; - - virtual void run (Arg) - { - Use4Test within_this_scope; - - - PM mm = asset::Media::create("test-1", VIDEO); - PC cc = mm->createClip(); - PM cm = cc->getMedia(); - - CHECK (cm); - CHECK (!isnil (cc->getLength())); - CHECK (cm->ident.category.hasKind (VIDEO)); - CHECK (cm->getFilename() == mm->getFilename()); +namespace proc { +namespace asset{ +namespace test { + +//using mobject::NOBUG_FLAG(mobject_mem); + + + + /*********************************************************************** + * @test creating a Clip MObject and an associated Clip Asset from + * a given asset::Media. + * @see asset::Media#createClip + */ + class MakeClip_test : public Test + { + typedef P PM; + typedef asset::Media::PClipMO PC; + + virtual void run (Arg) + { + Use4Test within_this_scope; + + + PM mm = asset::Media::create("test-1", VIDEO); + PC cc = mm->createClip(); + PM cm = cc->getMedia(); + + CHECK (cm); + CHECK (!isnil (cc->getLength())); + CHECK (cm->ident.category.hasKind (VIDEO)); + CHECK (cm->getFilename() == mm->getFilename()); TODO ("implement Processing Pattern!!!"); // CHECK (cm->howtoProc() == mm->howtoProc()); - CHECK (cm->ident.org == mm->ident.org); - CHECK (dependencyCheck (cm,mm)); - - TRACE (asset_mem, "leaving MakeClip_test::run()"); - TRACE (mobject_mem, "leaving MakeClip_test::run()"); - } - - - }; - - - /** Register this test class... */ - LAUNCHER (MakeClip_test, "function asset"); - - - - } // namespace test - -} // namespace asset + CHECK (cm->ident.org == mm->ident.org); + CHECK (dependencyCheck (cm,mm)); + + TRACE (asset_mem, "leaving MakeClip_test::run()"); + TRACE (mobject_mem, "leaving MakeClip_test::run()"); + } + + + }; + + + /** Register this test class... */ + LAUNCHER (MakeClip_test, "function asset"); + + + +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/mediastructurequerytest.cpp b/tests/components/proc/asset/mediastructurequerytest.cpp index 99f0aaab8..14f7aeb9f 100644 --- a/tests/components/proc/asset/mediastructurequerytest.cpp +++ b/tests/components/proc/asset/mediastructurequerytest.cpp @@ -34,35 +34,32 @@ using util::isnil; using std::string; -namespace asset - { - namespace test +namespace proc { +namespace asset{ +namespace test { + + + + + /*********************************************************************** + * This test documents the Interface used by MediaFactory when loading + * media files for querying Lumiera's backend layer for information + * on how the media file is structured. + */ + class MediaStructureQuery_test : public Test { - - - - - /*********************************************************************** - * This test documents the Interface used by MediaFactory when loading - * media files for querying Lumiera's backend layer for information - * on how the media file is structured. - */ - class MediaStructureQuery_test : public Test - { - virtual void run(Arg) - { - UNIMPLEMENTED ("querying media file structure from backend"); - } - - - }; - - - /** Register this test class... */ - LAUNCHER (MediaStructureQuery_test, "unit asset"); - - - - } // namespace test - -} // namespace asset + virtual void run(Arg) + { + UNIMPLEMENTED ("querying media file structure from backend"); + } + + + }; + + + /** Register this test class... */ + LAUNCHER (MediaStructureQuery_test, "unit asset"); + + + +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/meta/time-grid-basics-test.cpp b/tests/components/proc/asset/meta/time-grid-basics-test.cpp index c40ac7cbb..ea98b04bc 100644 --- a/tests/components/proc/asset/meta/time-grid-basics-test.cpp +++ b/tests/components/proc/asset/meta/time-grid-basics-test.cpp @@ -40,6 +40,7 @@ using std::endl; +namespace proc { namespace asset{ namespace meta { namespace test { @@ -129,4 +130,4 @@ namespace test { LAUNCHER (TimeGridBasics_test, "unit asset"); -}}} // namespace asset::meta::test +}}}} // namespace proc::asset::meta::test diff --git a/tests/components/proc/asset/orderingofassetstest.cpp b/tests/components/proc/asset/orderingofassetstest.cpp index 130b55bfe..62cdede05 100644 --- a/tests/components/proc/asset/orderingofassetstest.cpp +++ b/tests/components/proc/asset/orderingofassetstest.cpp @@ -36,98 +36,97 @@ using util::isnil; using std::string; -namespace asset { - namespace test { - - - - - /****************************************************** - * @test validate the equality and order relations of - * Asset::Ident and Asset objects. - * @note a known problem is that only Asset smart ptrs - * are supported for comparison, not smartpointers - * of Asset subclasses. To solve this, we would - * either have to repeat the operator definitions, - * or resort to template metaprogramming tricks. - * Just providing templated comparison operators - * would generally override the behaviour of - * std::shared_ptr, which is not desirable. - * @see Asset::Ident#compare - */ - class OrderingOfAssets_test : public Test - { - virtual void run(Arg) - { - Use4Test within_this_scope; - - - Asset::Ident key1("test-1", Category(AUDIO), "ichthyo", 5); - PAsset mm1 = asset::Media::create(key1, "Name-1"); - - Asset::Ident key2("test-1", Category(AUDIO), "ichthyo", 7); - PAsset mm2 = asset::Media::create(key2, "Name-2"); - - Asset::Ident key3("test-2", Category(AUDIO), "ichthyo", 5); - PAsset mm3 = asset::Media::create(key3, "Name-3"); - - Asset::Ident key4("test-2", Category(AUDIO), "stega", 5); - PAsset mm4 = asset::Media::create(key4, "Name-4"); - - Asset::Ident key5("test-1", Category(VIDEO), "ichthyo", 5); - PAsset mm5 = asset::Media::create(key5, "Name-5"); - - - // ordering of keys - CHECK (key1 == key2); - CHECK (key2 != key3); - CHECK (key3 != key4); - CHECK (key4 != key5); - CHECK (key1 != key5); - - CHECK ( 0 > key2.compare(key3)); - CHECK ( 0 < key3.compare(key2)); - - CHECK ( 0 > key3.compare(key4)); - CHECK ( 0 > key4.compare(key5)); - CHECK ( 0 > key1.compare(key5)); - CHECK ( 0 > key2.compare(key5)); - CHECK ( 0 > key3.compare(key5)); - CHECK ( 0 > key1.compare(key3)); - CHECK ( 0 > key1.compare(key4)); - CHECK ( 0 > key2.compare(key4)); - - - // ordering of Asset smart ptrs - CHECK (mm1 == mm2); - CHECK (mm2 != mm3); - CHECK (mm3 != mm4); - CHECK (mm4 != mm5); - CHECK (mm1 != mm5); - - CHECK (mm2 < mm3); - CHECK (mm2 <= mm3); - CHECK (mm3 > mm2); - CHECK (mm3 >= mm2); - - CHECK (mm3 < mm4); - CHECK (mm4 < mm5); - CHECK (mm1 < mm5); - CHECK (mm2 < mm5); - CHECK (mm3 < mm5); - CHECK (mm1 < mm3); - CHECK (mm1 < mm4); - CHECK (mm2 < mm4); - - } - }; - - - /** Register this test class... */ - LAUNCHER (OrderingOfAssets_test, "unit asset"); - - - - } // namespace test - -} // namespace asset +namespace proc { +namespace asset{ +namespace test { + + + + + /****************************************************** + * @test validate the equality and order relations of + * Asset::Ident and Asset objects. + * @note a known problem is that only Asset smart ptrs + * are supported for comparison, not smartpointers + * of Asset subclasses. To solve this, we would + * either have to repeat the operator definitions, + * or resort to template metaprogramming tricks. + * Just providing templated comparison operators + * would generally override the behaviour of + * std::shared_ptr, which is not desirable. + * @see Asset::Ident#compare + */ + class OrderingOfAssets_test : public Test + { + virtual void run(Arg) + { + Use4Test within_this_scope; + + + Asset::Ident key1("test-1", Category(AUDIO), "ichthyo", 5); + PAsset mm1 = asset::Media::create(key1, "Name-1"); + + Asset::Ident key2("test-1", Category(AUDIO), "ichthyo", 7); + PAsset mm2 = asset::Media::create(key2, "Name-2"); + + Asset::Ident key3("test-2", Category(AUDIO), "ichthyo", 5); + PAsset mm3 = asset::Media::create(key3, "Name-3"); + + Asset::Ident key4("test-2", Category(AUDIO), "stega", 5); + PAsset mm4 = asset::Media::create(key4, "Name-4"); + + Asset::Ident key5("test-1", Category(VIDEO), "ichthyo", 5); + PAsset mm5 = asset::Media::create(key5, "Name-5"); + + + // ordering of keys + CHECK (key1 == key2); + CHECK (key2 != key3); + CHECK (key3 != key4); + CHECK (key4 != key5); + CHECK (key1 != key5); + + CHECK ( 0 > key2.compare(key3)); + CHECK ( 0 < key3.compare(key2)); + + CHECK ( 0 > key3.compare(key4)); + CHECK ( 0 > key4.compare(key5)); + CHECK ( 0 > key1.compare(key5)); + CHECK ( 0 > key2.compare(key5)); + CHECK ( 0 > key3.compare(key5)); + CHECK ( 0 > key1.compare(key3)); + CHECK ( 0 > key1.compare(key4)); + CHECK ( 0 > key2.compare(key4)); + + + // ordering of Asset smart ptrs + CHECK (mm1 == mm2); + CHECK (mm2 != mm3); + CHECK (mm3 != mm4); + CHECK (mm4 != mm5); + CHECK (mm1 != mm5); + + CHECK (mm2 < mm3); + CHECK (mm2 <= mm3); + CHECK (mm3 > mm2); + CHECK (mm3 >= mm2); + + CHECK (mm3 < mm4); + CHECK (mm4 < mm5); + CHECK (mm1 < mm5); + CHECK (mm2 < mm5); + CHECK (mm3 < mm5); + CHECK (mm1 < mm3); + CHECK (mm1 < mm4); + CHECK (mm2 < mm4); + + } + }; + + + /** Register this test class... */ + LAUNCHER (OrderingOfAssets_test, "unit asset"); + + + +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/testasset.cpp b/tests/components/proc/asset/testasset.cpp index 12eba65ad..31aba2acf 100644 --- a/tests/components/proc/asset/testasset.cpp +++ b/tests/components/proc/asset/testasset.cpp @@ -26,71 +26,70 @@ using std::tr1::static_pointer_cast; -namespace asset - { - namespace test + +namespace proc { +namespace asset{ +namespace test { + + namespace { + uint counter (0); - namespace - { - uint counter (0); - - /** @internal helper generating continuosely - * different new asset identities - */ - Asset::Ident - make_new_ident () - { - return Asset::Ident ( str(format("TestAsset.%i") % counter) - , Category (META) - , "test" - , counter++ - ); - } - Asset::Ident - make_new_ident (PAsset& ref) - { - return Asset::Ident ( str(format("%s-TestAsset.%i") % ref->ident.name - % counter) - , ref->ident.category - , "test" - , counter++ - ); - } - } - - - template - TestAsset::TestAsset () - : A(make_new_ident ()) - { }; - - - template - TestAsset::TestAsset (PAsset& pRef) - : A(make_new_ident (pRef)) - { - this->defineDependency(pRef); - }; - - - /** @internal helper for the create()-Functions - * retrieving the smart ptr created automatically - * within AssetManager by the Asset base class ctor + /** @internal helper generating continuously + * different new asset identities */ - template - P > - TestAsset::ptrFromThis () + Asset::Ident + make_new_ident () { - return static_pointer_cast,Asset> - (AssetManager::instance().getAsset (this->id)); - }; + return Asset::Ident ( str(format("TestAsset.%i") % counter) + , Category (META) + , "test" + , counter++ + ); + } + Asset::Ident + make_new_ident (PAsset& ref) + { + return Asset::Ident ( str(format("%s-TestAsset.%i") % ref->ident.name + % counter) + , ref->ident.category + , "test" + , counter++ + ); + } + } + + + template + TestAsset::TestAsset () + : A(make_new_ident ()) + { }; + + + template + TestAsset::TestAsset (PAsset& pRef) + : A(make_new_ident (pRef)) + { + this->defineDependency(pRef); + }; + + + /** @internal helper for the create()-Functions + * retrieving the smart ptr created automatically + * within AssetManager by the Asset base class ctor + */ + template + P > + TestAsset::ptrFromThis () + { + return static_pointer_cast,Asset> + (AssetManager::instance().getAsset (this->id)); + }; - } // namespace test - -} // namespace asset +}}} // namespace proc::asset::test + @@ -99,25 +98,22 @@ namespace asset /* explicit template instantiations for some Asset Kinds */ /*********************************************************/ -#include "proc/asset/unknown.hpp" +#include "proc/asset/unknown.hpp" -namespace asset - { - namespace test - { +namespace proc { +namespace asset{ +namespace test { - template TestAsset::TestAsset (); - template TestAsset::TestAsset (); - - template TestAsset::TestAsset (PAsset& pRef); - template TestAsset::TestAsset (PAsset& pRef); - - template P > TestAsset::ptrFromThis (); - template P > TestAsset::ptrFromThis (); - + template TestAsset::TestAsset (); + template TestAsset::TestAsset (); + + template TestAsset::TestAsset (PAsset& pRef); + template TestAsset::TestAsset (PAsset& pRef); + + template P > TestAsset::ptrFromThis (); + template P > TestAsset::ptrFromThis (); - } // namespace test -} // namespace asset +}}} // namespace proc::asset::test diff --git a/tests/components/proc/asset/testasset.hpp b/tests/components/proc/asset/testasset.hpp index f352d3cb8..7de1006ab 100644 --- a/tests/components/proc/asset/testasset.hpp +++ b/tests/components/proc/asset/testasset.hpp @@ -34,45 +34,42 @@ using boost::format; using std::string; -namespace asset - { - namespace test +namespace proc { +namespace asset{ +namespace test { + + + /** + * Test(mock) asset subclass usable for hijacking a given + * asset class (template parameter) and subsequently accessing + * internal facillities for writing unit tests. Prerequisite + * for using this template is that the used asset base class + * has a (protected) ctor taking an Asset::Ident.... + */ + template + class TestAsset : public A { - - - /** - * Test(mock) asset subclass usable for hijacking a given - * asset class (template parameter) and subsequently accessing - * internal facillities for writing unit tests. Prerequisite - * for using this template is that the used asset base class - * has a (protected) ctor taking an Asset::Ident.... - */ - template - class TestAsset : public A - { - TestAsset () ; - TestAsset (PAsset&); ///< declared dependant on the given Asset - - static void deleter (TestAsset* aa) { delete aa; } - - public: - typedef P > PA; - - static PA create () { return (new TestAsset )->ptrFromThis(); } - static PA create (PAsset& pRef) { return (new TestAsset (pRef))->ptrFromThis(); } - - /* === interesting asset features we want to access for tests === */ - void call_unlink () { this->unlink (); } - void call_unlink (IDA target) { this->unlink (target); } - void set_depend (PAsset parent) { this->defineDependency (parent); } - - private: - PA ptrFromThis (); - }; + TestAsset () ; + TestAsset (PAsset&); ///< declared dependant on the given Asset + + static void deleter (TestAsset* aa) { delete aa; } + + public: + typedef P > PA; + + static PA create () { return (new TestAsset )->ptrFromThis(); } + static PA create (PAsset& pRef) { return (new TestAsset (pRef))->ptrFromThis(); } + + /* === interesting asset features we want to access for tests === */ + void call_unlink () { this->unlink (); } + void call_unlink (IDA target) { this->unlink (target); } + void set_depend (PAsset parent) { this->defineDependency (parent); } + + private: + PA ptrFromThis (); + }; - } // namespace test - -}} // namespace proc::asset +}}} // namespace proc::asset::test #endif diff --git a/tests/components/proc/asset/testclipasset.hpp b/tests/components/proc/asset/testclipasset.hpp index a43dd4d7e..31db981b4 100644 --- a/tests/components/proc/asset/testclipasset.hpp +++ b/tests/components/proc/asset/testclipasset.hpp @@ -36,8 +36,9 @@ using std::string; using std::cout; -namespace asset - { +namespace proc { +namespace asset{ + /** * An asset::Media instance Test Clip for checking * various Asset operations and for creating @@ -48,10 +49,9 @@ namespace asset { public: }; - - - - - + + + + }} // namespace proc::asset #endif diff --git a/tests/components/proc/asset/typed-id-test.cpp b/tests/components/proc/asset/typed-id-test.cpp index f5de32f52..23fb0af84 100644 --- a/tests/components/proc/asset/typed-id-test.cpp +++ b/tests/components/proc/asset/typed-id-test.cpp @@ -54,15 +54,16 @@ using std::endl; +namespace proc { namespace mobject { namespace session { namespace test { struct DummyEntity { }; ////////////////////////TODO of course the key idea is to mix in TypedID::link, to get an automatic registration and deregistartion - typedef lumiera::P PDum; + typedef P PDum; -}}} +}}}} namespace lumiera{ ///////TODO: shouldn't that be namespace lib? or proc? namespace query { @@ -73,16 +74,17 @@ namespace query { * Of course this is a test/dummy/demonstration. */ template<> - struct TypeHandlerXX + struct TypeHandlerXX { static Symbol getID() { return "typed-id-test-dummy"; } }; - }} +}} +namespace proc { namespace asset{ namespace test { @@ -242,4 +244,4 @@ namespace test { LAUNCHER (TypedID_test, "unit asset"); -}} // namespace asset::test +}}} // namespace proc::asset::test diff --git a/tests/components/proc/control/argument-tuple-accept-test.cpp b/tests/components/proc/control/argument-tuple-accept-test.cpp index 38618bcba..b31ee44c1 100644 --- a/tests/components/proc/control/argument-tuple-accept-test.cpp +++ b/tests/components/proc/control/argument-tuple-accept-test.cpp @@ -35,6 +35,7 @@ using std::cout; using std::endl; +namespace proc { namespace control { namespace test { @@ -123,4 +124,4 @@ namespace test { LAUNCHER (ArgumentTupleAccept_test, "unit controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-argument-test.cpp b/tests/components/proc/control/command-argument-test.cpp index 084940255..a4413e7fa 100644 --- a/tests/components/proc/control/command-argument-test.cpp +++ b/tests/components/proc/control/command-argument-test.cpp @@ -51,22 +51,23 @@ using std::cout; using std::endl; +namespace proc { namespace control { namespace test { - + using lib::test::showSizeof; using lib::test::randTime; using namespace lumiera::typelist; - - - - - + + + + + namespace { // test helpers - + ostringstream protocol; ///< used to verify the test function calls - - + + /** * watching the instance creation * of some parameter values @@ -76,54 +77,54 @@ namespace test { { TY element_; static int instanceCnt; - + Tracker (TY init = TY()) : element_(init) { ++instanceCnt; } Tracker (Tracker const& otr) : element_(otr.element_) { ++instanceCnt; } ~Tracker() { --instanceCnt; } - + TY& operator* () { return element_; } - + operator string() const { return element_; } - + friend ostream& operator<< (ostream& out, const Tracker& tra) { return out << tra.element_; } - + friend bool operator== (Tracker const& tra1, Tracker const& tra2) { return tra1.element_ == tra2.element_; } }; - + template int Tracker::instanceCnt (0); - - + + /** Dummy custom memento datatype * @note memento needs to be equality comparable */ struct Sint5 { int i[5]; - + friend bool operator== (Sint5 const& i1, Sint5 const& i2) { return i1.i == i2.i; } }; - - - + + + /* === functions to implement test-"operation" & UNDO === */ - + void doIt (Tracker time, Tracker str, int rand) { @@ -131,40 +132,40 @@ namespace test { cout << "invoke operation..." << endl; protocol << fmt % *time % *str % rand; } - + Tracker captureState (Tracker, Tracker xstr, int) { cout << "capture state..." << endl; return protocol.str() + *xstr; } - + void undoIt (Tracker time, Tracker, int, Tracker memento) { cout << "undo... memento=" << memento << endl; protocol << "undoIt(time="< ArgTuples; - + /*************************************************************************** * @test Check storage handling of the command parameters and state memento. * @@ -193,33 +194,33 @@ namespace test { */ class CommandArgument_test : public Test { - + virtual void run (Arg) { ArgTuples testTuples; Tracker::instanceCnt = 0; Tracker::instanceCnt = 0; - + createTuples (testTuples); checkArgumentComparison (); serialiseArgTuples (testTuples); testTuples.clear(); - + simulateCmdLifecycle(); - + // verify all dtors properly called... CHECK (0 == Tracker::instanceCnt); CHECK (0 == Tracker::instanceCnt); } - - + + typedef Tracker TTime; typedef Tracker Tstr; - - - - + + + + /** @test create various argument tuples and re-access their contents */ void createTuples (ArgTuples& tup) @@ -228,47 +229,47 @@ namespace test { typedef ArgumentHolder A2; typedef ArgumentHolder A3; typedef ArgumentHolder A4; - + typedef ArgumentHolder A5; - - + + A1* arg1 = new A1(); tup.manage (arg1); A2* arg2 = new A2(); tup.manage (arg2); A3* arg3 = new A3(); tup.manage (arg3); A4* arg4 = new A4(); tup.manage (arg4); A5* arg5 = new A5(); tup.manage (arg5); - + CHECK (isnil (*arg1)); CHECK (isnil (*arg2)); CHECK (isnil (*arg3)); CHECK (isnil (*arg4)); CHECK (isnil (*arg5)); - + for_each (tup, showIt); - + arg1->storeTuple (tuple::makeNullTuple()); arg2->storeTuple (tuple::make (rand() % 10)); arg3->storeTuple (tuple::make (rand() % 10, TimeVar(randTime()))); arg4->storeTuple (tuple::make (rand() % 10, TimeVar(randTime()))); - + arg5->storeTuple (tuple::make (TTime (randTime()), Tstr("glorious"), twoRandomDigits() )); - + CHECK (!arg5->canUndo()); - + arg5->tie(undoIt, captureState) .tieCaptureFunc() // bind capturing function to memento storage, (TTime(), Tstr("destruction"), 11); // then invoke the bound capturing mechanism - + CHECK (arg5->canUndo()); CHECK (*arg5->memento() == "destruction"); - + VERIFY_ERROR(MISSING_MEMENTO, arg4->memento().i[3] = 513 ); - + for_each (tup, showIt); } - - - + + + /** @test serialise and de-serialise each tuple and check validity * @todo unimplemented, waiting on Serialiser */ @@ -277,41 +278,41 @@ namespace test { { for_each (tup, checkSerialisation); } - - - + + + /** @test verify the comparison operators */ void checkArgumentComparison () { ArgumentHolder one, two; CHECK (one == two); // empty, identically typed argument holders -->equal - + one.tie(dummyU,dummyC) .tieCaptureFunc()(1,9); CHECK (one != two); // now one contains captured UNDO state - + two.tie(dummyU,dummyC) .tieCaptureFunc()(1,9); two.memento() = one.memento(); // put the same UNDO state in both CHECK (one == two); // ...makes them equal again - + one.storeTuple (tuple::make (1,2)); CHECK (one != two); // verify argument tuple comparison CHECK (two != one); CHECK (!isnil (one)); CHECK ( isnil (two)); - + two.storeTuple (tuple::make (3,4)); CHECK (!isnil (two)); CHECK (one != two); CHECK (two != one); - + one.storeTuple (tuple::make (1,4)); CHECK (!isnil (one)); CHECK (one != two); CHECK (two != one); - + one.storeTuple (tuple::make (3,4)); CHECK (!isnil (one)); CHECK (one == two); @@ -321,9 +322,9 @@ namespace test { CHECK (one != two); CHECK (two != one); } - - - + + + /** @test simulate a complete command lifecycle with regards to the * storage handling of the command parameters and state memento. */ @@ -333,71 +334,71 @@ namespace test { typedef void SIG_do(Tracker, Tracker, int); typedef ArgumentHolder > Args; typedef MementoTie > MemHolder; - + Args args; CHECK (isnil (args)); cout << showSizeof(args) << endl; - + // store a set of parameter values, later to be used on invocation args.storeTuple ( tuple::make (TTime(randTime()), Tstr("Lumiera rocks"), twoRandomDigits() )); CHECK (!isnil (args)); cout << args << endl; - + CHECK (!args.canUndo()); VERIFY_ERROR(MISSING_MEMENTO, args.memento() ); - + MemHolder& memHolder = args.tie(undoIt,captureState); CHECK (!memHolder); // no stored memento.... CHECK (!args.canUndo()); - + function doItFun = doIt; function undoFun = memHolder.tieUndoFunc(); function captFun = memHolder.tieCaptureFunc(); - + typedef function OpFun; - + // now close all the functions with the stored parameter values... OpFun bound_doItFun = std::tr1::bind (&CmdClosure::invoke, args, CmdFunctor(doItFun)); OpFun bound_undoFun = std::tr1::bind (&CmdClosure::invoke, args, CmdFunctor(undoFun)); OpFun bound_captFun = std::tr1::bind (&CmdClosure::invoke, args, CmdFunctor(captFun)); - + protocol.seekp(0); protocol << "START..."; - + bound_captFun(); cout << "captured state: " << args.memento() << endl; CHECK (memHolder); CHECK (!isnil (*args.memento())); CHECK (args.canUndo()); cout << args << endl; - + bound_doItFun(); cout << protocol.str() << endl; bound_undoFun(); cout << protocol.str() << endl; - + // Commands can serve as prototype to be copied.... Args argsCopy (args); bound_captFun(); protocol.seekp(0); protocol << "RESET..."; - + args.storeTuple ( tuple::make (TTime(TimeValue(123456)), Tstr("unbelievable"), twoRandomDigits() )); cout << "modified: " << args << endl; cout << "copied : " << argsCopy << endl; // holds still the old params & memento - + bound_undoFun(); cout << protocol.str() << endl; } - + }; - - - + + + /** Register this test class... */ LAUNCHER (CommandArgument_test, "unit controller"); - - -}} // namespace control::test + + +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-basic-test.cpp b/tests/components/proc/control/command-basic-test.cpp index 121a83b7a..1e6a3d20a 100644 --- a/tests/components/proc/control/command-basic-test.cpp +++ b/tests/components/proc/control/command-basic-test.cpp @@ -31,6 +31,7 @@ using std::rand; +namespace proc { namespace control { namespace test { @@ -120,4 +121,4 @@ namespace test { LAUNCHER (CommandBasic_test, "unit controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-binding-test.cpp b/tests/components/proc/control/command-binding-test.cpp index 0f500a3b7..7f42dc3bc 100644 --- a/tests/components/proc/control/command-binding-test.cpp +++ b/tests/components/proc/control/command-binding-test.cpp @@ -29,6 +29,7 @@ #include +namespace proc { namespace control { namespace test { @@ -122,4 +123,4 @@ namespace test { LAUNCHER (CommandBinding_test, "function controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-clone-builder-test.cpp b/tests/components/proc/control/command-clone-builder-test.cpp index 802dfb361..eabc73a69 100644 --- a/tests/components/proc/control/command-clone-builder-test.cpp +++ b/tests/components/proc/control/command-clone-builder-test.cpp @@ -34,12 +34,13 @@ #include "proc/control/test-dummy-commands.hpp" +namespace proc { namespace control { namespace test { using namespace lumiera::typelist; - typedef lumiera::P PCmdImpl; + typedef lib::P PCmdImpl; namespace { // test config... @@ -173,4 +174,4 @@ namespace test { LAUNCHER (CommandCloneBuilder_test, "function controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-equality-test.cpp b/tests/components/proc/control/command-equality-test.cpp index c580f1eda..7d8380d0e 100644 --- a/tests/components/proc/control/command-equality-test.cpp +++ b/tests/components/proc/control/command-equality-test.cpp @@ -36,6 +36,7 @@ #include #include +namespace proc { namespace control { namespace test { @@ -317,4 +318,4 @@ namespace test { LAUNCHER (CommandEquality_test, "function controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-mutation-test.cpp b/tests/components/proc/control/command-mutation-test.cpp index fbbbaa716..6ba6f8867 100644 --- a/tests/components/proc/control/command-mutation-test.cpp +++ b/tests/components/proc/control/command-mutation-test.cpp @@ -41,6 +41,7 @@ using std::cout; using std::endl; +namespace proc { namespace control { namespace test { @@ -214,4 +215,4 @@ namespace test { LAUNCHER (CommandMutation_test, "unit controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-registry-test.cpp b/tests/components/proc/control/command-registry-test.cpp index f0958a48b..31719a197 100644 --- a/tests/components/proc/control/command-registry-test.cpp +++ b/tests/components/proc/control/command-registry-test.cpp @@ -33,6 +33,7 @@ #include +namespace proc { namespace control { namespace test { @@ -236,4 +237,4 @@ namespace test { LAUNCHER (CommandRegistry_test, "function controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-use1-test.cpp b/tests/components/proc/control/command-use1-test.cpp index 949fcfffd..eaa00b2a5 100644 --- a/tests/components/proc/control/command-use1-test.cpp +++ b/tests/components/proc/control/command-use1-test.cpp @@ -33,6 +33,7 @@ #include +namespace proc { namespace control { namespace test { @@ -389,4 +390,4 @@ namespace test { LAUNCHER (CommandUse1_test, "function controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-use2-test.cpp b/tests/components/proc/control/command-use2-test.cpp index 8fec714fa..3753359b1 100644 --- a/tests/components/proc/control/command-use2-test.cpp +++ b/tests/components/proc/control/command-use2-test.cpp @@ -37,6 +37,7 @@ #include +namespace proc { namespace control { namespace test { @@ -204,4 +205,4 @@ namespace test { LAUNCHER (CommandUse2_test, "function controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/command-use3-test.cpp b/tests/components/proc/control/command-use3-test.cpp index c2917b598..a5ca90d9b 100644 --- a/tests/components/proc/control/command-use3-test.cpp +++ b/tests/components/proc/control/command-use3-test.cpp @@ -36,6 +36,7 @@ //#include +namespace proc { namespace control { namespace test { @@ -102,4 +103,4 @@ namespace test { LAUNCHER (CommandUse3_test, "function controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/handling-pattern-basics-test.cpp b/tests/components/proc/control/handling-pattern-basics-test.cpp index 87458b177..f63c81f00 100644 --- a/tests/components/proc/control/handling-pattern-basics-test.cpp +++ b/tests/components/proc/control/handling-pattern-basics-test.cpp @@ -34,6 +34,7 @@ #include +namespace proc { namespace control { namespace test { @@ -166,4 +167,4 @@ namespace test { LAUNCHER (HandlingPatternBasics_test, "function controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/handling-pattern-standard-impl-test.cpp b/tests/components/proc/control/handling-pattern-standard-impl-test.cpp index 01ba9789a..eea9a3ccf 100644 --- a/tests/components/proc/control/handling-pattern-standard-impl-test.cpp +++ b/tests/components/proc/control/handling-pattern-standard-impl-test.cpp @@ -49,6 +49,7 @@ //#include +namespace proc { namespace control { namespace test { @@ -119,6 +120,6 @@ namespace test { /** Register this test class... */ LAUNCHER (HandlingPatternStandardImpl_test, "function controller"); - - -}} // namespace control::test + + +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/memento-tie-test.cpp b/tests/components/proc/control/memento-tie-test.cpp index 684078d8b..ad1f587aa 100644 --- a/tests/components/proc/control/memento-tie-test.cpp +++ b/tests/components/proc/control/memento-tie-test.cpp @@ -33,6 +33,7 @@ using std::tr1::bind; using std::rand; +namespace proc { namespace control { namespace test { @@ -180,4 +181,4 @@ namespace test { LAUNCHER (MementoTie_test, "unit controller"); -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/test-dummy-commands.cpp b/tests/components/proc/control/test-dummy-commands.cpp index 81daa1020..64e4aaa67 100644 --- a/tests/components/proc/control/test-dummy-commands.cpp +++ b/tests/components/proc/control/test-dummy-commands.cpp @@ -25,6 +25,7 @@ +namespace proc { namespace control { namespace test { @@ -47,4 +48,4 @@ namespace test { } -}} // namespace control::test +}}} // namespace proc::control::test diff --git a/tests/components/proc/control/test-dummy-commands.hpp b/tests/components/proc/control/test-dummy-commands.hpp index f6dce546d..518c9ff3a 100644 --- a/tests/components/proc/control/test-dummy-commands.hpp +++ b/tests/components/proc/control/test-dummy-commands.hpp @@ -46,6 +46,7 @@ #include +namespace proc { namespace control { namespace test { @@ -150,5 +151,5 @@ namespace test { } -}} // namespace control::test +}}} // namespace proc::control::test #endif diff --git a/tests/components/proc/engine/buff-table-test.cpp b/tests/components/proc/engine/buff-table-test.cpp index 73482d48d..42576dddf 100644 --- a/tests/components/proc/engine/buff-table-test.cpp +++ b/tests/components/proc/engine/buff-table-test.cpp @@ -36,6 +36,7 @@ using std::cout; using std::rand; +namespace proc { namespace engine{ namespace test { @@ -180,4 +181,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/engine/buffer-metadata-key-test.cpp b/tests/components/proc/engine/buffer-metadata-key-test.cpp index a0e5d8f61..768016628 100644 --- a/tests/components/proc/engine/buffer-metadata-key-test.cpp +++ b/tests/components/proc/engine/buffer-metadata-key-test.cpp @@ -36,6 +36,7 @@ using util::isnil; using util::isSameObject; +namespace proc { namespace engine{ namespace metadata{ namespace test { @@ -400,4 +401,4 @@ namespace test { -}}} // namespace engine::metadata::test +}}}} // namespace proc::engine::metadata::test diff --git a/tests/components/proc/engine/buffer-metadata-test.cpp b/tests/components/proc/engine/buffer-metadata-test.cpp index 2ed136a9b..5ced14c03 100644 --- a/tests/components/proc/engine/buffer-metadata-test.cpp +++ b/tests/components/proc/engine/buffer-metadata-test.cpp @@ -39,6 +39,7 @@ using util::isSameObject; using util::isnil; +namespace proc { namespace engine{ namespace test { @@ -400,4 +401,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/engine/buffer-provider-protocol-test.cpp b/tests/components/proc/engine/buffer-provider-protocol-test.cpp index 1b128823f..91344b12b 100644 --- a/tests/components/proc/engine/buffer-provider-protocol-test.cpp +++ b/tests/components/proc/engine/buffer-provider-protocol-test.cpp @@ -35,12 +35,13 @@ using util::isSameObject; using util::for_each; +namespace proc { namespace engine{ namespace test { using lib::test::Dummy; - using ::engine::BuffHandle; + using proc::engine::BuffHandle; using error::LUMIERA_ERROR_LOGIC; using error::LUMIERA_ERROR_LIFECYCLE; @@ -232,4 +233,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/engine/node-basic-test.cpp b/tests/components/proc/engine/node-basic-test.cpp index 810edf8a7..1c69d3443 100644 --- a/tests/components/proc/engine/node-basic-test.cpp +++ b/tests/components/proc/engine/node-basic-test.cpp @@ -38,6 +38,7 @@ //using std::cout; +namespace proc { namespace engine{ namespace test { @@ -105,4 +106,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/engine/node-fabrication-test.cpp b/tests/components/proc/engine/node-fabrication-test.cpp index ccc0ad798..98ee47e51 100644 --- a/tests/components/proc/engine/node-fabrication-test.cpp +++ b/tests/components/proc/engine/node-fabrication-test.cpp @@ -32,6 +32,7 @@ using std::string; using std::cout; +namespace proc { namespace engine{ namespace test { @@ -55,4 +56,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/engine/node-operation-test.cpp b/tests/components/proc/engine/node-operation-test.cpp index d6823cbaa..fd6425029 100644 --- a/tests/components/proc/engine/node-operation-test.cpp +++ b/tests/components/proc/engine/node-operation-test.cpp @@ -32,6 +32,7 @@ using std::string; using std::cout; +namespace proc { namespace engine{ namespace test { @@ -55,4 +56,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/engine/node-source-test.cpp b/tests/components/proc/engine/node-source-test.cpp index b8bba352b..171d17384 100644 --- a/tests/components/proc/engine/node-source-test.cpp +++ b/tests/components/proc/engine/node-source-test.cpp @@ -32,6 +32,7 @@ using std::string; using std::cout; +namespace proc { namespace engine{ namespace test { @@ -55,4 +56,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/engine/testframe-test.cpp b/tests/components/proc/engine/testframe-test.cpp index a7e086fa9..5b6f62990 100644 --- a/tests/components/proc/engine/testframe-test.cpp +++ b/tests/components/proc/engine/testframe-test.cpp @@ -35,6 +35,7 @@ using util::isSameObject; using boost::scoped_ptr; +namespace proc { namespace engine{ namespace test { @@ -205,4 +206,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/engine/testframe.cpp b/tests/components/proc/engine/testframe.cpp index 0a051b74e..7f46ffe44 100644 --- a/tests/components/proc/engine/testframe.cpp +++ b/tests/components/proc/engine/testframe.cpp @@ -33,6 +33,7 @@ +namespace proc { namespace engine { namespace test { @@ -289,4 +290,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/engine/testframe.hpp b/tests/components/proc/engine/testframe.hpp index 470b5e9ea..05cfecff8 100644 --- a/tests/components/proc/engine/testframe.hpp +++ b/tests/components/proc/engine/testframe.hpp @@ -29,6 +29,7 @@ #include +namespace proc { namespace engine { namespace test { @@ -113,8 +114,8 @@ namespace test { /** discards all the TestFrame instances and * initialises an empty table of test frames */ void resetTestFrames(); - -}} // namespace engine::test + +}}} // namespace proc::engine::test #endif diff --git a/tests/components/proc/engine/tracking-heap-block-provider-test.cpp b/tests/components/proc/engine/tracking-heap-block-provider-test.cpp index 62ff32412..311a647d3 100644 --- a/tests/components/proc/engine/tracking-heap-block-provider-test.cpp +++ b/tests/components/proc/engine/tracking-heap-block-provider-test.cpp @@ -33,6 +33,7 @@ using std::rand; +namespace proc { namespace engine{ namespace test { @@ -219,4 +220,4 @@ namespace test { -}} // namespace engine::test +}}} // namespace proc::engine::test diff --git a/tests/components/proc/mobject/builder/buildertooltest.cpp b/tests/components/proc/mobject/builder/buildertooltest.cpp index 21d4cba66..988b76bc4 100644 --- a/tests/components/proc/mobject/builder/buildertooltest.cpp +++ b/tests/components/proc/mobject/builder/buildertooltest.cpp @@ -40,6 +40,7 @@ using std::cout; +namespace proc { namespace mobject { namespace builder { namespace test { @@ -145,4 +146,4 @@ namespace test { -}}} // namespace mobject::builder::test +}}}} // namespace proc::mobject::builder::test diff --git a/tests/components/proc/mobject/builder/buildsegmenttest.cpp b/tests/components/proc/mobject/builder/buildsegmenttest.cpp index 39679814d..ba074f761 100644 --- a/tests/components/proc/mobject/builder/buildsegmenttest.cpp +++ b/tests/components/proc/mobject/builder/buildsegmenttest.cpp @@ -32,36 +32,30 @@ using std::string; using std::cout; -namespace mobject - { - namespace builder +namespace proc { +namespace mobject { +namespace builder { +namespace test { + + + + + /******************************************************************* + * @test the builder core functionality: create a render pipeline + * for a given segment of the Session/Timeline. + */ + class BuildSegment_test : public Test { - namespace test - { - - - - - /******************************************************************* - * @test the builder core functionality: create a render pipeline - * for a given segment of the Session/Timeline. - */ - class BuildSegment_test : public Test + virtual void run(Arg) { - virtual void run(Arg) - { - UNIMPLEMENTED ("oh my"); - } - }; - - - /** Register this test class... */ - LAUNCHER (BuildSegment_test, "function builder"); - - - - } // namespace test - - } // namespace builder - -} // namespace mobject + UNIMPLEMENTED ("oh my"); + } + }; + + + /** Register this test class... */ + LAUNCHER (BuildSegment_test, "function builder"); + + + +}}}} // namespace proc::mobject::builder::test diff --git a/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp b/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp index f41a8fe20..c7910c21a 100644 --- a/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp +++ b/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp @@ -30,6 +30,7 @@ #include "lib/util.hpp" +namespace proc { namespace mobject { namespace builder { namespace test { @@ -110,4 +111,4 @@ namespace test { -}}} // namespace mobject::builder::test +}}}} // namespace proc::mobject::builder::test diff --git a/tests/components/proc/mobject/builder/model-port-registry-test.cpp b/tests/components/proc/mobject/builder/model-port-registry-test.cpp index d9fea6e99..a5ebb39e5 100644 --- a/tests/components/proc/mobject/builder/model-port-registry-test.cpp +++ b/tests/components/proc/mobject/builder/model-port-registry-test.cpp @@ -30,6 +30,7 @@ #include "lib/util.hpp" +namespace proc { namespace mobject { namespace builder { namespace test { @@ -272,4 +273,4 @@ namespace test { -}}} // namespace mobject::builder::test +}}}} // namespace proc::mobject::builder::test diff --git a/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp b/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp index 91cd1cd05..a39af76f2 100644 --- a/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp +++ b/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp @@ -30,6 +30,7 @@ #include "lib/util.hpp" +namespace proc { namespace mobject { namespace builder { namespace test { @@ -110,4 +111,4 @@ namespace test { -}}} // namespace mobject::builder::test +}}}} // namespace proc::mobject::builder::test diff --git a/tests/components/proc/mobject/controller/rendersegmenttest.cpp b/tests/components/proc/mobject/controller/rendersegmenttest.cpp index a74d1bdb4..6f0bfc538 100644 --- a/tests/components/proc/mobject/controller/rendersegmenttest.cpp +++ b/tests/components/proc/mobject/controller/rendersegmenttest.cpp @@ -32,42 +32,36 @@ using std::string; using std::cout; -namespace mobject - { - namespace controller +namespace proc { +namespace mobject { +namespace controller { +namespace test { + + + + + /******************************************************************** + * @test create a render process from a given segment of the Session. + * Basically this includes cooperation of all parts of the + * Lumiera Proc Layer. For a prepared test-Session we invoke the + * controller to create a render process. This includes building + * the render pipeline. Finally, we analyze all the created + * Structures. + * @note this test doesn't cover the actual rendering. + * @see proc_interface::ControllerFacade + */ + class RenderSegment_test : public Test { - namespace test - { - - - - - /******************************************************************** - * @test create a render process from a given segment of the Session. - * Basically this includes cooperation of all parts of the - * Lumiera Proc Layer. For a prepared test-Session we invoke the - * controller to create a render process. This includes building - * the render pipeline. Finally, we analyze all the created - * Structures. - * @note this test doesn't cover the actual rendering. - * @see proc_interface::ControllerFacade - */ - class RenderSegment_test : public Test + virtual void run(Arg arg) { - virtual void run(Arg arg) - { - UNIMPLEMENTED ("complete render process for a given test segment of the Session"); - } - }; - - - /** Register this test class... */ - LAUNCHER (RenderSegment_test, "function operate"); - - - - } // namespace test - - } // namespace controller - -} // namespace mobject + UNIMPLEMENTED ("complete render process for a given test segment of the Session"); + } + }; + + + /** Register this test class... */ + LAUNCHER (RenderSegment_test, "function operate"); + + + +}}}} // namespace proc::mobject::controller::test diff --git a/tests/components/proc/mobject/mobject-interface-test.cpp b/tests/components/proc/mobject/mobject-interface-test.cpp index 26e893648..3f0d5a8fe 100644 --- a/tests/components/proc/mobject/mobject-interface-test.cpp +++ b/tests/components/proc/mobject/mobject-interface-test.cpp @@ -44,6 +44,7 @@ +namespace proc { namespace mobject { namespace test { @@ -125,4 +126,4 @@ namespace test { LAUNCHER (MObjectInterface_test, "unit session"); -}} // namespace mobject::test +}}} // namespace proc::mobject::test diff --git a/tests/components/proc/mobject/mobject-ref-test.cpp b/tests/components/proc/mobject/mobject-ref-test.cpp index 3aa6fe976..1b9ae39e8 100644 --- a/tests/components/proc/mobject/mobject-ref-test.cpp +++ b/tests/components/proc/mobject/mobject-ref-test.cpp @@ -50,6 +50,7 @@ using std::cout; using std::endl; +namespace proc { namespace mobject { namespace test { @@ -379,4 +380,4 @@ namespace test { LAUNCHER (MObjectRef_test, "unit session"); -}} // namespace mobject::test +}}} // namespace proc::mobject::test diff --git a/tests/components/proc/mobject/output-mapping-test.cpp b/tests/components/proc/mobject/output-mapping-test.cpp index e8a6a7e03..5bd75c464 100644 --- a/tests/components/proc/mobject/output-mapping-test.cpp +++ b/tests/components/proc/mobject/output-mapping-test.cpp @@ -35,8 +35,9 @@ using util::isnil; using std::string; +namespace proc { namespace mobject { -namespace test { +namespace test { using asset::Pipe; using asset::PPipe; @@ -179,4 +180,4 @@ namespace test { -}} // namespace mobject::test +}}} // namespace proc::mobject::test diff --git a/tests/components/proc/mobject/placement-basic-test.cpp b/tests/components/proc/mobject/placement-basic-test.cpp index 5aeed4d15..1eccec30a 100644 --- a/tests/components/proc/mobject/placement-basic-test.cpp +++ b/tests/components/proc/mobject/placement-basic-test.cpp @@ -39,6 +39,7 @@ using std::string; using std::cout; +namespace proc { namespace mobject { namespace session { namespace test { @@ -93,4 +94,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/placement-hierarchy-test.cpp b/tests/components/proc/mobject/placement-hierarchy-test.cpp index e3657229c..6dbcd39a4 100644 --- a/tests/components/proc/mobject/placement-hierarchy-test.cpp +++ b/tests/components/proc/mobject/placement-hierarchy-test.cpp @@ -43,6 +43,7 @@ using std::cout; using std::endl; +namespace proc { namespace mobject { namespace session { namespace test { @@ -173,4 +174,4 @@ namespace test { LAUNCHER (PlacementHierarchy_test, "unit session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/placement-object-identity-test.cpp b/tests/components/proc/mobject/placement-object-identity-test.cpp index fd349ed5e..e31662d08 100644 --- a/tests/components/proc/mobject/placement-object-identity-test.cpp +++ b/tests/components/proc/mobject/placement-object-identity-test.cpp @@ -42,6 +42,7 @@ //using std::endl; +namespace proc { namespace mobject { namespace test { @@ -155,4 +156,4 @@ namespace test { LAUNCHER (PlacementObjectIdentity_test, "function session"); -}} // namespace mobject::test +}}} // namespace proc::mobject::test diff --git a/tests/components/proc/mobject/placement-ref-test.cpp b/tests/components/proc/mobject/placement-ref-test.cpp index 8d91c660b..f57d509e6 100644 --- a/tests/components/proc/mobject/placement-ref-test.cpp +++ b/tests/components/proc/mobject/placement-ref-test.cpp @@ -40,6 +40,7 @@ using std::cout; using std::endl; +namespace proc { namespace mobject { namespace session { namespace test { @@ -48,8 +49,8 @@ namespace test { typedef TestPlacement PSub; typedef PlacementMO::ID P_ID; - - + + /*************************************************************************** * @test properties and behaviour of the reference-mechanism for Placements. * We create an mock placement index and install it to be used @@ -188,4 +189,4 @@ namespace test { LAUNCHER (PlacementRef_test, "unit session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/addcliptest.cpp b/tests/components/proc/mobject/session/addcliptest.cpp index 35dd0a7d9..4e57950a3 100644 --- a/tests/components/proc/mobject/session/addcliptest.cpp +++ b/tests/components/proc/mobject/session/addcliptest.cpp @@ -36,44 +36,38 @@ using std::string; using std::cout; -namespace mobject - { - namespace session +namespace proc { +namespace mobject { +namespace session { +namespace test { + + + + + /******************************************************************* + * @test adding an test clip to the Model/Session. + * @see mobject::session::Clip + * @see mobject::Session + */ + class AddClip_test : public Test { - namespace test - { - - - - - /******************************************************************* - * @test adding an test clip to the Model/Session. - * @see mobject::session::Clip - * @see mobject::Session - */ - class AddClip_test : public Test + virtual void + run (Arg) { - virtual void - run (Arg) - { - PSess sess = Session::current; - PMO clip = TestClip::create(); - sess->attach (clip); - + PSess sess = Session::current; + PMO clip = TestClip::create(); + sess->attach (clip); + ///////////////////////////////////////////////////////////////////TICKET #499 // CHECK (sess->currEDL().contains (clip)); - // TODO: Clip-Asset and Placement magic?? - } - }; - - - /** Register this test class... */ - LAUNCHER (AddClip_test, "unit session"); - - - - } // namespace test + // TODO: Clip-Asset and Placement magic?? + } + }; - } // namespace session - -} // namespace mobject + + /** Register this test class... */ + LAUNCHER (AddClip_test, "unit session"); + + + +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/defs-manager-impl-test.cpp b/tests/components/proc/mobject/session/defs-manager-impl-test.cpp index 3c6835255..9afa64b21 100644 --- a/tests/components/proc/mobject/session/defs-manager-impl-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-impl-test.cpp @@ -39,6 +39,7 @@ using util::isnil; using std::string; +namespace proc { namespace mobject { namespace session { namespace test { @@ -170,4 +171,4 @@ lumiera::query::setFakeBypass("stream("+sID+")"); ////////////////////////////// -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/defs-manager-test.cpp b/tests/components/proc/mobject/session/defs-manager-test.cpp index 15431d354..720c12b6c 100644 --- a/tests/components/proc/mobject/session/defs-manager-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-test.cpp @@ -41,6 +41,7 @@ using std::string; +namespace proc { namespace mobject { namespace session { namespace test { @@ -198,4 +199,4 @@ namespace test { LAUNCHER (DefsManager_test, "function session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/defs-registry-impl-test.cpp b/tests/components/proc/mobject/session/defs-registry-impl-test.cpp index ccf3f7817..756001376 100644 --- a/tests/components/proc/mobject/session/defs-registry-impl-test.cpp +++ b/tests/components/proc/mobject/session/defs-registry-impl-test.cpp @@ -48,6 +48,7 @@ using std::map; +namespace proc { namespace mobject { namespace session { namespace test { @@ -98,8 +99,8 @@ namespace test { { scoped_ptr reg_; - typedef lumiera::P > O; - typedef lumiera::P > P; + typedef P > Obj; + typedef P > Prd; typedef Query > Q13; typedef Query > Q23; @@ -112,9 +113,9 @@ namespace test { lib::factory::RefcountFac > oFac; lib::factory::RefcountFac > pFac; - O o1, o2, o3; + Obj o1, o2, o3; Q13 q1, q2, q3, q4, q5; - map ps; + map ps; public: DefsRegistryImpl_test () @@ -157,7 +158,7 @@ namespace test { ps.clear(); for (int i=0; i<100; ++i) { - P px (pFac()); + Prd px (pFac()); Q23 qx (garbage_query()); ps[qx] = px; reg_->put (px, qx); @@ -289,4 +290,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/deletecliptest.cpp b/tests/components/proc/mobject/session/deletecliptest.cpp index e803f165e..2738462e7 100644 --- a/tests/components/proc/mobject/session/deletecliptest.cpp +++ b/tests/components/proc/mobject/session/deletecliptest.cpp @@ -42,6 +42,7 @@ using proc_interface::IDA; using std::tr1::dynamic_pointer_cast; /// TODO only temp +namespace proc { namespace mobject { namespace session { namespace test { @@ -91,4 +92,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/placement-index-query-test.cpp b/tests/components/proc/mobject/session/placement-index-query-test.cpp index efb049cbf..84f0f6680 100644 --- a/tests/components/proc/mobject/session/placement-index-query-test.cpp +++ b/tests/components/proc/mobject/session/placement-index-query-test.cpp @@ -34,6 +34,7 @@ +namespace proc { namespace mobject { namespace session { namespace test { @@ -117,4 +118,4 @@ namespace test { LAUNCHER (PlacementIndexQuery_test, "unit session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/placement-index-test.cpp b/tests/components/proc/mobject/session/placement-index-test.cpp index c61f4b586..0cdb18d66 100644 --- a/tests/components/proc/mobject/session/placement-index-test.cpp +++ b/tests/components/proc/mobject/session/placement-index-test.cpp @@ -42,6 +42,7 @@ using std::cout; using std::endl; +namespace proc { namespace mobject { namespace session { namespace test { @@ -322,4 +323,4 @@ namespace test { LAUNCHER (PlacementIndex_test, "unit session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/placement-scope-test.cpp b/tests/components/proc/mobject/session/placement-scope-test.cpp index 3d3ab194a..f507673a6 100644 --- a/tests/components/proc/mobject/session/placement-scope-test.cpp +++ b/tests/components/proc/mobject/session/placement-scope-test.cpp @@ -34,6 +34,7 @@ using util::isSameObject; +namespace proc { namespace mobject { namespace session { namespace test { @@ -196,4 +197,4 @@ namespace test { LAUNCHER (PlacementScope_test, "function session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/query-focus-stack-test.cpp b/tests/components/proc/mobject/session/query-focus-stack-test.cpp index d5f733b58..161a4b194 100644 --- a/tests/components/proc/mobject/session/query-focus-stack-test.cpp +++ b/tests/components/proc/mobject/session/query-focus-stack-test.cpp @@ -31,6 +31,7 @@ +namespace proc { namespace mobject { namespace session { namespace test { @@ -246,4 +247,4 @@ namespace test { LAUNCHER (QueryFocusStack_test, "unit session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/query-focus-test.cpp b/tests/components/proc/mobject/session/query-focus-test.cpp index ae12108b2..fa73cab30 100644 --- a/tests/components/proc/mobject/session/query-focus-test.cpp +++ b/tests/components/proc/mobject/session/query-focus-test.cpp @@ -32,6 +32,7 @@ +namespace proc { namespace mobject { namespace session { namespace test { @@ -180,4 +181,4 @@ namespace test { LAUNCHER (QueryFocus_test, "unit session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/query-resolver-test.cpp b/tests/components/proc/mobject/session/query-resolver-test.cpp index 42cfe1045..df70b2cb7 100644 --- a/tests/components/proc/mobject/session/query-resolver-test.cpp +++ b/tests/components/proc/mobject/session/query-resolver-test.cpp @@ -31,6 +31,7 @@ +namespace proc { namespace mobject { namespace session { namespace test { @@ -222,4 +223,4 @@ namespace test { LAUNCHER (QueryResolver_test, "unit session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/rebuildfixturetest.cpp b/tests/components/proc/mobject/session/rebuildfixturetest.cpp index 170582dd6..6a12a3bfe 100644 --- a/tests/components/proc/mobject/session/rebuildfixturetest.cpp +++ b/tests/components/proc/mobject/session/rebuildfixturetest.cpp @@ -37,6 +37,7 @@ using std::string; using std::cout; +namespace proc { namespace mobject { namespace session { namespace test { @@ -90,4 +91,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/scope-path-test.cpp b/tests/components/proc/mobject/session/scope-path-test.cpp index 80b578c9a..01c9b95c6 100644 --- a/tests/components/proc/mobject/session/scope-path-test.cpp +++ b/tests/components/proc/mobject/session/scope-path-test.cpp @@ -33,6 +33,7 @@ #include +namespace proc { namespace mobject { namespace session { namespace test { @@ -404,4 +405,4 @@ namespace test { LAUNCHER (ScopePath_test, "unit session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/scope-query-test.cpp b/tests/components/proc/mobject/session/scope-query-test.cpp index bce023e3d..3dd98d7ba 100644 --- a/tests/components/proc/mobject/session/scope-query-test.cpp +++ b/tests/components/proc/mobject/session/scope-query-test.cpp @@ -35,6 +35,7 @@ +namespace proc { namespace mobject { namespace session { namespace test { @@ -146,4 +147,4 @@ namespace test { LAUNCHER (ScopeQuery_test, "unit session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/session-element-query-test.cpp b/tests/components/proc/mobject/session/session-element-query-test.cpp index 08e742af9..03c2fa1ef 100644 --- a/tests/components/proc/mobject/session/session-element-query-test.cpp +++ b/tests/components/proc/mobject/session/session-element-query-test.cpp @@ -34,6 +34,7 @@ +namespace proc { namespace mobject { namespace session { namespace test { @@ -146,4 +147,4 @@ namespace test { LAUNCHER (SessionElementQuery_test, "function session"); -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/session-element-tracker-test.cpp b/tests/components/proc/mobject/session/session-element-tracker-test.cpp index d5ba6ad8b..96370928c 100644 --- a/tests/components/proc/mobject/session/session-element-tracker-test.cpp +++ b/tests/components/proc/mobject/session/session-element-tracker-test.cpp @@ -33,6 +33,7 @@ +namespace proc { namespace mobject { namespace session { namespace test { @@ -120,7 +121,7 @@ namespace test { checksum = 0; { typedef Dummy AutoRegisteringDummy; - typedef lumiera::P PDummy; + typedef P PDummy; typedef lib::ElementTracker DummyRegistry; DummyRegistry trackedDummies; @@ -222,4 +223,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/session-modify-parts-test.cpp b/tests/components/proc/mobject/session/session-modify-parts-test.cpp index 6d04accdd..42ea5329e 100644 --- a/tests/components/proc/mobject/session/session-modify-parts-test.cpp +++ b/tests/components/proc/mobject/session/session-modify-parts-test.cpp @@ -46,6 +46,7 @@ using std::cout; using std::set; +namespace proc { namespace mobject { namespace session { namespace test { @@ -318,7 +319,7 @@ namespace test { { TODO ("verify the commands issued by this test"); ////////////////////////TICKET #567 } - + }; @@ -327,4 +328,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/session-service-access-test.cpp b/tests/components/proc/mobject/session/session-service-access-test.cpp index 0cdd56479..613d06be3 100644 --- a/tests/components/proc/mobject/session/session-service-access-test.cpp +++ b/tests/components/proc/mobject/session/session-service-access-test.cpp @@ -30,6 +30,7 @@ #include +namespace proc { namespace mobject { namespace session { namespace test { @@ -44,7 +45,7 @@ namespace test { namespace { // what follows is a simulated (simplified) version // of the complete Session + SessionManager setup..... - + using lumiera::typelist::Types; using lumiera::typelist::InstantiateChained; @@ -348,4 +349,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/session-structure-test.cpp b/tests/components/proc/mobject/session/session-structure-test.cpp index 551a85bd0..448209662 100644 --- a/tests/components/proc/mobject/session/session-structure-test.cpp +++ b/tests/components/proc/mobject/session/session-structure-test.cpp @@ -36,6 +36,7 @@ using std::string; using std::cout; +namespace proc { namespace mobject { namespace session { namespace test { @@ -138,4 +139,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/sessionmanagertest.cpp b/tests/components/proc/mobject/session/sessionmanagertest.cpp index f36e3871c..add0e8493 100644 --- a/tests/components/proc/mobject/session/sessionmanagertest.cpp +++ b/tests/components/proc/mobject/session/sessionmanagertest.cpp @@ -33,6 +33,7 @@ using std::string; using std::cout; +namespace proc { namespace mobject { namespace session { namespace test { @@ -138,4 +139,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/test-scope-invalid.hpp b/tests/components/proc/mobject/session/test-scope-invalid.hpp index 23435d144..4aec3296d 100644 --- a/tests/components/proc/mobject/session/test-scope-invalid.hpp +++ b/tests/components/proc/mobject/session/test-scope-invalid.hpp @@ -30,6 +30,7 @@ +namespace proc { namespace mobject { namespace session { namespace test { @@ -59,5 +60,5 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test #endif diff --git a/tests/components/proc/mobject/session/test-scopes.cpp b/tests/components/proc/mobject/session/test-scopes.cpp index 04b09ae27..9ec6d4576 100644 --- a/tests/components/proc/mobject/session/test-scopes.cpp +++ b/tests/components/proc/mobject/session/test-scopes.cpp @@ -27,6 +27,7 @@ #include "proc/mobject/session/scope-query.hpp" +namespace proc { namespace mobject { namespace session { namespace test { @@ -53,7 +54,7 @@ namespace test { PPIdx index (SessionServiceMockIndex::install()); PMO& root = index->getRoot(); - + typedef PMO::ID ID; ID i1 = index->insert (p1, root); ID i2 = index->insert (p2, i1 ); @@ -91,4 +92,4 @@ namespace test { } -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/test-scopes.hpp b/tests/components/proc/mobject/session/test-scopes.hpp index 8b9b3a2fe..875f9f3c5 100644 --- a/tests/components/proc/mobject/session/test-scopes.hpp +++ b/tests/components/proc/mobject/session/test-scopes.hpp @@ -33,6 +33,7 @@ #include +namespace proc { namespace mobject { namespace session { namespace test { @@ -72,5 +73,5 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test #endif diff --git a/tests/components/proc/mobject/session/testclip.cpp b/tests/components/proc/mobject/session/testclip.cpp index 74ee791c5..1f9141f3a 100644 --- a/tests/components/proc/mobject/session/testclip.cpp +++ b/tests/components/proc/mobject/session/testclip.cpp @@ -29,6 +29,7 @@ #include "lib/singleton.hpp" #include "lib/time/timevalue.hpp" +namespace proc { namespace mobject { namespace session { namespace test { @@ -90,4 +91,4 @@ namespace test { const Duration LENGTH_TestClip(Time(0,25,0,0)); //////TODO hard wired as of (1/10). See MediaFactory::operator() in media.cpp / mediaaccessmock.cpp -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/mobject/session/testclip.hpp b/tests/components/proc/mobject/session/testclip.hpp index c62034250..7bf9b28d4 100644 --- a/tests/components/proc/mobject/session/testclip.hpp +++ b/tests/components/proc/mobject/session/testclip.hpp @@ -34,6 +34,7 @@ using std::tr1::shared_ptr; using std::string; +namespace proc { namespace mobject { namespace session { namespace test { @@ -81,5 +82,5 @@ namespace test { extern const lib::time::Duration LENGTH_TestClip; -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test #endif diff --git a/tests/components/proc/mobject/session/testroot.hpp b/tests/components/proc/mobject/session/testroot.hpp index 69af08447..bbbd2d8e8 100644 --- a/tests/components/proc/mobject/session/testroot.hpp +++ b/tests/components/proc/mobject/session/testroot.hpp @@ -32,6 +32,7 @@ using lib::Symbol; +namespace proc { namespace mobject { namespace session { namespace test { @@ -47,5 +48,5 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test #endif diff --git a/tests/components/proc/mobject/session/testsession1.hpp b/tests/components/proc/mobject/session/testsession1.hpp index 4b67fcd08..0aec5e90c 100644 --- a/tests/components/proc/mobject/session/testsession1.hpp +++ b/tests/components/proc/mobject/session/testsession1.hpp @@ -37,6 +37,7 @@ using std::string; using std::cout; +namespace proc { namespace mobject { namespace session { @@ -68,5 +69,5 @@ namespace session { const string SESSION1_CLIP("TODO: some sensible way to refer to a clip"); -}} // namespace mobject::session +}}} // namespace proc::mobject::session #endif diff --git a/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp b/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp index 92efe65f5..72ba5b60f 100644 --- a/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp +++ b/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp @@ -41,6 +41,7 @@ using std::string; using std::cout; +namespace proc { namespace mobject { namespace session { namespace test { @@ -260,7 +261,7 @@ namespace test { CHECK (num_sequences == sess->sequences.size()); CHECK (!contains (sess->timelines, aTimeline)); CHECK (!contains (sess->sequences, aSequence)); - + CHECK (1 == aTimeline.use_count()); CHECK (1 == aSequence.use_count()); #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #499 @@ -282,7 +283,7 @@ namespace test { // indirectly cause a new sequence to come to life... RTrack newTrack = sess->getRoot().attach (someTrack); // attach new Placement to root scope CHECK (newTrack != someTrack); // it's a new placement - + CHECK (num_sequences + 1 == sess->sequences.size()); // this root-attachment created a new sequence by sideeffect PSequence aSequence = sess->sequences[num_sequences]; CHECK (newTrack == aSequence->getTracks()); @@ -302,7 +303,7 @@ namespace test { CHECK (!assetM.known (aSequence->getID())); CHECK (num_sequences == sess->sequences.size()); CHECK (!contains (sess->sequences, aSequence)); - + CHECK (someTrack); CHECK (newTrack); #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #499 @@ -315,4 +316,4 @@ namespace test { -}}} // namespace mobject::session::test +}}}} // namespace proc::mobject::session::test diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp index 1c566d198..e3c45cac1 100644 --- a/tests/components/proc/play/diagnostic-output-slot.hpp +++ b/tests/components/proc/play/diagnostic-output-slot.hpp @@ -52,9 +52,9 @@ namespace proc { namespace play { //using std::string; - using ::engine::BufferDescriptor; - using ::engine::test::TestFrame; - using ::engine::TrackingHeapBlockProvider; + using proc::engine::BufferDescriptor; + using proc::engine::test::TestFrame; + using proc::engine::TrackingHeapBlockProvider; //using std::vector; using std::tr1::shared_ptr; diff --git a/tests/components/proc/play/output-slot-protocol-test.cpp b/tests/components/proc/play/output-slot-protocol-test.cpp index ae0319b6d..ac92dd62e 100644 --- a/tests/components/proc/play/output-slot-protocol-test.cpp +++ b/tests/components/proc/play/output-slot-protocol-test.cpp @@ -37,13 +37,13 @@ namespace proc { namespace play { -namespace test { +namespace test { // using lib::AllocationCluster; // using mobject::session::PEffect; - using ::engine::BuffHandle; - using ::engine::test::testData; - using ::engine::test::TestFrame; + using proc::engine::BuffHandle; + using proc::engine::test::testData; + using proc::engine::test::TestFrame; namespace { // Test fixture diff --git a/tests/lib/meta/config-flags-test.cpp b/tests/lib/meta/config-flags-test.cpp index 757f84d39..8d1222e4b 100644 --- a/tests/lib/meta/config-flags-test.cpp +++ b/tests/lib/meta/config-flags-test.cpp @@ -58,280 +58,281 @@ using std::endl; namespace lumiera { namespace typelist{ namespace test { + + + namespace { // internal definitions + + enum Cases + { ONE = 1 + , TWO + , THR + , FOU + , NUM_Cases = FOU + + , NOT_SET = 0 + }; + + + + /* === Test data === */ + typedef Config<> Conf0; + typedef Config Conf1; + typedef Config Conf2; + typedef Config Conf3; + typedef Config Conf4; + + typedef Flags::Tuple Flags1; + typedef Flags::Tuple Flags2; + typedef Types SomeFlagsets; + + typedef Flags::Tuple AllFlags; + typedef CombineFlags AllFlagCombinations; + + + + /** a type which is only partially defined, for some configs. + * In ConfigFlags_test::check_filter() we use the metaprogramming machinery + * to figure out all possible configs for which \c struct Maybe is defined. + * (for this to work, the "defined" specialisations need to provide a + * typedef \c is_defined ) + */ + template struct Maybe; + + struct Indeed { typedef Yes_t is_defined; }; + template<> struct Maybe : Indeed { enum{ CODE = 10 }; }; + template<> struct Maybe : Indeed { enum{ CODE = 30 }; }; + + template + struct Maybe > + { + typedef Yes_t is_defined; - - namespace { // internal definitions - - enum Cases - { ONE = 1 - , TWO - , THR - , FOU - , NUM_Cases = FOU - - , NOT_SET = 0 - }; - - - - /* === Test data === */ - typedef Config<> Conf0; - typedef Config Conf1; - typedef Config Conf2; - typedef Config Conf3; - typedef Config Conf4; - - typedef Flags::Tuple Flags1; - typedef Flags::Tuple Flags2; - typedef Types SomeFlagsets; - - typedef Flags::Tuple AllFlags; - typedef CombineFlags AllFlagCombinations; - - - - /** a type which is only partially defined, for some configs. - * In ConfigFlags_test::check_filter() we use the metaprogramming machinery - * to figure out all possible configs for which \c struct Maybe is defined. - * (for this to work, the "defined" specialisations need to provide a - * typedef \c is_defined ) - */ - template struct Maybe; - - struct Indeed { typedef Yes_t is_defined; }; - template<> struct Maybe : Indeed { enum{ CODE = 10 }; }; - template<> struct Maybe : Indeed { enum{ CODE = 30 }; }; - - template - struct Maybe > - { - typedef Yes_t is_defined; - - enum{ CODE = 20 + Fl }; - }; - - - } // (End) internal defs - + enum{ CODE = 20 + Fl }; + }; + + + } // (End) internal defs + #define PRINT_DELIMITER(TITLE) \ - cout << "__________________________\n" \ - "__________________________ " \ - << STRINGIFY(TITLE) << "\n"; - - - - - - /************************************************************************** - * @test check the handling of types representing a specific configuration. - * Basically, this is a bitset like feature, but working on types - * instead of runtime values. The Goal is to detect automatically - * all possible defined specialisations of some template based on - * such configuration-tuples. This allows us to assemble the glue code - * for pulling data from processing nodes out of small building blocks - * in all possible configurations. - */ - class ConfigFlags_test : public Test +cout << "__________________________\n" \ + "__________________________ " \ + << STRINGIFY(TITLE) << "\n"; + + + + + + /************************************************************************** + * @test check the handling of types representing a specific configuration. + * Basically, this is a bitset like feature, but working on types + * instead of runtime values. The Goal is to detect automatically + * all possible defined specialisations of some template based on + * such configuration-tuples. This allows us to assemble the glue code + * for pulling data from processing nodes out of small building blocks + * in all possible configurations. + */ + class ConfigFlags_test : public Test + { + virtual void run(Arg) { - virtual void run(Arg) - { - check_testdata (); - check_flags(); - check_instantiation (); - check_filter (); - check_FlagInfo (); - check_ConfigSelector (); - } + check_testdata (); + check_flags(); + check_instantiation (); + check_filter (); + check_FlagInfo (); + check_ConfigSelector (); + } + + + void check_testdata () + { + DISPLAY (Conf0); + DISPLAY (Conf1); + DISPLAY (Conf2); + DISPLAY (Conf3); + DISPLAY (Conf4); + + DISPLAY (AllFlags); + } + + + /** @test conversion between list-of-flags and a config-type in both directions */ + void check_flags () + { + PRINT_DELIMITER (check_flags()); + + typedef Config Flags1; + typedef Flags Flags2; + DISPLAY (Flags1); + DISPLAY (Flags2); + // should denote the same type + Flags1::Flags flags1 = Flags2::Tuple(); + Flags2::Tuple flags2 = flags1; + CHECK (1==sizeof(flags1)); // pure marker-type without content + CHECK (1==sizeof(flags2)); + + typedef DefineConfigByFlags,NullType> >::Config SimpleConfig_defined_by_Typelist; + DISPLAY (SimpleConfig_defined_by_Typelist); + + typedef DefineConfigByFlags::Config AnotherConfig_defined_by_Typelist; + DISPLAY (AnotherConfig_defined_by_Typelist); + } + + + /** @test creates a predicate template (metafunction) returning true + * iff the template \c Maybe is defined for the configuration in question + */ + void check_instantiation () + { + #define CAN_INSTANTIATE(NAME) \ + cout << "defined " \ + << STRINGIFY(NAME) \ + << "? ---> " \ + << Instantiation::Test::value << "\n"; + + PRINT_DELIMITER (check_instantiation()); + + CAN_INSTANTIATE (Conf0); + CAN_INSTANTIATE (Conf1); + CAN_INSTANTIATE (Conf2); + CAN_INSTANTIATE (Conf3); + CAN_INSTANTIATE (Conf4); + + typedef Config Trash; + CAN_INSTANTIATE (Trash); + } + + + /** @test given a list of flag-tuples, we first create config-types out of them + * and then filter out those configs for which \c template Maybe is defined + */ + void check_filter () + { + PRINT_DELIMITER (check_filter()); + + DISPLAY (SomeFlagsets); + + typedef Apply Configs_defined_by_Flagsets; + DISPLAY (Configs_defined_by_Flagsets); + + typedef Filter::Test> Filter_possible_Configs; + DISPLAY (Filter_possible_Configs); - void check_testdata () - { - DISPLAY (Conf0); - DISPLAY (Conf1); - DISPLAY (Conf2); - DISPLAY (Conf3); - DISPLAY (Conf4); - - DISPLAY (AllFlags); - } - - - /** @test conversion between list-of-flags and a config-type in both directions */ - void check_flags () - { - PRINT_DELIMITER (check_flags()); - - typedef Config Flags1; - typedef Flags Flags2; - DISPLAY (Flags1); - DISPLAY (Flags2); - // should denote the same type - Flags1::Flags flags1 = Flags2::Tuple(); - Flags2::Tuple flags2 = flags1; - CHECK (1==sizeof(flags1)); // pure marker-type without content - CHECK (1==sizeof(flags2)); - - typedef DefineConfigByFlags,NullType> >::Config SimpleConfig_defined_by_Typelist; - DISPLAY (SimpleConfig_defined_by_Typelist); - - typedef DefineConfigByFlags::Config AnotherConfig_defined_by_Typelist; - DISPLAY (AnotherConfig_defined_by_Typelist); - } - - - /** @test creates a predicate template (metafunction) returning true - * iff the template \c Maybe is defined for the configuration in question - */ - void check_instantiation () - { - #define CAN_INSTANTIATE(NAME) \ - cout << "defined " \ - << STRINGIFY(NAME) \ - << "? ---> " \ - << Instantiation::Test::value << "\n"; - - PRINT_DELIMITER (check_instantiation()); - - CAN_INSTANTIATE (Conf0); - CAN_INSTANTIATE (Conf1); - CAN_INSTANTIATE (Conf2); - CAN_INSTANTIATE (Conf3); - CAN_INSTANTIATE (Conf4); - - typedef Config Trash; - CAN_INSTANTIATE (Trash); - } - - - /** @test given a list of flag-tuples, we first create config-types out of them - * and then filter out those configs for which \c template Maybe is defined - */ - void check_filter () - { - PRINT_DELIMITER (check_filter()); - - DISPLAY (SomeFlagsets); - - typedef Apply Configs_defined_by_Flagsets; - DISPLAY (Configs_defined_by_Flagsets); - - typedef Filter::Test> Filter_possible_Configs; - DISPLAY (Filter_possible_Configs); - - - DISPLAY (AllFlagCombinations); - typedef Apply ListAllConfigs; - DISPLAY (ListAllConfigs); - - typedef Filter::Test> Filter_all_possible_Configs; - DISPLAY (Filter_all_possible_Configs); - } - - - - struct TestVisitor - { - string result; ///< metafunction result - - TestVisitor() : result ("TestVisitor application:\n") {} - - /* === visitation interface === */ - typedef string Ret; - - Ret done() {return result; } - - template - void - visit (ulong code) - { - result += str (format ("visit(code=%u) -->%s\n") - % code % Printer::print() ); - } - }; - - /** @test FlagInfo metafunction, which takes as argument a list-of-flags - * as well as a list-of-lists-of-flags and especially allows to - * apply a visitor object to the latter - */ - void check_FlagInfo() - { - PRINT_DELIMITER (check_FlagInfo()); - - DISPLAY (Flags1); - cout << "max bit : " << FlagInfo::BITS <<"\n"; - cout << "binary code: " << FlagInfo::CODE <<"\n"; - - typedef Apply SomeConfigs; - DISPLAY (SomeConfigs); - cout << "max bit in [SomeConfigs] : " << FlagInfo::BITS <<"\n"; - - TestVisitor visitor; - cout << FlagInfo::accept (visitor); - } - + DISPLAY (AllFlagCombinations); + typedef Apply ListAllConfigs; + DISPLAY (ListAllConfigs); + typedef Filter::Test> Filter_all_possible_Configs; + DISPLAY (Filter_all_possible_Configs); + } + + + + struct TestVisitor + { + string result; ///< metafunction result + + TestVisitor() : result ("TestVisitor application:\n") {} + + /* === visitation interface === */ + typedef string Ret; + + Ret done() {return result; } + template - struct TestFactory + void + visit (ulong code) { - uint operator() () { return offset_ + Maybe::CODE; } - TestFactory(long o) : offset_(o) {} - - private: - long offset_; - }; + result += str (format ("visit(code=%u) -->%s\n") + % code % Printer::print() ); + } + }; + + /** @test FlagInfo metafunction, which takes as argument a list-of-flags + * as well as a list-of-lists-of-flags and especially allows to + * apply a visitor object to the latter + */ + void check_FlagInfo() + { + PRINT_DELIMITER (check_FlagInfo()); + + DISPLAY (Flags1); + cout << "max bit : " << FlagInfo::BITS <<"\n"; + cout << "binary code: " << FlagInfo::CODE <<"\n"; + + typedef Apply SomeConfigs; + DISPLAY (SomeConfigs); + cout << "max bit in [SomeConfigs] : " << FlagInfo::BITS <<"\n"; + + TestVisitor visitor; + cout << FlagInfo::accept (visitor); + } + + + template + struct TestFactory + { + uint operator() () { return offset_ + Maybe::CODE; } + TestFactory(long o) : offset_(o) {} + + private: + long offset_; + }; + + + /** @test use the ConfigSelector template to build a set of factories, + * based on a set of configurations. Then invoke the appropriate + * factory by specifying the configuration bit code + */ + void check_ConfigSelector() + { + PRINT_DELIMITER (check_ConfigSelector()); + + typedef Apply ListAllConfigs; + typedef Filter::Test> Possible_Configs; + DISPLAY (Possible_Configs); + + using proc::engine::config::ConfigSelector; + typedef ConfigSelector< TestFactory // Factory template + , uint(void) // Factory function type + , long // common ctor argument + > TestFactorySelector; + + const long offset = 1000; // parameter fed to all TestFactory ctors + TestFactorySelector testConfigSelector (Possible_Configs::List(), offset); - /** @test use the ConfigSelector template to build a set of factories, - * based on a set of configurations. Then invoke the appropriate - * factory by specifying the configuration bit code - */ - void check_ConfigSelector() + #define INVOKE_CONFIG_SELECTOR(CODE) \ + cout << " Flag-code = " << CODE \ + << " ConfigSelector() ---> " \ + << testConfigSelector[CODE] () << "\n"; + + INVOKE_CONFIG_SELECTOR (2); + INVOKE_CONFIG_SELECTOR (12); + INVOKE_CONFIG_SELECTOR (20); + INVOKE_CONFIG_SELECTOR (4); + INVOKE_CONFIG_SELECTOR (8); + + try { - PRINT_DELIMITER (check_ConfigSelector()); - - typedef Apply ListAllConfigs; - typedef Filter::Test> Possible_Configs; - DISPLAY (Possible_Configs); - - typedef engine::config::ConfigSelector< TestFactory // Factory template - , uint(void) // Factory function type - , long // common ctor argument - > TestFactorySelector; - - const long offset = 1000; // parameter fed to all TestFactory ctors - TestFactorySelector testConfigSelector (Possible_Configs::List(), offset); - - - #define INVOKE_CONFIG_SELECTOR(CODE) \ - cout << " Flag-code = " << CODE \ - << " ConfigSelector() ---> " \ - << testConfigSelector[CODE] () << "\n"; - - INVOKE_CONFIG_SELECTOR (2); - INVOKE_CONFIG_SELECTOR (12); - INVOKE_CONFIG_SELECTOR (20); - INVOKE_CONFIG_SELECTOR (4); - INVOKE_CONFIG_SELECTOR (8); - - try - { - INVOKE_CONFIG_SELECTOR (23); - NOTREACHED (); - } - catch (lumiera::error::Invalid& err) - { - cout << err.what() << "\n"; - lumiera_error (); // reset error flag - } + INVOKE_CONFIG_SELECTOR (23); + NOTREACHED (); } - - - }; - - - /** Register this test class... */ - LAUNCHER (ConfigFlags_test, "unit common"); - + catch (lumiera::error::Invalid& err) + { + cout << err.what() << "\n"; + lumiera_error (); // reset error flag + } + } + }; + + + /** Register this test class... */ + LAUNCHER (ConfigFlags_test, "unit common"); + + + }}} // namespace lumiera::typelist::test diff --git a/tests/lib/meta/iterable-classification-test.cpp b/tests/lib/meta/iterable-classification-test.cpp index 0066c33de..9a8a21aa1 100644 --- a/tests/lib/meta/iterable-classification-test.cpp +++ b/tests/lib/meta/iterable-classification-test.cpp @@ -45,8 +45,8 @@ namespace lib { namespace meta{ namespace test{ - using mobject::session::Effect; - using mobject::session::ScopeQuery; + using proc::mobject::session::Effect; + using proc::mobject::session::ScopeQuery; typedef lib::time::TimeVar Time; using std::cout; diff --git a/tests/common/ref-array-test.cpp b/tests/lib/ref-array-test.cpp similarity index 100% rename from tests/common/ref-array-test.cpp rename to tests/lib/ref-array-test.cpp diff --git a/tests/lib/streamtypebasicstest.cpp b/tests/lib/streamtypebasicstest.cpp index bf5f191b6..be18f6e59 100644 --- a/tests/lib/streamtypebasicstest.cpp +++ b/tests/lib/streamtypebasicstest.cpp @@ -33,89 +33,87 @@ using ::test::Test; using util::isnil; -namespace lumiera { - namespace test_format { - - using control::STypeManager; - typedef StreamType const& SType; - typedef StreamType::ImplFacade const& ImplType; - - - /******************************************************************* - * @test check the basic workings of the stream type handling. - * create some stream implementation data, build a - * StreamType::ImplFacade from this, and derive a prototype - * and a full StreamType based on this information. - */ - class StreamTypeBasics_test : public Test - { - virtual void - run (Arg arg) - { - ImplType iType = buildImplType (); - basicImplTypeProperties (iType); - - SType type = extend2fullType (iType); - basicStreamTypeProperties (type, iType); - } - - ImplType - buildImplType () - { - STypeManager& typeManager = STypeManager::instance(); - - gavl_video_format_t rawType = test_createRawType(); - ImplType iTy (typeManager.getImpl (GAVL, rawType)); - - UNIMPLEMENTED ("at least preliminary implementation of the MediaImplLib interface for lib GAVL"); - - TODO ("how to do a simple consistency check on the returned ImplFacade? can we re-create the GAVL frame type?"); - CHECK (GAVL==iTy.libraryID); - return iTy; - } - - void - basicImplTypeProperties (ImplType refType) - { - ImplType iTy2 = test_createImplType (); - CHECK (iTy2==refType); - CHECK (refType==iTy2); - TODO ("add equality comparable concept to the ImplType class"); - - CHECK (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) - { - CHECK (type.implType); - CHECK (iTy==(*type.implType)); /////////////TODO: really by ptr??? - CHECK (&iTy==type.implType); // actually using the same object (in the registry) - - CHECK (!isnil (type.prototype.id)); - CHECK (StreamType::VIDEO==type.prototype.kind); - CHECK (StreamType::VIDEO==type.implType->getKind()); - - CHECK (type.implType->canConvert(iTy)); // of course... they are actually the same - CHECK (iTy.canConvert(type)); // because it's based on the same impl type - - CHECK (StreamType::RAW==type.intentionTag); - } - }; - - LAUNCHER (StreamTypeBasics_test, "unit common"); - - - } // namespace test_format - -} // namespace lumiera +namespace proc { +namespace test_format { + + using control::STypeManager; + typedef StreamType const& SType; + typedef StreamType::ImplFacade const& ImplType; + + + /******************************************************************* + * @test check the basic workings of the stream type handling. + * create some stream implementation data, build a + * StreamType::ImplFacade from this, and derive a prototype + * and a full StreamType based on this information. + */ + class StreamTypeBasics_test : public Test + { + virtual void + run (Arg arg) + { + ImplType iType = buildImplType (); + basicImplTypeProperties (iType); + + SType type = extend2fullType (iType); + basicStreamTypeProperties (type, iType); + } + + ImplType + buildImplType () + { + STypeManager& typeManager = STypeManager::instance(); + + gavl_video_format_t rawType = test_createRawType(); + ImplType iTy (typeManager.getImpl (GAVL, rawType)); + + UNIMPLEMENTED ("at least preliminary implementation of the MediaImplLib interface for lib GAVL"); + + TODO ("how to do a simple consistency check on the returned ImplFacade? can we re-create the GAVL frame type?"); + CHECK (GAVL==iTy.libraryID); + return iTy; + } + + void + basicImplTypeProperties (ImplType refType) + { + ImplType iTy2 = test_createImplType (); + CHECK (iTy2==refType); + CHECK (refType==iTy2); + TODO ("add equality comparable concept to the ImplType class"); + + CHECK (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) + { + CHECK (type.implType); + CHECK (iTy==(*type.implType)); /////////////TODO: really by ptr??? + CHECK (&iTy==type.implType); // actually using the same object (in the registry) + + CHECK (!isnil (type.prototype.id)); + CHECK (StreamType::VIDEO==type.prototype.kind); + CHECK (StreamType::VIDEO==type.implType->getKind()); + + CHECK (type.implType->canConvert(iTy)); // of course... they are actually the same + CHECK (iTy.canConvert(type)); // because it's based on the same impl type + + CHECK (StreamType::RAW==type.intentionTag); + } + }; + + LAUNCHER (StreamTypeBasics_test, "unit common"); + + +}} // namespace proc::test_format diff --git a/tests/lib/streamtypelifecycletest.cpp b/tests/lib/streamtypelifecycletest.cpp index 1c1466407..7c0dc63b3 100644 --- a/tests/lib/streamtypelifecycletest.cpp +++ b/tests/lib/streamtypelifecycletest.cpp @@ -27,88 +27,88 @@ #include "proc/control/stypemanager.hpp" #include "proc/mobject/session.hpp" //#include "teststreamtypes.hpp" +#include "include/lifecycle.h" #include using std::cout; -namespace lumiera { - namespace test_format { - - using mobject::Session; - using control::STypeManager; - using control::ON_STREAMTYPES_RESET; - - - //////////TODO define a dummy-type-info here - //////////TODO - - void - setup_basicDummyTypeInfo () - { - UNIMPLEMENTED ("setup basic dummy-type-info"); - } - - namespace // enrol this basic setup to be triggered when the type system is reset - { - LifecycleHook _schedule_at_reset (ON_STREAMTYPES_RESET, &setup_basicDummyTypeInfo); - } - - - - /******************************************************************* - * @test check the stream type registration lifecycle. - * Any internal or external component (plugin) can extend - * the Proc Layer's registry of media stream types. - * There is a basic pristine set of type information, which is - * restored automatically everytime the STypeManager is reset, - * which in turn happenes before loading a (new) Session. - */ - class StreamTypeLifecycle_test : public Test - { - virtual void - run (Arg arg) - { - check_pristineState (); - register_additional_TypeInfo (); - check_pristineState (); - } - - - /** @test this test defines a new (dummy) type info - * and schedules it for setop in the pristine state; - * check this info is actually present after resetting - * the stream type manager, while other additional info - * \em not scheduled in this manner is not present - * in this state - */ - void - check_pristineState () - { - Session::current.reset(); - TODO ("verify the test-dummy basic type info is present now..."); - TODO ("verify the additional type info is *not* present"); - } - - /** @test use the stream type manager to register additional - * type info and verify it is used in type resolution. - */ - void - register_additional_TypeInfo () - { - TODO ("verify the additional type info is *not* present"); - - STypeManager& typeManager = STypeManager::instance(); - TODO ("use the registration facility to add additional type info"); - TODO ("verify the additional type info to be present now..."); - } - }; - - LAUNCHER (StreamTypeLifecycle_test, "unit common"); - - - } // namespace test_format +namespace proc { +namespace test_format { -} // namespace lumiera + using mobject::Session; + using control::STypeManager; + using control::ON_STREAMTYPES_RESET; + using lumiera::LifecycleHook; + + + //////////TODO define a dummy-type-info here + //////////TODO + + void + setup_basicDummyTypeInfo () + { + UNIMPLEMENTED ("setup basic dummy-type-info"); + } + + namespace // enrol this basic setup to be triggered when the type system is reset + { + LifecycleHook _schedule_at_reset (ON_STREAMTYPES_RESET, &setup_basicDummyTypeInfo); + } + + + + /******************************************************************* + * @test check the stream type registration lifecycle. + * Any internal or external component (plugin) can extend + * the Proc Layer's registry of media stream types. + * There is a basic pristine set of type information, which is + * restored automatically everytime the STypeManager is reset, + * which in turn happenes before loading a (new) Session. + */ + class StreamTypeLifecycle_test : public Test + { + virtual void + run (Arg arg) + { + check_pristineState (); + register_additional_TypeInfo (); + check_pristineState (); + } + + + /** @test this test defines a new (dummy) type info + * and schedules it for setop in the pristine state; + * check this info is actually present after resetting + * the stream type manager, while other additional info + * \em not scheduled in this manner is not present + * in this state + */ + void + check_pristineState () + { + Session::current.reset(); + TODO ("verify the test-dummy basic type info is present now..."); + TODO ("verify the additional type info is *not* present"); + } + + /** @test use the stream type manager to register additional + * type info and verify it is used in type resolution. + */ + void + register_additional_TypeInfo () + { + TODO ("verify the additional type info is *not* present"); + + STypeManager& typeManager = STypeManager::instance(); + TODO ("use the registration facility to add additional type info"); + TODO ("verify the additional type info to be present now..."); + } + }; + + LAUNCHER (StreamTypeLifecycle_test, "unit common"); + + +}} // namespace proc::test_format diff --git a/tests/lib/test/test-helper-test.cpp b/tests/lib/test/test-helper-test.cpp index c8fdb8a4b..498331b78 100644 --- a/tests/lib/test/test-helper-test.cpp +++ b/tests/lib/test/test-helper-test.cpp @@ -83,7 +83,7 @@ namespace test{ { std::cout << "Displaying types and sizes....\n"; - typedef Wrmrmpft Wrmpf1; + typedef Wrmrmpft Wrmpf1; typedef Wrmrmpft Wrmpf2; typedef Wrmrmpft Wrmpf3; @@ -110,7 +110,7 @@ namespace test{ } - + void checkGarbageStr() diff --git a/tests/lib/teststreamtypes.hpp b/tests/lib/teststreamtypes.hpp index 11aec0fd6..db22fe9cb 100644 --- a/tests/lib/teststreamtypes.hpp +++ b/tests/lib/teststreamtypes.hpp @@ -35,62 +35,60 @@ extern "C" { } -namespace lumiera { - namespace test_format { +namespace proc { +namespace test_format { - namespace { // constants used to parametrize tests + namespace { // constants used to parametrise tests + + const int TEST_IMG_WIDTH = 40; + const int TEST_IMG_HEIGHT = 30; - const int TEST_IMG_WIDTH = 40; - const int TEST_IMG_HEIGHT = 30; - - const int TEST_FRAME_DUR = GAVL_TIME_SCALE / 25; - } - - Symbol GAVL = "GAVL"; + const int TEST_FRAME_DUR = GAVL_TIME_SCALE / 25; + } + + Symbol GAVL = "GAVL"; + + + + /** Helper: create an raw GAVL type descriptor + * usable for generating a Lumiera StreamType + */ + inline gavl_video_format_t + test_createRawType () + { + gavl_video_format_t type; + type.pixelformat = GAVL_RGB_24; + type.interlace_mode = GAVL_INTERLACE_NONE; + type.framerate_mode = GAVL_FRAMERATE_CONSTANT; + type.chroma_placement = GAVL_CHROMA_PLACEMENT_DEFAULT; + type.image_width = TEST_IMG_WIDTH; // Width of the image in pixels + type.image_height = TEST_IMG_WIDTH; // Height of the image in pixels + type.frame_width = TEST_IMG_WIDTH; // Width of the frame buffer in pixels, might be larger than image_width + type.frame_height = TEST_IMG_WIDTH; // Height of the frame buffer in pixels, might be larger than image_height - /** Helper: create an raw GAVL type descriptor - * usable for generating a Lumiera StreamType - */ - inline gavl_video_format_t - test_createRawType () - { - gavl_video_format_t type; - - type.pixelformat = GAVL_RGB_24; - type.interlace_mode = GAVL_INTERLACE_NONE; - type.framerate_mode = GAVL_FRAMERATE_CONSTANT; - type.chroma_placement = GAVL_CHROMA_PLACEMENT_DEFAULT; - - type.image_width = TEST_IMG_WIDTH; // Width of the image in pixels - type.image_height = TEST_IMG_WIDTH; // Height of the image in pixels - type.frame_width = TEST_IMG_WIDTH; // Width of the frame buffer in pixels, might be larger than image_width - type.frame_height = TEST_IMG_WIDTH; // Height of the frame buffer in pixels, might be larger than image_height - - type.pixel_width = 1; // Relative width of a pixel (pixel aspect ratio is pixel_width/pixel_height) - type.pixel_height = 1; // Relative height of a pixel (pixel aspect ratio is pixel_width/pixel_height) - - type.frame_duration = TEST_FRAME_DUR; // Duration of a frame in timescale tics. - type.timescale = GAVL_TIME_SCALE; // Timescale in tics per second (is defined to be 1000000 as of 9/2008) - - return type; - } + type.pixel_width = 1; // Relative width of a pixel (pixel aspect ratio is pixel_width/pixel_height) + type.pixel_height = 1; // Relative height of a pixel (pixel aspect ratio is pixel_width/pixel_height) + type.frame_duration = TEST_FRAME_DUR; // Duration of a frame in timescale tics. + type.timescale = GAVL_TIME_SCALE; // Timescale in tics per second (is defined to be 1000000 as of 9/2008) - /** Helper: create an implementation frame - * and build the corresponding streamtype - */ - inline StreamType::ImplFacade const& - test_createImplType () - { - gavl_video_format_t rawType = test_createRawType(); - return control::STypeManager::instance().getImpl (GAVL, rawType); - } - - - - } // namespace test_format - -} // namespace lumiera + return type; + } + + + /** Helper: create an implementation frame + * and build the corresponding streamtype + */ + inline StreamType::ImplFacade const& + test_createImplType () + { + gavl_video_format_t rawType = test_createRawType(); + return control::STypeManager::instance().getImpl (GAVL, rawType); + } + + + +}} // namespace proc::test_format #endif diff --git a/tests/lib/time/time-control-test.cpp b/tests/lib/time/time-control-test.cpp index c40ff1d54..f949d49be 100644 --- a/tests/lib/time/time-control-test.cpp +++ b/tests/lib/time/time-control-test.cpp @@ -53,7 +53,7 @@ namespace test{ namespace error = lumiera::error; using lib::ScopedHolder; - using asset::meta::TimeGrid; + using proc::asset::meta::TimeGrid; using lumiera::typelist::Types; using lumiera::typelist::InstantiateChainedCombinations; using error::LUMIERA_ERROR_UNCONNECTED; diff --git a/tests/lib/time/time-formats-test.cpp b/tests/lib/time/time-formats-test.cpp index d85649201..0222a1eeb 100644 --- a/tests/lib/time/time-formats-test.cpp +++ b/tests/lib/time/time-formats-test.cpp @@ -47,7 +47,7 @@ namespace lib { namespace time{ namespace test{ - using asset::meta::TimeGrid; + using proc::asset::meta::TimeGrid; using format::Frames; using format::Smpte; diff --git a/tests/lib/time/time-mutation-test.cpp b/tests/lib/time/time-mutation-test.cpp index 7ad09d379..2a4837fcb 100644 --- a/tests/lib/time/time-mutation-test.cpp +++ b/tests/lib/time/time-mutation-test.cpp @@ -44,7 +44,7 @@ namespace lib { namespace time{ namespace test{ - using asset::meta::TimeGrid; + using proc::asset::meta::TimeGrid; namespace { inline string diff --git a/tests/lib/time/time-parsing-test.cpp b/tests/lib/time/time-parsing-test.cpp index 812c893d7..24ada115c 100644 --- a/tests/lib/time/time-parsing-test.cpp +++ b/tests/lib/time/time-parsing-test.cpp @@ -37,7 +37,7 @@ namespace lib { namespace time{ namespace test{ - using asset::meta::TimeGrid; + using proc::asset::meta::TimeGrid; using format::LUMIERA_ERROR_INVALID_TIMECODE; diff --git a/tests/lib/time/time-quantisation-test.cpp b/tests/lib/time/time-quantisation-test.cpp index a22988f1b..32b57a355 100644 --- a/tests/lib/time/time-quantisation-test.cpp +++ b/tests/lib/time/time-quantisation-test.cpp @@ -47,7 +47,7 @@ namespace lib { namespace time{ namespace test{ - using asset::meta::TimeGrid; + using proc::asset::meta::TimeGrid; /******************************************************** From b2d6074097ccd7f76bf03d466ad1126aab44adc0 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 2 Dec 2011 21:34:29 +0100 Subject: [PATCH 04/87] cleanup test includes --- src/common/plugin.c | 3 +- src/common/plugin_dynlib.c | 2 +- {tests => src/lib/test}/test.h | 29 ++++++++---- tests/31plugin.tests | 17 +++++-- tests/SConscript | 11 +++-- tests/backend/test-filedescriptors.c | 2 +- tests/backend/test-filehandles.c | 2 +- tests/backend/test-fileheader.c | 2 +- tests/backend/test-filemmap.c | 2 +- tests/backend/test-resourcecollector.c | 2 +- tests/backend/test-threadpool.c | 2 +- tests/backend/test-threads.c | 2 +- tests/common/test-config.c | 2 +- tests/common/test-interfaces.c | 46 +++++++++++++++---- .../interface/say_hello.h} | 0 tests/lib/helloworldtest.cpp | 15 ++++-- tests/library/test-llist.c | 2 +- tests/library/test-locking.c | 2 +- tests/library/test-mpool.c | 2 +- tests/library/test-psplay.c | 2 +- tests/library/test-safeclib.c | 2 +- tests/library/test-slist.c | 2 +- tests/library/test-time.c | 2 +- tests/lumiera/DIR_INFO | 1 - .../example_plugin.c | 2 +- .../plugin/test-cpp-plugin/example_plugin.cpp | 34 +++++++------- 26 files changed, 123 insertions(+), 67 deletions(-) rename {tests => src/lib/test}/test.h (71%) rename tests/{common/hello_interface.h => include/interface/say_hello.h} (100%) delete mode 100644 tests/lumiera/DIR_INFO rename tests/plugin/{examplepluginc => test-c-plugin}/example_plugin.c (99%) diff --git a/src/common/plugin.c b/src/common/plugin.c index 373e405e7..a44592dc8 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -248,7 +248,7 @@ lumiera_plugin_discover (LumieraPlugin (*callback_load)(const char* plugin), LumieraPlugin lumiera_plugin_load (const char* plugin) { - TRACE (pluginloader_dbg); + TRACE (pluginloader_dbg, "plugin=%s", plugin); /* dispatch on ext, call the registered function */ const char* ext = strrchr (plugin, '.'); @@ -417,6 +417,7 @@ lumiera_plugin_delete_fn (PSplaynode node) LUMIERA_INTERFACE_CAST(lumieraorg__plugin, 0) self->plugin; lumiera_interfaceregistry_bulkremove_interfaces (handle->plugin_interfaces ()); } + TRACE (pluginloader_dbg, "unloading plugin/module %s", self->name); itr->lumiera_plugin_unload_fn (self); break; } diff --git a/src/common/plugin_dynlib.c b/src/common/plugin_dynlib.c index 7e8618628..5e9aa30a4 100644 --- a/src/common/plugin_dynlib.c +++ b/src/common/plugin_dynlib.c @@ -34,7 +34,7 @@ LumieraPlugin lumiera_plugin_load_DYNLIB (const char* name) { - TRACE (pluginloader_dbg); + TRACE (pluginloader_dbg, "load DYNLIB: %s", name); REQUIRE (name); LumieraPlugin self = lumiera_plugin_new (name); LumieraInterface plugin = NULL; diff --git a/tests/test.h b/src/lib/test/test.h similarity index 71% rename from tests/test.h rename to src/lib/test/test.h index 1fc00955c..8d45b984f 100644 --- a/tests/test.h +++ b/src/lib/test/test.h @@ -1,8 +1,8 @@ /* - test.h - macros for running tests + TEST.h - support macros for plain-C tests - Copyright (C) - 2008, 2009, 2010, Christian Thaeter + Copyright (C) Lumiera.org + 2008, 2010 Christian Thaeter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -17,10 +17,21 @@ 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. + */ -#ifndef TEST_H -#define TEST_H +/** @file test.h + ** Helpers and support macros for defining test executables in C. + ** These macros provide some building blocks to assemble a \c main() function, + ** which checks a test name parameter and invokes the matching embedded code block. + ** + ** @see test-mpool.c C test example + ** @see HelloWorld_test C++ test example + */ + + +#ifndef LIB_TEST_TEST_H +#define LIB_TEST_TEST_H #include #include @@ -51,10 +62,10 @@ main (int argc, const char** argv) \ fprintf (stderr, " "#name" (planned)\n"); \ else if (!++testcnt) -#define TESTS_END \ - if (!testcnt && argc !=1) \ - fprintf (stderr,"no such test: %s\n", argv[1]); \ - return ret; \ +#define TESTS_END \ + if (!testcnt && argc !=1) \ + fprintf (stderr,"no such test: %s\n", argv[1]); \ + return ret; \ } diff --git a/tests/31plugin.tests b/tests/31plugin.tests index ace85086a..9f59426d0 100644 --- a/tests/31plugin.tests +++ b/tests/31plugin.tests @@ -10,7 +10,8 @@ export LUMIERA_PLUGIN_PATH=modules export LUMIERA_CONFIG_PATH=./ TEST "discovering plugins" plugin_discover < #include diff --git a/tests/backend/test-resourcecollector.c b/tests/backend/test-resourcecollector.c index 6629ea2f8..4273e8404 100644 --- a/tests/backend/test-resourcecollector.c +++ b/tests/backend/test-resourcecollector.c @@ -21,7 +21,7 @@ #include "backend/resourcecollector.h" -#include "tests/test.h" +#include "lib/test/test.h" #include #include diff --git a/tests/backend/test-threadpool.c b/tests/backend/test-threadpool.c index 4c0b1846b..5a07a090a 100644 --- a/tests/backend/test-threadpool.c +++ b/tests/backend/test-threadpool.c @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "tests/test.h" +#include "lib/test/test.h" #include "backend/threadpool.h" #include "include/logging.h" diff --git a/tests/backend/test-threads.c b/tests/backend/test-threads.c index a3b3697a3..42bbf6697 100644 --- a/tests/backend/test-threads.c +++ b/tests/backend/test-threads.c @@ -27,7 +27,7 @@ #include "include/logging.h" #include "lib/mutex.h" #include "backend/threads.h" -#include "tests/test.h" +#include "lib/test/test.h" #include #include diff --git a/tests/common/test-config.c b/tests/common/test-config.c index 8ac469fe3..fc64caabb 100644 --- a/tests/common/test-config.c +++ b/tests/common/test-config.c @@ -24,7 +24,7 @@ #include "common/config.h" #include "common/configitem.h" -#include "tests/test.h" +#include "lib/test/test.h" TESTS_BEGIN diff --git a/tests/common/test-interfaces.c b/tests/common/test-interfaces.c index 19db8f8da..d1eb71e5d 100644 --- a/tests/common/test-interfaces.c +++ b/tests/common/test-interfaces.c @@ -25,8 +25,8 @@ #include "common/config.h" #include "common/config_interface.h" -#include "tests/test.h" -#include "tests/common/hello_interface.h" +#include "lib/test/test.h" +#include "interface/say_hello.h" /* define 2 example interfaces @@ -465,7 +465,9 @@ TEST (plugin_discover) if (lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register)) { - LumieraPlugin p = lumiera_plugin_lookup ("modules/examplepluginc.lum"); + LumieraPlugin p = lumiera_plugin_lookup ("modules/test-c-plugin.lum"); + printf ("found plugin: %s\n", lumiera_plugin_name (p)); + p = lumiera_plugin_lookup ("modules/test-cpp-plugin.lum"); printf ("found plugin: %s\n", lumiera_plugin_name (p)); lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register); } @@ -482,12 +484,12 @@ TEST (plugin_unload) lumiera_interfaceregistry_init (); lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register); - LumieraPlugin p = lumiera_plugin_lookup ("modules/examplepluginc.lum"); + LumieraPlugin p = lumiera_plugin_lookup ("modules/test-c-plugin.lum"); printf ("plugin discovered before unload: %p\n", p); - CHECK (p, "prerequisite: need to load examplepluginc.lum"); + CHECK (p, "prerequisite: need to load test-c-plugin.lum"); - lumiera_plugin_unload (lumiera_plugin_lookup ("modules/examplepluginc.lum")); - p = lumiera_plugin_lookup ("examplepluginc.lum"); + lumiera_plugin_unload (lumiera_plugin_lookup ("modules/test-c-plugin.lum")); + p = lumiera_plugin_lookup ("test-c-plugin.lum"); printf ("plugin discovered after unload: %p\n", p); CHECK (!p, "failed to unload plugin."); @@ -496,7 +498,7 @@ TEST (plugin_unload) } -TEST (plugin_examplepluginc) +TEST (plugin_exampleplugin) { lumiera_interfaceregistry_init (); lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register); @@ -522,7 +524,7 @@ TEST (plugin_examplepluginc) lumiera_config_destroy (); } -TEST (plugin_examplepluginc_nested) +TEST (plugin_exampleplugin_nested) { lumiera_interfaceregistry_init (); lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register); @@ -540,6 +542,32 @@ TEST (plugin_examplepluginc_nested) lumiera_config_destroy (); } + +TEST (plugin_exampleplugin_cpp) +{ + lumiera_interfaceregistry_init (); + lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register); + + + LUMIERA_INTERFACE_HANDLE(lumieraorg_testhello, 0) german = + LUMIERA_INTERFACE_OPEN (lumieraorg_testhello, 0, 0, lumieraorg_hello_german_cpp); + + LUMIERA_INTERFACE_HANDLE(lumieraorg_testhello, 0) english = + LUMIERA_INTERFACE_OPEN (lumieraorg_testhello, 0, 0, lumieraorg_hello_english_cpp); + + german->hello (); + german->goodbye ("schnöde Welt!"); + + english->hello (); + english->goodbye ("Vale of Tears!"); + + LUMIERA_INTERFACE_CLOSE (german); + LUMIERA_INTERFACE_CLOSE (english); + + lumiera_interfaceregistry_destroy (); + lumiera_config_destroy (); +} + TESTS_END diff --git a/tests/common/hello_interface.h b/tests/include/interface/say_hello.h similarity index 100% rename from tests/common/hello_interface.h rename to tests/include/interface/say_hello.h diff --git a/tests/lib/helloworldtest.cpp b/tests/lib/helloworldtest.cpp index 529b536ed..c54c87440 100644 --- a/tests/lib/helloworldtest.cpp +++ b/tests/lib/helloworldtest.cpp @@ -35,7 +35,7 @@ namespace lumiera{ namespace test { /****************************************** - * Hellooooooo the world is a test + * Hellooooooo the world is just a test * @test demo of using the test framework */ class HelloWorld_test : public Test @@ -58,10 +58,15 @@ namespace test { - /** Register this test class to be invoked in some test groups (suites) */ - Launch run_HelloWorld_test("HelloWorld_test","unit common"); - - // NOTE: you may use the Macro "LAUNCHER" in run.hpp to simplify this Registration + /** Register this test class to be invoked in some test groups (suites) + * @remarks this macro \c LUNCHER is defined in run.hpp to simplify + * the registration of test classes. It expands to the + * following static variable definition + * \code + * Launch run_HelloWorld_test("HelloWorld_test","unit common"); + * \endcode + */ + LAUNCHER (HelloWorld_test, "unit common"); diff --git a/tests/library/test-llist.c b/tests/library/test-llist.c index 305ba8d97..0cbef6107 100644 --- a/tests/library/test-llist.c +++ b/tests/library/test-llist.c @@ -22,7 +22,7 @@ #include #include "lib/llist.h" -#include "tests/test.h" +#include "lib/test/test.h" TESTS_BEGIN diff --git a/tests/library/test-locking.c b/tests/library/test-locking.c index 8a8ad8f61..4210e8327 100644 --- a/tests/library/test-locking.c +++ b/tests/library/test-locking.c @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "tests/test.h" +#include "lib/test/test.h" #include "lib/mutex.h" #include "lib/recmutex.h" #include "lib/condition.h" diff --git a/tests/library/test-mpool.c b/tests/library/test-mpool.c index fdd4dba22..0975291a6 100644 --- a/tests/library/test-mpool.c +++ b/tests/library/test-mpool.c @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "tests/test.h" +#include "lib/test/test.h" #include "lib/mpool.h" struct teststruct diff --git a/tests/library/test-psplay.c b/tests/library/test-psplay.c index 2eb738c9f..0d345fd94 100644 --- a/tests/library/test-psplay.c +++ b/tests/library/test-psplay.c @@ -24,7 +24,7 @@ #include #include "lib/psplay.h" -#include "tests/test.h" +#include "lib/test/test.h" struct testitem { diff --git a/tests/library/test-safeclib.c b/tests/library/test-safeclib.c index cbff85479..bbb77c77f 100644 --- a/tests/library/test-safeclib.c +++ b/tests/library/test-safeclib.c @@ -18,7 +18,7 @@ */ #include "lib/safeclib.h" #include "lib/tmpbuf.h" /* not factored out yet */ -#include "tests/test.h" +#include "lib/test/test.h" #include #include diff --git a/tests/library/test-slist.c b/tests/library/test-slist.c index aa1cdf95e..ddacbde1e 100644 --- a/tests/library/test-slist.c +++ b/tests/library/test-slist.c @@ -20,7 +20,7 @@ */ #include "lib/slist.h" -#include "tests/test.h" +#include "lib/test/test.h" #include #include diff --git a/tests/library/test-time.c b/tests/library/test-time.c index b7922e778..97d667435 100644 --- a/tests/library/test-time.c +++ b/tests/library/test-time.c @@ -21,7 +21,7 @@ typedef unsigned int uint; -#include "tests/test.h" +#include "lib/test/test.h" #include "lib/time.h" #include diff --git a/tests/lumiera/DIR_INFO b/tests/lumiera/DIR_INFO deleted file mode 100644 index 5dbe3e850..000000000 --- a/tests/lumiera/DIR_INFO +++ /dev/null @@ -1 +0,0 @@ -tests for the main lumiera loader diff --git a/tests/plugin/examplepluginc/example_plugin.c b/tests/plugin/test-c-plugin/example_plugin.c similarity index 99% rename from tests/plugin/examplepluginc/example_plugin.c rename to tests/plugin/test-c-plugin/example_plugin.c index 9751413b0..5e9ee257f 100644 --- a/tests/plugin/examplepluginc/example_plugin.c +++ b/tests/plugin/test-c-plugin/example_plugin.c @@ -26,7 +26,7 @@ #include "common/interfacedescriptor.h" #include "common/config_interface.h" -#include "tests/common/hello_interface.h" +#include "interface/say_hello.h" LUMIERA_PLUGIN_INTERFACEHANDLE; diff --git a/tests/plugin/test-cpp-plugin/example_plugin.cpp b/tests/plugin/test-cpp-plugin/example_plugin.cpp index a41473f51..2a0f9be62 100644 --- a/tests/plugin/test-cpp-plugin/example_plugin.cpp +++ b/tests/plugin/test-cpp-plugin/example_plugin.cpp @@ -1,5 +1,5 @@ /* - example_plugin.cpp - example plugin (C++) for testing the interface/plugin system + ExamplePlugin - example plugin (C++) for testing the interface/plugin system Copyright (C) Lumiera.org 2008, Christian Thaeter , @@ -32,7 +32,7 @@ extern "C" { #include "common/interface.h" #include "common/interfacedescriptor.h" -#include "tests/common/hello_interface.h" +#include "interface/say_hello.h" } using boost::format; @@ -41,7 +41,7 @@ using std::endl; -class example_plugin +class ExamplePlugin { public: static LumieraInterface @@ -55,13 +55,13 @@ class example_plugin static void myclose (LumieraInterface) { - std::cout << "closed" << endl; + std::cout << "dying" << endl; } }; -class example_plugin_de - : public example_plugin +class ExamplePlugin_de + : public ExamplePlugin { public: static void @@ -73,13 +73,13 @@ class example_plugin_de static void servus (const char* m) { - std::cout << "Tschuess " << m << endl; + std::cout << "Tschüss " << m << endl; } }; -class example_plugin_en - : public example_plugin +class ExamplePlugin_en + : public ExamplePlugin { public: static void @@ -107,22 +107,22 @@ extern "C" { /* ================== define two lumieraorg_testhello instance ==== LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0 ,lumieraorg_hello_german_cpp , NULL /* no descriptor given */ - , example_plugin::myopen - , example_plugin::myclose + , ExamplePlugin::myopen + , ExamplePlugin::myclose , LUMIERA_INTERFACE_MAP (hello, "\300\244\125\265\235\312\175\263\335\044\371\047\247\263\015\322", - example_plugin_de::griazi) + ExamplePlugin_de::griazi) , LUMIERA_INTERFACE_MAP (goodbye, "\115\365\126\102\201\104\012\257\153\232\006\210\010\346\076\070", - example_plugin_de::servus) + ExamplePlugin_de::servus) ), LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0 ,lumieraorg_hello_english_cpp , NULL /* no descriptor given */ - , example_plugin::myopen - , example_plugin::myclose + , ExamplePlugin::myopen + , ExamplePlugin::myclose , LUMIERA_INTERFACE_MAP (hello, "\303\367\107\154\077\063\237\066\034\034\050\136\170\220\260\226", - example_plugin_en::hello) + ExamplePlugin_en::hello) , LUMIERA_INTERFACE_MAP (goodbye, "\107\207\072\105\101\102\150\201\322\043\104\110\232\023\205\161", - example_plugin_en::bye) + ExamplePlugin_en::bye) ) ); From d9f84a9bfdc59441cbb5657046e4e971d7d593ee Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 3 Dec 2011 02:56:50 +0100 Subject: [PATCH 05/87] clean up lib/meta namespaces --- src/common/configrules.hpp | 16 +- src/common/query/fake-configrules.hpp | 9 +- src/lib/itertools.hpp | 2 +- src/lib/meta/configflags.hpp | 14 +- src/lib/meta/duck-detector.hpp | 10 - src/lib/meta/function-closure.hpp | 12 +- src/lib/meta/function-erasure.hpp | 10 +- src/lib/meta/function.hpp | 10 +- src/lib/meta/generator-combinations.hpp | 10 +- src/lib/meta/generator.hpp | 12 +- src/lib/meta/maybe-compare.hpp | 10 +- src/lib/meta/tuple.hpp | 10 +- src/lib/meta/typelist-manip.hpp | 10 +- src/lib/meta/typelist-util.hpp | 10 +- src/lib/meta/typelist.hpp | 12 +- src/lib/meta/typeseq-util.hpp | 10 +- src/lib/meta/util.hpp | 148 ++++--- src/lib/multifact-arg.hpp | 6 +- src/lib/polymorphic-value.hpp | 4 +- src/lib/simple-allocator.hpp | 6 +- src/lib/test/mock-injector.hpp | 4 +- src/lib/time/control-policy.hpp | 2 +- src/lib/time/formats.hpp | 6 +- src/lib/variant.hpp | 6 +- src/lib/visitor-dispatcher.hpp | 4 +- src/lib/visitor-policies.hpp | 6 +- src/lib/visitor.hpp | 10 +- src/lib/wrapper.hpp | 4 +- src/lib/wrapperptr.hpp | 8 +- src/proc/control/argument-tuple-accept.hpp | 2 +- src/proc/control/command-closure.hpp | 16 +- src/proc/control/command-def.hpp | 12 +- src/proc/control/command-invocation.hpp | 2 +- src/proc/control/command-signature.hpp | 10 +- src/proc/control/command.hpp | 2 +- src/proc/control/memento-tie.hpp | 6 +- src/proc/engine/nodeoperation.hpp | 4 +- src/proc/engine/nodewiring-config.hpp | 4 +- src/proc/engine/nodewiring.cpp | 12 +- src/proc/mobject/builder/buildertool.hpp | 10 +- src/proc/mobject/output-designation.hpp | 2 +- .../session/session-service-defaults.hpp | 6 +- .../mobject/session/session-service-fetch.hpp | 6 +- src/proc/mobject/session/session-services.hpp | 4 +- .../control/argument-tuple-accept-test.cpp | 4 +- .../proc/control/command-argument-test.cpp | 2 +- .../control/command-clone-builder-test.cpp | 2 +- .../proc/control/command-equality-test.cpp | 2 +- .../proc/control/command-mutation-test.cpp | 2 +- .../handling-pattern-standard-impl-test.cpp | 2 +- .../session/session-service-access-test.cpp | 4 +- tests/lib/meta/config-flags-test.cpp | 6 +- tests/lib/meta/dummy-functions.hpp | 6 +- tests/lib/meta/function-closure-test.cpp | 8 +- tests/lib/meta/function-composition-test.cpp | 8 +- tests/lib/meta/function-erasure-test.cpp | 6 +- .../lib/meta/generator-combinations-test.cpp | 6 +- tests/lib/meta/generator-test.cpp | 6 +- .../lib/meta/iterable-classification-test.cpp | 6 +- tests/lib/meta/tuple-diagnostics.hpp | 8 +- tests/lib/meta/type-tuple-test.cpp | 8 +- tests/lib/meta/typelist-diagnostics.hpp | 6 +- tests/lib/meta/typelist-manip-test.cpp | 6 +- tests/lib/meta/typelist-test.cpp | 6 +- tests/lib/meta/typelist-util-test.cpp | 6 +- tests/lib/meta/typeseq-manip-test.cpp | 8 +- tests/lib/time/time-control-test.cpp | 6 +- tests/lib/visitingtoolextendedtest.cpp | 362 +++++++++--------- tests/lib/visitingtooltest.cpp | 243 ++++++------ 69 files changed, 594 insertions(+), 614 deletions(-) diff --git a/src/common/configrules.hpp b/src/common/configrules.hpp index 1e91d4813..28b535d02 100644 --- a/src/common/configrules.hpp +++ b/src/common/configrules.hpp @@ -185,7 +185,7 @@ namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? */ template class ConfigRules - : public typelist::InstantiateForEach + : public lib::meta::InstantiateForEach { protected: ConfigRules () {} @@ -212,13 +212,13 @@ namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? * the list of all concrete types participating in the * rule based config query system */ - typedef typelist::Types < proc::mobject::session::Track - , proc::asset::Pipe - , const proc::asset::ProcPatt - , proc::asset::Timeline - , proc::asset::Sequence - > ::List - InterfaceTypes; + typedef lib::meta::Types < proc::mobject::session::Track + , proc::asset::Pipe + , const proc::asset::ProcPatt + , proc::asset::Timeline + , proc::asset::Sequence + > ::List + InterfaceTypes; /** * user-visible Interface to the ConfigRules subsystem. diff --git a/src/common/query/fake-configrules.hpp b/src/common/query/fake-configrules.hpp index 2a527e63c..80ec54f74 100644 --- a/src/common/query/fake-configrules.hpp +++ b/src/common/query/fake-configrules.hpp @@ -60,6 +60,7 @@ namespace lumiera { using asset::ProcPatt; using asset::PProcPatt; using proc::mobject::Session; + using lib::meta::InstantiateChained; using util::isnil; @@ -248,10 +249,10 @@ namespace lumiera { * values for some types of interest for testing and debugging. */ class MockConfigRules - : public typelist::InstantiateChained < InterfaceTypes - , LookupPreconfigured // building block used for each of the types - , MockTable // for implementing the base class (interface) - > + : public InstantiateChained < InterfaceTypes + , LookupPreconfigured // building block used for each of the types + , MockTable // for implementing the base class (interface) + > { protected: MockConfigRules (); ///< to be used only by the singleton factory diff --git a/src/lib/itertools.hpp b/src/lib/itertools.hpp index a4efc4829..22a9e6c32 100644 --- a/src/lib/itertools.hpp +++ b/src/lib/itertools.hpp @@ -491,7 +491,7 @@ namespace lib { namespace { // Helper to pick up the produced value type automatically - using lumiera::typelist::FunctionSignature; + using lib::meta::FunctionSignature; template struct _ProducedOutput diff --git a/src/lib/meta/configflags.hpp b/src/lib/meta/configflags.hpp index 16c81a7bb..4e71bfd9e 100644 --- a/src/lib/meta/configflags.hpp +++ b/src/lib/meta/configflags.hpp @@ -45,15 +45,15 @@ */ -#ifndef LUMIERA_META_CONFIGFLAGS_H -#define LUMIERA_META_CONFIGFLAGS_H +#ifndef LIB_META_CONFIGFLAGS_H +#define LIB_META_CONFIGFLAGS_H #include "lib/meta/typelist.hpp" -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta{ const size_t CONFIG_FLAGS_MAX = 5; @@ -107,13 +107,13 @@ namespace typelist{ > struct ConfigSetFlag > { - typedef typelist::Config Config; + typedef lib::meta::Config Config; }; /** build a configuration type from a list-of-flags */ - template > + template > struct BuildConfigFromFlags { typedef CONF Config; @@ -199,5 +199,5 @@ namespace typelist{ -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/duck-detector.hpp b/src/lib/meta/duck-detector.hpp index 84363616e..bed83ce63 100644 --- a/src/lib/meta/duck-detector.hpp +++ b/src/lib/meta/duck-detector.hpp @@ -92,16 +92,6 @@ #include "lib/meta/util.hpp" -namespace lib { -namespace meta{ - - ///////////////TICKET #175 sort out meta namespace - using lumiera::Yes_t; - using lumiera::No_t; - -}} // namespace lib::meta - - diff --git a/src/lib/meta/function-closure.hpp b/src/lib/meta/function-closure.hpp index 374c75883..207c139bd 100644 --- a/src/lib/meta/function-closure.hpp +++ b/src/lib/meta/function-closure.hpp @@ -44,8 +44,8 @@ */ -#ifndef LUMIERA_META_FUNCTION_CLOSURE_H -#define LUMIERA_META_FUNCTION_CLOSURE_H +#ifndef LIB_META_FUNCTION_CLOSURE_H +#define LIB_META_FUNCTION_CLOSURE_H #include "lib/meta/function.hpp" #include "lib/meta/tuple.hpp" @@ -54,9 +54,9 @@ -namespace lumiera { -namespace typelist{ -namespace func { +namespace lib { +namespace meta{ +namespace func{ using std::tr1::function; @@ -884,5 +884,5 @@ namespace func { -}}} // namespace lumiera::typelist::func +}}} // namespace lib::meta::func #endif diff --git a/src/lib/meta/function-erasure.hpp b/src/lib/meta/function-erasure.hpp index 40acfa46c..f2ed457e4 100644 --- a/src/lib/meta/function-erasure.hpp +++ b/src/lib/meta/function-erasure.hpp @@ -52,8 +52,8 @@ */ -#ifndef LUMIERA_META_FUNCTION_ERASURE_H -#define LUMIERA_META_FUNCTION_ERASURE_H +#ifndef LIB_META_FUNCTION_ERASURE_H +#define LIB_META_FUNCTION_ERASURE_H #include "lib/util.hpp" #include "lib/error.hpp" @@ -64,8 +64,8 @@ #include -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta{ using std::tr1::function; using util::unConst; @@ -240,5 +240,5 @@ namespace typelist{ -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/function.hpp b/src/lib/meta/function.hpp index fa7c38c55..543a22b19 100644 --- a/src/lib/meta/function.hpp +++ b/src/lib/meta/function.hpp @@ -44,8 +44,8 @@ */ -#ifndef LUMIERA_META_FUNCTION_H -#define LUMIERA_META_FUNCTION_H +#ifndef LIB_META_FUNCTION_H +#define LIB_META_FUNCTION_H #include "lib/meta/typelist.hpp" @@ -53,8 +53,8 @@ -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta{ using std::tr1::function; @@ -357,5 +357,5 @@ namespace typelist{ -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/generator-combinations.hpp b/src/lib/meta/generator-combinations.hpp index 3cc3a0946..bbb85ed0e 100644 --- a/src/lib/meta/generator-combinations.hpp +++ b/src/lib/meta/generator-combinations.hpp @@ -33,8 +33,8 @@ */ -#ifndef LUMIERA_META_GENERATOR_COMBINATIONS_H -#define LUMIERA_META_GENERATOR_COMBINATIONS_H +#ifndef LIB_META_GENERATOR_COMBINATIONS_H +#define LIB_META_GENERATOR_COMBINATIONS_H #include "lib/meta/typelist.hpp" #include "lib/meta/typelist-manip.hpp" @@ -42,8 +42,8 @@ -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta{ template @@ -97,5 +97,5 @@ namespace typelist{ -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/generator.hpp b/src/lib/meta/generator.hpp index c3dfa76f4..fd0b01335 100644 --- a/src/lib/meta/generator.hpp +++ b/src/lib/meta/generator.hpp @@ -39,7 +39,7 @@ This code is heavily inspired by /** @file generator.hpp - ** Helpers for working with lumiera::typelist::Types (i.e. lists-of-types). + ** Helpers for working with lib::meta::Types (i.e. lists-of-types). ** The main purpose is to build interfaces and polymorphic implementations ** (using virtual functions) based on templated Types or Collections of types, ** which is not possible without Template Metaprogramming. @@ -56,15 +56,15 @@ This code is heavily inspired by */ -#ifndef LUMIERA_META_GENERATOR_H -#define LUMIERA_META_GENERATOR_H +#ifndef LIB_META_GENERATOR_H +#define LIB_META_GENERATOR_H #include "lib/meta/typelist.hpp" -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta{ /** * Apply a template to a collection of types. @@ -207,5 +207,5 @@ namespace typelist{ }; -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/maybe-compare.hpp b/src/lib/meta/maybe-compare.hpp index 3c96cdf01..9fa81c9da 100644 --- a/src/lib/meta/maybe-compare.hpp +++ b/src/lib/meta/maybe-compare.hpp @@ -21,8 +21,8 @@ */ -#ifndef LUMIERA_META_MAYBE_COMPARE_H -#define LUMIERA_META_MAYBE_COMPARE_H +#ifndef LIB_META_MAYBE_COMPARE_H +#define LIB_META_MAYBE_COMPARE_H #include "lib/functor-util.hpp" @@ -30,8 +30,8 @@ #include -namespace lumiera { -namespace typelist { +namespace lib { +namespace meta{ using std::tr1::function; @@ -72,5 +72,5 @@ namespace typelist { } -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/tuple.hpp b/src/lib/meta/tuple.hpp index 38d5def29..03c68384f 100644 --- a/src/lib/meta/tuple.hpp +++ b/src/lib/meta/tuple.hpp @@ -44,8 +44,8 @@ */ -#ifndef LUMIERA_META_TUPLE_H -#define LUMIERA_META_TUPLE_H +#ifndef LIB_META_TUPLE_H +#define LIB_META_TUPLE_H #include "lib/meta/typelist.hpp" #include "lib/meta/typelist-util.hpp" @@ -54,8 +54,8 @@ -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { @@ -743,5 +743,5 @@ namespace typelist{ -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/typelist-manip.hpp b/src/lib/meta/typelist-manip.hpp index b0d789a76..22144e86f 100644 --- a/src/lib/meta/typelist-manip.hpp +++ b/src/lib/meta/typelist-manip.hpp @@ -49,15 +49,15 @@ */ -#ifndef LUMIERA_META_TYPELIST_MANIP_H -#define LUMIERA_META_TYPELIST_MANIP_H +#ifndef LIB_META_TYPELIST_MANIP_H +#define LIB_META_TYPELIST_MANIP_H #include "lib/meta/typelist.hpp" -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { /** pick the n-th element from a typelist */ @@ -325,5 +325,5 @@ namespace typelist{ -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/typelist-util.hpp b/src/lib/meta/typelist-util.hpp index c699855ad..ff8086cb3 100644 --- a/src/lib/meta/typelist-util.hpp +++ b/src/lib/meta/typelist-util.hpp @@ -42,15 +42,15 @@ */ -#ifndef LUMIERA_META_TYPELIST_UTIL_H -#define LUMIERA_META_TYPELIST_UTIL_H +#ifndef LIB_META_TYPELIST_UTIL_H +#define LIB_META_TYPELIST_UTIL_H #include "lib/meta/typelist.hpp" -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { /** @@ -123,5 +123,5 @@ namespace typelist{ -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/typelist.hpp b/src/lib/meta/typelist.hpp index 3de24176f..d0cbb44f3 100644 --- a/src/lib/meta/typelist.hpp +++ b/src/lib/meta/typelist.hpp @@ -55,7 +55,7 @@ This code is heavily inspired by ** effectively this is a flavour of functional programming. Just the ** "execution environment" is the compiler, during compilation. ** - ** @see lumiera::visitor::Applicable usage example + ** @see lib::visitor::Applicable usage example ** @see control::CommandSignature more elaborate usage example (dissecting a functor signature) ** @see TypeList_test ** @see TypeListManip_test @@ -63,14 +63,14 @@ This code is heavily inspired by */ -#ifndef LUMIERA_META_TYPELIST_H -#define LUMIERA_META_TYPELIST_H +#ifndef LIB_META_TYPELIST_H +#define LIB_META_TYPELIST_H -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { struct NullType { @@ -129,5 +129,5 @@ namespace typelist{ typedef Node NodeNull; -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/typeseq-util.hpp b/src/lib/meta/typeseq-util.hpp index 07ecbffa6..79c76e878 100644 --- a/src/lib/meta/typeseq-util.hpp +++ b/src/lib/meta/typeseq-util.hpp @@ -41,8 +41,8 @@ */ -#ifndef LUMIERA_META_TYPESEQ_UTIL_H -#define LUMIERA_META_TYPESEQ_UTIL_H +#ifndef LIB_META_TYPESEQ_UTIL_H +#define LIB_META_TYPESEQ_UTIL_H #include "lib/meta/typelist.hpp" #include "lib/meta/typelist-manip.hpp" @@ -50,8 +50,8 @@ -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { @@ -203,5 +203,5 @@ namespace typelist{ -}} // namespace lumiera::typelist +}} // namespace lib::meta #endif diff --git a/src/lib/meta/util.hpp b/src/lib/meta/util.hpp index 14c7cd6a8..f32cbb1ed 100644 --- a/src/lib/meta/util.hpp +++ b/src/lib/meta/util.hpp @@ -21,12 +21,13 @@ */ -#ifndef LUMIERA_META_UTIL_H -#define LUMIERA_META_UTIL_H +#ifndef LIB_META_UTIL_H +#define LIB_META_UTIL_H -namespace lumiera { +namespace lib { +namespace meta { /* types for figuring out the overload resolution chosen by the compiler */ @@ -36,77 +37,74 @@ namespace lumiera { - namespace typelist { - - /** Compile-time Type equality: - * Simple Trait template to pick up types considered - * \em identical by the compiler. - * @warning identical, not sub-type! - */ - template - struct is_sameType - { - static const bool value = false; - }; - - template - struct is_sameType - { - static const bool value = true; - }; - - - /** semi-automatic detection if an instantiation is possible. - * Requires help by the template to be tested, which needs to define - * a typedef member \c is_defined. The embedded metafunction Test can be used - * as a predicate for filtering types which may yield a valid instantiation - * of the candidate template in question. - * \par - * A fully automated solution for this problem is impossible by theoretic reasons. - * Any non trivial use of such a \c is_defined trait would break the "One Definition Rule", - * as the state of any type can change from "partially defined" to "fully defined" over - * the course of any translation unit. Thus, even if there may be a \em solution out there, - * we can expect it to break at some point by improvements/fixes to the C++ Language. - */ - template class _CandidateTemplate_> - struct Instantiation - { - - template - class Test - { - typedef _CandidateTemplate_ Instance; - - template - static Yes_t check(typename U::is_defined *); - template - static No_t check(...); - - public: - static const bool value = (sizeof(Yes_t)==sizeof(check(0))); - }; - }; - - - /** Trait template for detecting a typelist type. - * For example, this allows to write specialisations with the help of - * boost::enable_if - */ - template - class is_Typelist - { - template - static Yes_t check(typename X::List *); - template - static No_t check(...); - - public: - static const bool value = (sizeof(Yes_t)==sizeof(check(0))); - }; - - - - } // namespace typelist -} // namespace lumiera + /** Compile-time Type equality: + * Simple Trait template to pick up types considered + * \em identical by the compiler. + * @warning identical, not sub-type! + */ + template + struct is_sameType + { + static const bool value = false; + }; + + template + struct is_sameType + { + static const bool value = true; + }; + + + /** semi-automatic detection if an instantiation is possible. + * Requires help by the template to be tested, which needs to define + * a typedef member \c is_defined. The embedded metafunction Test can be used + * as a predicate for filtering types which may yield a valid instantiation + * of the candidate template in question. + * \par + * A fully automated solution for this problem is impossible by theoretic reasons. + * Any non trivial use of such a \c is_defined trait would break the "One Definition Rule", + * as the state of any type can change from "partially defined" to "fully defined" over + * the course of any translation unit. Thus, even if there may be a \em solution out there, + * we can expect it to break at some point by improvements/fixes to the C++ Language. + */ + template class _CandidateTemplate_> + struct Instantiation + { + + template + class Test + { + typedef _CandidateTemplate_ Instance; + + template + static Yes_t check(typename U::is_defined *); + template + static No_t check(...); + + public: + static const bool value = (sizeof(Yes_t)==sizeof(check(0))); + }; + }; + + + /** Trait template for detecting a typelist type. + * For example, this allows to write specialisations with the help of + * boost::enable_if + */ + template + class is_Typelist + { + template + static Yes_t check(typename X::List *); + template + static No_t check(...); + + public: + static const bool value = (sizeof(Yes_t)==sizeof(check(0))); + }; + + + +}} // namespace lib::meta #endif diff --git a/src/lib/multifact-arg.hpp b/src/lib/multifact-arg.hpp index c68117c2c..eee802e67 100644 --- a/src/lib/multifact-arg.hpp +++ b/src/lib/multifact-arg.hpp @@ -54,9 +54,9 @@ namespace lib { namespace factory { - using lumiera::typelist::Types; - using lumiera::typelist::FunctionSignature; - using lumiera::typelist::FunctionTypedef; + using lib::meta::Types; + using lib::meta::FunctionSignature; + using lib::meta::FunctionTypedef; using std::tr1::function; diff --git a/src/lib/polymorphic-value.hpp b/src/lib/polymorphic-value.hpp index a05e04519..a9b92bc5e 100644 --- a/src/lib/polymorphic-value.hpp +++ b/src/lib/polymorphic-value.hpp @@ -155,8 +155,8 @@ namespace lib { namespace error = lumiera::error; using boost::enable_if; - using lumiera::Yes_t; - using lumiera::No_t; + using lib::meta::Yes_t; + using lib::meta::No_t; struct EmptyBase{ }; diff --git a/src/lib/simple-allocator.hpp b/src/lib/simple-allocator.hpp index f36b19a30..8dd5cea25 100644 --- a/src/lib/simple-allocator.hpp +++ b/src/lib/simple-allocator.hpp @@ -60,9 +60,9 @@ namespace lib { - using lumiera::typelist::Types; - using lumiera::typelist::IsInList; - using lumiera::typelist::InstantiateForEach; + using lib::meta::Types; + using lib::meta::IsInList; + using lib::meta::InstantiateForEach; diff --git a/src/lib/test/mock-injector.hpp b/src/lib/test/mock-injector.hpp index 116711966..086cd478d 100644 --- a/src/lib/test/mock-injector.hpp +++ b/src/lib/test/mock-injector.hpp @@ -130,8 +130,8 @@ namespace test{ namespace mock { using boost::enable_if; - using lumiera::Yes_t; - using lumiera::No_t; + using lib::meta::Yes_t; + using lib::meta::No_t; /** * Metafunction: does the Type in question diff --git a/src/lib/time/control-policy.hpp b/src/lib/time/control-policy.hpp index 7ffed6426..a657fb7ff 100644 --- a/src/lib/time/control-policy.hpp +++ b/src/lib/time/control-policy.hpp @@ -115,7 +115,7 @@ namespace time { namespace mutation { using boost::disable_if; - using lumiera::typelist::is_sameType; + using lib::meta::is_sameType; using std::tr1::placeholders::_1; using std::tr1::function; using std::tr1::bind; diff --git a/src/lib/time/formats.hpp b/src/lib/time/formats.hpp index 12ac1b9b8..252c7145c 100644 --- a/src/lib/time/formats.hpp +++ b/src/lib/time/formats.hpp @@ -162,9 +162,9 @@ namespace time { /* == Descriptor to define Support for specific formats == */ - using lumiera::typelist::Types; - using lumiera::typelist::Node; - using lumiera::typelist::NullType; + using lib::meta::Types; + using lib::meta::Node; + using lib::meta::NullType; /** * Descriptor to denote support for a specific (timecode) format. diff --git a/src/lib/variant.hpp b/src/lib/variant.hpp index b4eef9b76..f764ec4bb 100644 --- a/src/lib/variant.hpp +++ b/src/lib/variant.hpp @@ -56,9 +56,9 @@ namespace lib { namespace variant { - using lumiera::typelist::count; - using lumiera::typelist::maxSize; - using lumiera::typelist::InstantiateWithIndex; + using lib::meta::count; + using lib::meta::maxSize; + using lib::meta::InstantiateWithIndex; /** * internal helper used to build a variant storage wrapper. diff --git a/src/lib/visitor-dispatcher.hpp b/src/lib/visitor-dispatcher.hpp index 35f566193..fba85bf1a 100644 --- a/src/lib/visitor-dispatcher.hpp +++ b/src/lib/visitor-dispatcher.hpp @@ -34,7 +34,7 @@ #include -namespace lumiera { +namespace lib { namespace visitor { using lib::ClassLock; @@ -213,5 +213,5 @@ namespace visitor { -}} // namespace lumiera::visitor +}} // namespace lib::visitor #endif diff --git a/src/lib/visitor-policies.hpp b/src/lib/visitor-policies.hpp index 164b7d1b2..558fbda35 100644 --- a/src/lib/visitor-policies.hpp +++ b/src/lib/visitor-policies.hpp @@ -22,7 +22,7 @@ /** @file visitor-policies.hpp - ** Policies usable for configuring the lumiera::visitor::Tool for different kinds of error handling. + ** Policies usable for configuring the lib::visitor::Tool for different kinds of error handling. ** @see buildertool.hpp for another flavour (calling an catch-all-function there) ** */ @@ -35,7 +35,7 @@ #include "lib/error.hpp" -namespace lumiera { +namespace lib { namespace visitor { /** @@ -70,5 +70,5 @@ namespace visitor { -}} // namespace lumiera::visitor +}} // namespace lib::visitor #endif diff --git a/src/lib/visitor.hpp b/src/lib/visitor.hpp index b2a67e447..851cfc14e 100644 --- a/src/lib/visitor.hpp +++ b/src/lib/visitor.hpp @@ -73,8 +73,8 @@ Credits for many further implementation ideas go to -#ifndef LUMIERA_VISITOR_H -#define LUMIERA_VISITOR_H +#ifndef LIB_VISITOR_H +#define LIB_VISITOR_H #include "lib/visitor-policies.hpp" #include "lib/visitor-dispatcher.hpp" @@ -82,9 +82,11 @@ Credits for many further implementation ideas go to #include "lib/meta/typelist.hpp" -namespace lumiera { +namespace lib { namespace visitor { + namespace typelist = lib::meta; + /** * Marker interface / base class for all "visiting tools". @@ -225,5 +227,5 @@ namespace visitor { -}} // namespace lumiera::visitor +}} // namespace lib::visitor #endif diff --git a/src/lib/wrapper.hpp b/src/lib/wrapper.hpp index d1065612f..8aa616697 100644 --- a/src/lib/wrapper.hpp +++ b/src/lib/wrapper.hpp @@ -56,7 +56,7 @@ namespace wrapper { using util::unConst; using util::isSameObject; - using lumiera::typelist::FunctionSignature; + using lib::meta::FunctionSignature; using lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE; using boost::remove_const; @@ -380,7 +380,7 @@ namespace wrapper { { using std::tr1::bind; using std::tr1::placeholders::_1; - using lumiera::typelist::func::chained; + using lib::meta::func::chained; // note: binding "this" mandates noncopyable function doCaptureResult = bind (&FunctionResult::captureResult, this, _1 ); function chainedWithResCapture = chained (targetFunction, doCaptureResult); diff --git a/src/lib/wrapperptr.hpp b/src/lib/wrapperptr.hpp index 6248438f3..8dbb29885 100644 --- a/src/lib/wrapperptr.hpp +++ b/src/lib/wrapperptr.hpp @@ -39,10 +39,10 @@ namespace proc { namespace mobject { class MObject; } - typedef lumiera::typelist::Types < mobject::Placement* - , lib::P* - > ::List - WrapperTypes; + typedef lib::meta::Types < mobject::Placement* + , lib::P* + > ::List + WrapperTypes; } namespace lumiera { diff --git a/src/proc/control/argument-tuple-accept.hpp b/src/proc/control/argument-tuple-accept.hpp index 7003c32f7..61c7bf70d 100644 --- a/src/proc/control/argument-tuple-accept.hpp +++ b/src/proc/control/argument-tuple-accept.hpp @@ -69,7 +69,7 @@ namespace control { namespace bind_arg { // internals.... - using namespace lumiera::typelist; + using namespace lib::meta; // diff --git a/src/proc/control/command-closure.hpp b/src/proc/control/command-closure.hpp index 291717bb2..a2246125c 100644 --- a/src/proc/control/command-closure.hpp +++ b/src/proc/control/command-closure.hpp @@ -91,15 +91,15 @@ namespace proc { namespace control { - using lumiera::typelist::FunctionSignature; - using lumiera::typelist::Tuple; - using lumiera::typelist::BuildTupleAccessor; - using lumiera::typelist::func::TupleApplicator; - using lumiera::typelist::FunErasure; - using lumiera::typelist::StoreFunction; - using lumiera::typelist::NullType; + using lib::meta::FunctionSignature; + using lib::meta::Tuple; + using lib::meta::BuildTupleAccessor; + using lib::meta::func::TupleApplicator; + using lib::meta::FunErasure; + using lib::meta::StoreFunction; + using lib::meta::NullType; - using lumiera::typelist::equals_safeInvoke; + using lib::meta::equals_safeInvoke; using lib::TypedAllocationManager; using util::unConst; using std::tr1::function; diff --git a/src/proc/control/command-def.hpp b/src/proc/control/command-def.hpp index 959d98505..292c8f27c 100644 --- a/src/proc/control/command-def.hpp +++ b/src/proc/control/command-def.hpp @@ -86,12 +86,12 @@ namespace control { using lib::Symbol; using util::cStr; - using lumiera::typelist::FunctionSignature; - using lumiera::typelist::FunctionTypedef; - using lumiera::typelist::Types; - using lumiera::typelist::NullType; - using lumiera::typelist::Tuple; - using lumiera::typelist::tuple::makeNullTuple; + using lib::meta::FunctionSignature; + using lib::meta::FunctionTypedef; + using lib::meta::Types; + using lib::meta::NullType; + using lib::meta::Tuple; + using lib::meta::tuple::makeNullTuple; diff --git a/src/proc/control/command-invocation.hpp b/src/proc/control/command-invocation.hpp index 41e1e521f..fd4ee784a 100644 --- a/src/proc/control/command-invocation.hpp +++ b/src/proc/control/command-invocation.hpp @@ -56,7 +56,7 @@ namespace proc { namespace control { - using namespace lumiera::typelist; + using namespace lib::meta; diff --git a/src/proc/control/command-signature.hpp b/src/proc/control/command-signature.hpp index b756cf0ec..93ac35205 100644 --- a/src/proc/control/command-signature.hpp +++ b/src/proc/control/command-signature.hpp @@ -61,11 +61,11 @@ namespace control { using std::tr1::function; - using lumiera::typelist::FunctionSignature; - using lumiera::typelist::FunctionTypedef; - using lumiera::typelist::Types; - using lumiera::typelist::Append; - using lumiera::typelist::SplitLast; + using lib::meta::FunctionSignature; + using lib::meta::FunctionTypedef; + using lib::meta::Types; + using lib::meta::Append; + using lib::meta::SplitLast; /** diff --git a/src/proc/control/command.hpp b/src/proc/control/command.hpp index aa4c6075b..5ec653634 100644 --- a/src/proc/control/command.hpp +++ b/src/proc/control/command.hpp @@ -74,7 +74,7 @@ namespace control { using std::string; using lib::Symbol; using std::tr1::shared_ptr; - using lumiera::typelist::Tuple; + using lib::meta::Tuple; LUMIERA_ERROR_DECLARE (UNBOUND_ARGUMENTS); ///< Command functor not yet usable, because arguments aren't bound diff --git a/src/proc/control/memento-tie.hpp b/src/proc/control/memento-tie.hpp index 917fa1428..0e89f9b21 100644 --- a/src/proc/control/memento-tie.hpp +++ b/src/proc/control/memento-tie.hpp @@ -57,9 +57,9 @@ namespace proc { namespace control { using boost::equality_comparable; - using lumiera::typelist::func::bindLast; - using lumiera::typelist::func::chained; - using lumiera::typelist::equals_safeInvoke; + using lib::meta::func::bindLast; + using lib::meta::func::chained; + using lib::meta::equals_safeInvoke; LUMIERA_ERROR_DECLARE (MISSING_MEMENTO); ///< Undo functor not yet usable, because no undo state has been captured diff --git a/src/proc/engine/nodeoperation.hpp b/src/proc/engine/nodeoperation.hpp index f6ef36cf9..a715353bf 100644 --- a/src/proc/engine/nodeoperation.hpp +++ b/src/proc/engine/nodeoperation.hpp @@ -83,7 +83,7 @@ namespace config { */ struct OperationBase { - typedef lumiera::Yes_t is_defined; + typedef lib::meta::Yes_t is_defined; BuffHandle getSource (Invocation& ivo, uint chanNo) @@ -277,7 +277,7 @@ namespace config { }; - using lumiera::typelist::Config; + using lib::meta::Config; ///////////////////////TODO: selecting this way isn't especially readable, ///////////////////////////: but BufferProvider selection is going to be solved differently anyway, see Ticket #249 template diff --git a/src/proc/engine/nodewiring-config.hpp b/src/proc/engine/nodewiring-config.hpp index 5a3b7e7e8..aec901789 100644 --- a/src/proc/engine/nodewiring-config.hpp +++ b/src/proc/engine/nodewiring-config.hpp @@ -65,9 +65,9 @@ namespace engine { namespace config { using util::contains; - using lumiera::typelist::FlagInfo; + using lib::meta::FlagInfo; - using lumiera::typelist::CONFIG_FLAGS_MAX; + using lib::meta::CONFIG_FLAGS_MAX; typedef size_t IxID; ///////////////////////////////TICKET #863 diff --git a/src/proc/engine/nodewiring.cpp b/src/proc/engine/nodewiring.cpp index a3a3b01c1..6ffa2b7be 100644 --- a/src/proc/engine/nodewiring.cpp +++ b/src/proc/engine/nodewiring.cpp @@ -34,12 +34,12 @@ namespace engine { namespace config { - using lumiera::typelist::Flags; - using lumiera::typelist::CombineFlags; - using lumiera::typelist::DefineConfigByFlags; - using lumiera::typelist::Instantiation; - using lumiera::typelist::Apply; - using lumiera::typelist::Filter; + using lib::meta::Flags; + using lib::meta::CombineFlags; + using lib::meta::DefineConfigByFlags; + using lib::meta::Instantiation; + using lib::meta::Apply; + using lib::meta::Filter; using lib::AllocationCluster; diff --git a/src/proc/mobject/builder/buildertool.hpp b/src/proc/mobject/builder/buildertool.hpp index 8ba2b6ac3..2f9dc2078 100644 --- a/src/proc/mobject/builder/buildertool.hpp +++ b/src/proc/mobject/builder/buildertool.hpp @@ -94,7 +94,7 @@ namespace mobject { * an instantiation of the "Applicable" template parametrised with all * concrete Buildable classes, for which it wants calls to be dispatched. * \par - * In addition to lumiera::visitor::Tool, BuilderTool adds support for dealing + * In addition to lib::visitor::Tool, BuilderTool adds support for dealing * with objects normally handled by means of smart-pointers or similar * wrappers, most notably mobject::Placement. The visitation is initiated * by calling the stand-alone function \c (BuilderTool& tool, WRA& wrappedTargetObj) , @@ -106,7 +106,7 @@ namespace mobject { * as we simply store a pointer within the BuilderTool instance. */ class BuilderTool - : public lumiera::visitor::Tool + : public lib::visitor::Tool { lumiera::WrapperPtr currentWrapper_; public: @@ -166,11 +166,11 @@ namespace mobject { class TYPELIST // list of all concrete Buildables to be treated > class Applicable - : public lumiera::visitor::Applicable + : public lib::visitor::Applicable { } ; - using lumiera::typelist::Types; // convenience for the users of "Applicable" + using lib::meta::Types; // convenience for the users of "Applicable" }// namespace mobject::builder @@ -181,7 +181,7 @@ namespace mobject { /** * Marker Interface for classes visitable by Builder tools. */ - class Buildable : public lumiera::visitor::Visitable + class Buildable : public lib::visitor::Visitable { }; diff --git a/src/proc/mobject/output-designation.hpp b/src/proc/mobject/output-designation.hpp index 690e2a353..d9b24dc6e 100644 --- a/src/proc/mobject/output-designation.hpp +++ b/src/proc/mobject/output-designation.hpp @@ -35,7 +35,7 @@ extern "C" { namespace proc { namespace mobject { - namespace mp = lumiera::typelist; + namespace mp = lib::meta; class MObject; diff --git a/src/proc/mobject/session/session-service-defaults.hpp b/src/proc/mobject/session/session-service-defaults.hpp index 80457864e..623c0aee8 100644 --- a/src/proc/mobject/session/session-service-defaults.hpp +++ b/src/proc/mobject/session/session-service-defaults.hpp @@ -45,9 +45,9 @@ namespace proc { namespace mobject { namespace session { -// using lumiera::typelist::InstantiateChained; -// using lumiera::typelist::InheritFrom; -// using lumiera::typelist::NullType; +// using lib::meta::InstantiateChained; +// using lib::meta::InheritFrom; +// using lib::meta::NullType; class SessionServiceDefaults diff --git a/src/proc/mobject/session/session-service-fetch.hpp b/src/proc/mobject/session/session-service-fetch.hpp index 93d6cb7c2..004668778 100644 --- a/src/proc/mobject/session/session-service-fetch.hpp +++ b/src/proc/mobject/session/session-service-fetch.hpp @@ -48,9 +48,9 @@ namespace proc { namespace mobject { namespace session { -// using lumiera::typelist::InstantiateChained; -// using lumiera::typelist::InheritFrom; -// using lumiera::typelist::NullType; +// using lib::meta::InstantiateChained; +// using lib::meta::InheritFrom; +// using lib::meta::NullType; /** * Implementation-level service for resolving an Placement-ID. diff --git a/src/proc/mobject/session/session-services.hpp b/src/proc/mobject/session/session-services.hpp index ed95186c1..9545d7bae 100644 --- a/src/proc/mobject/session/session-services.hpp +++ b/src/proc/mobject/session/session-services.hpp @@ -86,8 +86,8 @@ namespace proc { namespace mobject { namespace session { - using lumiera::typelist::InstantiateChained; - using lumiera::typelist::Types; + using lib::meta::InstantiateChained; + using lib::meta::Types; /** diff --git a/tests/components/proc/control/argument-tuple-accept-test.cpp b/tests/components/proc/control/argument-tuple-accept-test.cpp index b31ee44c1..75d80c318 100644 --- a/tests/components/proc/control/argument-tuple-accept-test.cpp +++ b/tests/components/proc/control/argument-tuple-accept-test.cpp @@ -44,8 +44,8 @@ namespace test { using lib::time::TimeVar; using std::tr1::function; - using lumiera::typelist::FunctionSignature; - using lumiera::typelist::Tuple; + using lib::meta::FunctionSignature; + using lib::meta::Tuple; diff --git a/tests/components/proc/control/command-argument-test.cpp b/tests/components/proc/control/command-argument-test.cpp index a4413e7fa..60315ad83 100644 --- a/tests/components/proc/control/command-argument-test.cpp +++ b/tests/components/proc/control/command-argument-test.cpp @@ -57,7 +57,7 @@ namespace test { using lib::test::showSizeof; using lib::test::randTime; - using namespace lumiera::typelist; + using namespace lib::meta; diff --git a/tests/components/proc/control/command-clone-builder-test.cpp b/tests/components/proc/control/command-clone-builder-test.cpp index eabc73a69..18458e830 100644 --- a/tests/components/proc/control/command-clone-builder-test.cpp +++ b/tests/components/proc/control/command-clone-builder-test.cpp @@ -38,7 +38,7 @@ namespace proc { namespace control { namespace test { - using namespace lumiera::typelist; + using namespace lib::meta; typedef lib::P PCmdImpl; diff --git a/tests/components/proc/control/command-equality-test.cpp b/tests/components/proc/control/command-equality-test.cpp index 7d8380d0e..cf60a738e 100644 --- a/tests/components/proc/control/command-equality-test.cpp +++ b/tests/components/proc/control/command-equality-test.cpp @@ -42,7 +42,7 @@ namespace test { - using namespace lumiera::typelist; + using namespace lib::meta; using lib::Symbol; using util::isnil; using util::isSameObject; diff --git a/tests/components/proc/control/command-mutation-test.cpp b/tests/components/proc/control/command-mutation-test.cpp index 6ba6f8867..6d82a684e 100644 --- a/tests/components/proc/control/command-mutation-test.cpp +++ b/tests/components/proc/control/command-mutation-test.cpp @@ -45,7 +45,7 @@ namespace proc { namespace control { namespace test { - using namespace lumiera::typelist; + using namespace lib::meta; using control::CmdClosure; diff --git a/tests/components/proc/control/handling-pattern-standard-impl-test.cpp b/tests/components/proc/control/handling-pattern-standard-impl-test.cpp index eea9a3ccf..356d63be1 100644 --- a/tests/components/proc/control/handling-pattern-standard-impl-test.cpp +++ b/tests/components/proc/control/handling-pattern-standard-impl-test.cpp @@ -72,7 +72,7 @@ namespace test { // using lumiera::P; - //using lumiera::typelist::BuildTupleAccessor; + //using lib::meta::BuildTupleAccessor; // using lumiera::error::LUMIERA_ERROR_EXTERNAL; namespace { // test data and helpers... diff --git a/tests/components/proc/mobject/session/session-service-access-test.cpp b/tests/components/proc/mobject/session/session-service-access-test.cpp index 613d06be3..a96436e8b 100644 --- a/tests/components/proc/mobject/session/session-service-access-test.cpp +++ b/tests/components/proc/mobject/session/session-service-access-test.cpp @@ -46,8 +46,8 @@ namespace test { namespace { // what follows is a simulated (simplified) version // of the complete Session + SessionManager setup..... - using lumiera::typelist::Types; - using lumiera::typelist::InstantiateChained; + using lib::meta::Types; + using lib::meta::InstantiateChained; diff --git a/tests/lib/meta/config-flags-test.cpp b/tests/lib/meta/config-flags-test.cpp index 8d1222e4b..87649556f 100644 --- a/tests/lib/meta/config-flags-test.cpp +++ b/tests/lib/meta/config-flags-test.cpp @@ -55,8 +55,8 @@ using std::cout; using std::endl; -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { namespace test { @@ -335,4 +335,4 @@ cout << "__________________________\n" \ -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/dummy-functions.hpp b/tests/lib/meta/dummy-functions.hpp index 017624a01..37cf23fd9 100644 --- a/tests/lib/meta/dummy-functions.hpp +++ b/tests/lib/meta/dummy-functions.hpp @@ -32,8 +32,8 @@ //using boost::format; -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { namespace test { @@ -56,5 +56,5 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test #endif diff --git a/tests/lib/meta/function-closure-test.cpp b/tests/lib/meta/function-closure-test.cpp index 4d2eb2a06..bc48c07bf 100644 --- a/tests/lib/meta/function-closure-test.cpp +++ b/tests/lib/meta/function-closure-test.cpp @@ -52,9 +52,9 @@ using std::cout; using std::endl; -namespace lumiera { -namespace typelist{ -namespace test { +namespace lib { +namespace meta { +namespace test { namespace { // test data @@ -352,4 +352,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/function-composition-test.cpp b/tests/lib/meta/function-composition-test.cpp index 9761d87b6..38bf82a16 100644 --- a/tests/lib/meta/function-composition-test.cpp +++ b/tests/lib/meta/function-composition-test.cpp @@ -29,9 +29,9 @@ #include "meta/typelist-diagnostics.hpp" -namespace lumiera { -namespace typelist{ -namespace test { +namespace lib { +namespace meta { +namespace test { using ::test::Test; using func::applyFirst; @@ -387,4 +387,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/function-erasure-test.cpp b/tests/lib/meta/function-erasure-test.cpp index b4eefad76..8a3db77cb 100644 --- a/tests/lib/meta/function-erasure-test.cpp +++ b/tests/lib/meta/function-erasure-test.cpp @@ -34,8 +34,8 @@ using lumiera::error::LUMIERA_ERROR_ASSERTION; -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { namespace test { using std::tr1::function; @@ -273,4 +273,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/generator-combinations-test.cpp b/tests/lib/meta/generator-combinations-test.cpp index 4c90b1f93..6a5bbba88 100644 --- a/tests/lib/meta/generator-combinations-test.cpp +++ b/tests/lib/meta/generator-combinations-test.cpp @@ -35,8 +35,8 @@ using std::cout; using std::endl; -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { namespace test { @@ -137,4 +137,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/generator-test.cpp b/tests/lib/meta/generator-test.cpp index 31ca453ab..00a816c22 100644 --- a/tests/lib/meta/generator-test.cpp +++ b/tests/lib/meta/generator-test.cpp @@ -47,8 +47,8 @@ using std::string; using std::cout; -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { namespace test { /** template for generating lots of different test types */ @@ -144,4 +144,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/iterable-classification-test.cpp b/tests/lib/meta/iterable-classification-test.cpp index 9a8a21aa1..1dd45a6b2 100644 --- a/tests/lib/meta/iterable-classification-test.cpp +++ b/tests/lib/meta/iterable-classification-test.cpp @@ -41,9 +41,9 @@ #include -namespace lib { -namespace meta{ -namespace test{ +namespace lib { +namespace meta { +namespace test { using proc::mobject::session::Effect; using proc::mobject::session::ScopeQuery; diff --git a/tests/lib/meta/tuple-diagnostics.hpp b/tests/lib/meta/tuple-diagnostics.hpp index 69a29b6f1..d78eb1ae7 100644 --- a/tests/lib/meta/tuple-diagnostics.hpp +++ b/tests/lib/meta/tuple-diagnostics.hpp @@ -52,9 +52,9 @@ using boost::lexical_cast; using util::unConst; -namespace lumiera { -namespace typelist{ -namespace test { +namespace lib { +namespace meta { +namespace test { namespace { // Diagnostics @@ -189,5 +189,5 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test #endif diff --git a/tests/lib/meta/type-tuple-test.cpp b/tests/lib/meta/type-tuple-test.cpp index aa773b3a2..8589b322a 100644 --- a/tests/lib/meta/type-tuple-test.cpp +++ b/tests/lib/meta/type-tuple-test.cpp @@ -25,7 +25,7 @@ ** Interplay of typelists, type tuples and simple record ** data types build on top of them. ** - ** @see lumiera::typelist::Tuple + ** @see lib::meta::Tuple ** @see tuple.hpp ** @see function-closure.hpp ** @see control::CmdClosure real world usage example @@ -45,8 +45,8 @@ using std::cout; using std::endl; -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { namespace test { @@ -455,4 +455,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/typelist-diagnostics.hpp b/tests/lib/meta/typelist-diagnostics.hpp index 10e64154a..721498c45 100644 --- a/tests/lib/meta/typelist-diagnostics.hpp +++ b/tests/lib/meta/typelist-diagnostics.hpp @@ -52,8 +52,8 @@ using boost::format; using boost::enable_if; -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { /** dummy interface / baseclass for diagnostics */ struct Numz @@ -209,5 +209,5 @@ namespace typelist{ -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test #endif diff --git a/tests/lib/meta/typelist-manip-test.cpp b/tests/lib/meta/typelist-manip-test.cpp index 57f88d1dd..46e3f784b 100644 --- a/tests/lib/meta/typelist-manip-test.cpp +++ b/tests/lib/meta/typelist-manip-test.cpp @@ -50,8 +50,8 @@ using std::cout; using std::endl; -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { namespace test { @@ -377,4 +377,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/typelist-test.cpp b/tests/lib/meta/typelist-test.cpp index 041f8eaf2..80081fe67 100644 --- a/tests/lib/meta/typelist-test.cpp +++ b/tests/lib/meta/typelist-test.cpp @@ -30,8 +30,8 @@ using std::string; using std::cout; -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { namespace test { template @@ -91,4 +91,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/typelist-util-test.cpp b/tests/lib/meta/typelist-util-test.cpp index 22a8c62e8..66a2112c0 100644 --- a/tests/lib/meta/typelist-util-test.cpp +++ b/tests/lib/meta/typelist-util-test.cpp @@ -26,8 +26,8 @@ -namespace lumiera { -namespace typelist{ +namespace lib { +namespace meta { namespace test { @@ -80,4 +80,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/meta/typeseq-manip-test.cpp b/tests/lib/meta/typeseq-manip-test.cpp index 3445d2217..0874eae9f 100644 --- a/tests/lib/meta/typeseq-manip-test.cpp +++ b/tests/lib/meta/typeseq-manip-test.cpp @@ -51,9 +51,9 @@ using std::cout; using std::endl; -namespace lumiera { -namespace typelist{ -namespace test { +namespace lib { +namespace meta { +namespace test { namespace { // test data @@ -183,4 +183,4 @@ namespace test { -}}} // namespace lumiera::typelist::test +}}} // namespace lib::meta::test diff --git a/tests/lib/time/time-control-test.cpp b/tests/lib/time/time-control-test.cpp index f949d49be..f7db3039f 100644 --- a/tests/lib/time/time-control-test.cpp +++ b/tests/lib/time/time-control-test.cpp @@ -54,8 +54,8 @@ namespace test{ using lib::ScopedHolder; using proc::asset::meta::TimeGrid; - using lumiera::typelist::Types; - using lumiera::typelist::InstantiateChainedCombinations; + using lib::meta::Types; + using lib::meta::InstantiateChainedCombinations; using error::LUMIERA_ERROR_UNCONNECTED; @@ -195,7 +195,7 @@ namespace test{ namespace { // Implementation: Matrix of individual test combinations - using lumiera::typelist::is_sameType; + using lib::meta::is_sameType; template inline bool diff --git a/tests/lib/visitingtoolextendedtest.cpp b/tests/lib/visitingtoolextendedtest.cpp index 8021f0241..06d21cba3 100644 --- a/tests/lib/visitingtoolextendedtest.cpp +++ b/tests/lib/visitingtoolextendedtest.cpp @@ -32,198 +32,192 @@ using std::string; using std::cout; -namespace lumiera - { - namespace visitor +namespace lib { +namespace visitor{ +namespace test2 { + + typedef visitor::Tool<> Tool; + + class HomoSapiens : public Visitable<> { - namespace test2 - { - typedef visitor::Tool<> Tool; - - class HomoSapiens : public Visitable<> - { - public: - DEFINE_PROCESSABLE_BY (Tool); - }; - - class Boss : public HomoSapiens - { - public: - DEFINE_PROCESSABLE_BY (Tool); - }; - - class BigBoss : public Boss - { - public: - DEFINE_PROCESSABLE_BY (Tool); - }; + public: + DEFINE_PROCESSABLE_BY (Tool); + }; + + class Boss : public HomoSapiens + { + public: + DEFINE_PROCESSABLE_BY (Tool); + }; + + class BigBoss : public Boss + { + public: + DEFINE_PROCESSABLE_BY (Tool); + }; - - template - class VerboseVisitor - : public BASE + + template + class VerboseVisitor + : public BASE + { + protected: + void talk_to (string guy) { - protected: - void talk_to (string guy) - { - cout << format ("Hello %s, nice to meet you...\n") % guy; - } - }; - - class Babbler - : public Applicable< Babbler, - Types::List, // treat this types - VerboseVisitor // intermediary base class - > - { - public: - void treat (Boss&) { talk_to("Boss"); } - void treat (BigBoss&) { talk_to("Big Boss"); } - }; + cout << format ("Hello %s, nice to meet you...\n") % guy; + } + }; + + class Babbler + : public Applicable< Babbler, + Types::List, // treat this types + VerboseVisitor // intermediary base class + > + { + public: + void treat (Boss&) { talk_to("Boss"); } + void treat (BigBoss&) { talk_to("Big Boss"); } + }; - // the classes above comprise the standard use case, - // what follows covers rather exotic corner cases - - - - /** defines an catch-all-function instead of the silent default error handler */ - template - struct Catched - { - RET onUnknown (HomoSapiens&) { cout << "we-do-everything-for-YOU!\n"; } - }; - - /** defines another different visiting tool base */ - typedef visitor::Tool Hastalavista; - typedef Visitable Chief; ///< another special kind of visitables + // the classes above comprise the standard use case, + // what follows covers rather exotic corner cases + + + + /** defines an catch-all-function instead of the silent default error handler */ + template + struct Catched + { + RET onUnknown (HomoSapiens&) { cout << "we-do-everything-for-YOU!\n"; return RET(); } + }; + + /** defines another different visiting tool base */ + typedef visitor::Tool Hastalavista; + typedef Visitable Chief; ///< another special kind of visitable #define DEFINE_HASTALAVISTA_PROCESSABLE \ - virtual void apply (Hastalavista& tool) \ - { return Chief::dispatchOp (*this, tool); } - - - /** now mixing the two hierarchies... */ - class Leader : public Chief, - public Boss ///< can act as HomoSapiens or as Chief - { - public: - using HomoSapiens::apply; - DEFINE_HASTALAVISTA_PROCESSABLE; - }; - - class Visionary : public Leader - { - DEFINE_HASTALAVISTA_PROCESSABLE; - }; - - /** Hastalavista-Visiting-Tool - * tailored for the Chief hierarchy - */ - class Blatherer - : public Applicable< Blatherer, - Types::List, // get calls to Visionary dispatched - VerboseVisitor // note: different tool base class - > - { - public: - void treat (Leader&) { talk_to("Mr.Future"); } - }; - - - + virtual void apply (Hastalavista& tool) \ + { return Chief::dispatchOp (*this, tool); } + + + /** now mixing the two hierarchies... */ + class Leader : public Chief, + public Boss ///< can act as HomoSapiens or as Chief + { + public: + using HomoSapiens::apply; + DEFINE_HASTALAVISTA_PROCESSABLE; + }; + + class Visionary : public Leader + { + DEFINE_HASTALAVISTA_PROCESSABLE; + }; + + /** Hastalavista-Visiting-Tool + * tailored for the Chief hierarchy + */ + class Blatherer + : public Applicable< Blatherer, + Types::List, // get calls to Visionary dispatched + VerboseVisitor // note: different tool base class + > + { + public: + void treat (Leader&) { talk_to("Mr.Future"); } + }; + + + - - - - /************************************************************************* - * @test more esoteric corner cases of our visitor lib implementation. - * Defines a hierarchy of test classes, which mix two different - * kinds of "visitable" by two disjoint tool base classes. One - * of these base classes uses an explicit error handling - * catch-all-function. - */ - class VisitingToolExtended_test : public Test + + + + /************************************************************************* + * @test more esoteric corner cases of our visitor lib implementation. + * Defines a hierarchy of test classes, which mix two different + * kinds of "visitable" by two disjoint tool base classes. One + * of these base classes uses an explicit error handling + * catch-all-function. + */ + class VisitingToolExtended_test : public Test + { + virtual void run(Arg) { - virtual void run(Arg) - { - known_visitor_known_class(); - visitor_not_visiting_some_class(); - visiting_mixed_hierarchy(); - } + known_visitor_known_class(); + visitor_not_visiting_some_class(); + visiting_mixed_hierarchy(); + } + + void known_visitor_known_class() + { + Boss x1; + BigBoss x2; - void known_visitor_known_class() - { - Boss x1; - BigBoss x2; - - // masquerade as HomoSapiens... - HomoSapiens& homo1 (x1); - HomoSapiens& homo2 (x2); - - cout << "=== Babbler meets Boss and BigBoss ===\n"; - Babbler bab; - homo1.apply (bab); - homo2.apply (bab); - } + // masquerade as HomoSapiens... + HomoSapiens& homo1 (x1); + HomoSapiens& homo2 (x2); - void visitor_not_visiting_some_class() - { - HomoSapiens x1; - Leader x2; - - HomoSapiens& homo1 (x1); - HomoSapiens& homo2 (x2); - - cout << "=== Babbler meets HomoSapiens and Leader ===\n"; - Babbler bab; - homo1.apply (bab); // doesn't visit HomoSapiens - homo2.apply (bab); // treats Leader as Boss - } - - void visiting_mixed_hierarchy() - { - Leader x1; - Visionary x2; - - HomoSapiens& homo1 (x1); - HomoSapiens& homo2 (x2); - Chief& chief1 (x1); - Chief& chief2 (x2); - Leader& lead1 (x1); - Leader& lead2 (x2); - - Blatherer bla; - cout << "=== Blatherer meets Leader and Visionary masqueraded as Chief ===\n"; - chief1.apply (bla); // catch-all, because Blatherer doesn't declare to be applicalbe to Leader - chief2.apply (bla); // treat(Visionary&) resolved to treat(Leader&) as expected - - Babbler bab; - Tool& tool1 (bab); - cout << "=== Babbler masqueraded as Tool meets Leader and Visionary masqueraded as HomoSapiens ===\n"; - homo1.apply (tool1); // because just going through the VTable, the dispatch works as expected - homo2.apply (tool1); // same here (in both cases, the call is resolved to treat(Boss&) as expected) - - cout << "=== Babbler masqueraded as Tool meets Leader and Visionary masqueraded as Leader ===\n"; - lead1.apply (tool1); // nothing happens, because Leader here is treated by his HomoSapiens base - lead2.apply (tool1); // surprisingly the VTable mechanism is choosen here, resulting in an correct dispatch - - // note: the following doesn't compile (an this is a feature, not a bug): - - // "Chief chief" : is abstract, because the Visitable-Template enforces implementing - // the "apply(TOOL&)" function, either directly or via the - // DEFINE_PROCESSABLE_BY macro + cout << "=== Babbler meets Boss and BigBoss ===\n"; + Babbler bab; + homo1.apply (bab); + homo2.apply (bab); + } + + void visitor_not_visiting_some_class() + { + HomoSapiens x1; + Leader x2; + + HomoSapiens& homo1 (x1); + HomoSapiens& homo2 (x2); + + cout << "=== Babbler meets HomoSapiens and Leader ===\n"; + Babbler bab; + homo1.apply (bab); // doesn't visit HomoSapiens + homo2.apply (bab); // treats Leader as Boss + } + + void visiting_mixed_hierarchy() + { + Leader x1; + Visionary x2; + + HomoSapiens& homo1 (x1); + HomoSapiens& homo2 (x2); + Chief& chief1 (x1); + Chief& chief2 (x2); + Leader& lead1 (x1); + Leader& lead2 (x2); + + Blatherer bla; + cout << "=== Blatherer meets Leader and Visionary masqueraded as Chief ===\n"; + chief1.apply (bla); // catch-all, because Blatherer doesn't declare to be applicalbe to Leader + chief2.apply (bla); // treat(Visionary&) resolved to treat(Leader&) as expected + + Babbler bab; + Tool& tool1 (bab); + cout << "=== Babbler masqueraded as Tool meets Leader and Visionary masqueraded as HomoSapiens ===\n"; + homo1.apply (tool1); // because just going through the VTable, the dispatch works as expected + homo2.apply (tool1); // same here (in both cases, the call is resolved to treat(Boss&) as expected) + + cout << "=== Babbler masqueraded as Tool meets Leader and Visionary masqueraded as Leader ===\n"; + lead1.apply (tool1); // nothing happens, because Leader here is treated by his HomoSapiens base + lead2.apply (tool1); // surprisingly the VTable mechanism is choosen here, resulting in an correct dispatch + + // note: the following doesn't compile (an this is a feature, not a bug): + + // "Chief chief" : is abstract, because the Visitable-Template enforces implementing + // the "apply(TOOL&)" function, either directly or via the + // DEFINE_PROCESSABLE_BY macro - } - }; - - - /** Register this test class... */ - LAUNCHER (VisitingToolExtended_test, "unit common"); - - - - } // namespace test - - } // namespace visitor - -} // namespace lumiera + } + }; + + + /** Register this test class... */ + LAUNCHER (VisitingToolExtended_test, "unit common"); + + + +}}} // namespace lib::visitor::test2 diff --git a/tests/lib/visitingtooltest.cpp b/tests/lib/visitingtooltest.cpp index 80a8eee5a..7da240e75 100644 --- a/tests/lib/visitingtooltest.cpp +++ b/tests/lib/visitingtooltest.cpp @@ -32,132 +32,127 @@ using std::string; using std::cout; -namespace lumiera { - namespace visitor { - namespace test1 { +namespace lib { +namespace visitor { +namespace test1 { + + typedef visitor::Tool<> VisitingTool; + + class HomoSapiens : public Visitable<> + { + public: + DEFINE_PROCESSABLE_BY (VisitingTool); + }; + + class Boss : public HomoSapiens + { + public: + DEFINE_PROCESSABLE_BY (VisitingTool); + }; + + class BigBoss : public Boss + { + public: + DEFINE_PROCESSABLE_BY (VisitingTool); + }; + + class Visionary : public Boss + { + DEFINE_PROCESSABLE_BY (VisitingTool); + }; + + class Leader : public Visionary + { + }; + + + + class VerboseVisitor + : public VisitingTool + { + protected: + void talk_to (string guy) + { + cout << format ("Hello %s, nice to meet you...\n") % guy; + } + }; + + class Babbler + : public Applicable< Babbler + , Types::List // dispatch calls to this types + , VerboseVisitor + > + { + public: + void treat (Boss&) { talk_to("Boss"); } + void treat (BigBoss&) { talk_to("Big Boss"); } + }; + + // note the following details: + // - Babbler "forgot" to declare being applicable to HomoSapiens + // - we have new derived class Leader without separate "apply()"-implementation + + + + + /************************************************************************* + * @test our lib implementation of the visitor pattern. + * Defines a hierarchy of test classes to check the following cases + * - calling the correct visiting tool specialised function + * for given concrete hierarchy classes + * - visiting tool not declaring to visit some class + * is silently ignored by default + * - newly added classes will be handled by existing + * functions according to inheritance relations + */ + class VisitingTool_test : public Test + { + virtual void + run (Arg) + { + known_visitor_known_class(); + visiting_extended_hierarchy(); + } - typedef visitor::Tool<> VisitingTool; - - class HomoSapiens : public Visitable<> + void + known_visitor_known_class() { - public: - DEFINE_PROCESSABLE_BY (VisitingTool); - }; - - class Boss : public HomoSapiens - { - public: - DEFINE_PROCESSABLE_BY (VisitingTool); - }; - - class BigBoss : public Boss - { - public: - DEFINE_PROCESSABLE_BY (VisitingTool); - }; - - class Visionary : public Boss - { - DEFINE_PROCESSABLE_BY (VisitingTool); - }; - - class Leader : public Visionary - { - }; - - - - class VerboseVisitor - : public VisitingTool - { - protected: - void talk_to (string guy) - { - cout << format ("Hello %s, nice to meet you...\n") % guy; - } - }; - - class Babbler - : public Applicable< Babbler - , Types::List // dispatch calls to this types - , VerboseVisitor - > - { - public: - void treat (Boss&) { talk_to("Boss"); } - void treat (BigBoss&) { talk_to("Big Boss"); } - }; - - // note the following details: - // - Babbler "forgot" to declare being applicable to HomoSapiens - // - we have new derived class Leader without separate "apply()"-implementation - - - - - /************************************************************************* - * @test our lib implementation of the visitor pattern. - * Defines a hierarchy of test classes to check the following cases - *
  • calling the correct visiting tool specialised function - * for given concrete hierarchy classes
  • - *
  • visiting tool not declaring to visit some class - * is silently ignored by default
  • - *
  • newly added classes will be handled by existing - * functions according to inheritance relations
  • - *
- */ - class VisitingTool_test : public Test - { - virtual void - run (Arg) - { - known_visitor_known_class(); - visiting_extended_hierarchy(); - } + Boss x1; + BigBoss x2; - void - known_visitor_known_class() - { - Boss x1; - BigBoss x2; - - // masquerade as HomoSapiens... - HomoSapiens& homo1 (x1); - HomoSapiens& homo2 (x2); - - cout << "=== Babbler meets Boss and BigBoss ===\n"; - Babbler bab; - VisitingTool& vista (bab); - homo1.apply (vista); - homo2.apply (vista); - } + // masquerade as HomoSapiens... + HomoSapiens& homo1 (x1); + HomoSapiens& homo2 (x2); - void - visiting_extended_hierarchy() - { - HomoSapiens x1; - Leader x2; - - HomoSapiens& homo1 (x1); - HomoSapiens& homo2 (x2); - - cout << "=== Babbler meets HomoSapiens and Leader ===\n"; - Babbler bab; - VisitingTool& vista (bab); - homo1.apply (vista); // silent error handler (not Applicable to HomoSapiens) - homo2.apply (vista); // Leader handled as Visionary and treated as Boss - } - - }; + cout << "=== Babbler meets Boss and BigBoss ===\n"; + Babbler bab; + VisitingTool& vista (bab); + homo1.apply (vista); + homo2.apply (vista); + } - - /** Register this test class... */ - LAUNCHER (VisitingTool_test, "unit common"); - - - - } // namespace test1 - - } // namespace visitor - -} // namespace lumiera + void + visiting_extended_hierarchy() + { + HomoSapiens x1; + Leader x2; + + HomoSapiens& homo1 (x1); + HomoSapiens& homo2 (x2); + + cout << "=== Babbler meets HomoSapiens and Leader ===\n"; + Babbler bab; + VisitingTool& vista (bab); + homo1.apply (vista); // silent error handler (not Applicable to HomoSapiens) + homo2.apply (vista); // Leader handled as Visionary and treated as Boss + } + + }; + + + /** Register this test class... */ + LAUNCHER (VisitingTool_test, "unit common"); + + + +}}} // namespace lib::visitor::test1 From 7fd28e23ebb516a46e87d7a0bd6eab91bab98089 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 3 Dec 2011 03:14:25 +0100 Subject: [PATCH 06/87] cleanup configflags to use uint instead of char using char for those flag template parameters was never a good idea. It won't save us any space and makes debugging harder --- src/lib/meta/configflags.hpp | 44 ++++++++++++------------- src/proc/engine/nodeoperation.hpp | 6 ++-- tests/lib/meta/config-flags-test.cpp | 2 +- tests/lib/meta/typelist-diagnostics.hpp | 27 +++++++-------- 4 files changed, 40 insertions(+), 39 deletions(-) diff --git a/src/lib/meta/configflags.hpp b/src/lib/meta/configflags.hpp index 4e71bfd9e..b80dae229 100644 --- a/src/lib/meta/configflags.hpp +++ b/src/lib/meta/configflags.hpp @@ -58,15 +58,15 @@ namespace meta{ const size_t CONFIG_FLAGS_MAX = 5; - template struct Flag { typedef Flag ID; }; + template struct Flag { typedef Flag ID; }; template<> struct Flag<0> { typedef NullType ID; }; - template< char f1=0 - , char f2=0 - , char f3=0 - , char f4=0 - , char f5=0 + template< uint f1=0 + , uint f2=0 + , uint f3=0 + , uint f4=0 + , uint f5=0 > struct Flags { @@ -81,11 +81,11 @@ namespace meta{ }; - template< char f1=0 - , char f2=0 - , char f3=0 - , char f4=0 - , char f5=0 + template< uint f1=0 + , uint f2=0 + , uint f3=0 + , uint f4=0 + , uint f5=0 > struct Config ///< distinct type representing a configuration { @@ -95,15 +95,15 @@ namespace meta{ - template + template struct ConfigSetFlag; ///< set (prepend) the Flag to the given config - template< char Fl - , char f1 - , char f2 - , char f3 - , char f4 - , char IGN + template< uint Fl + , uint f1 + , uint f2 + , uint f3 + , uint f4 + , uint IGN > struct ConfigSetFlag > { @@ -119,7 +119,7 @@ namespace meta{ typedef CONF Config; typedef Config Type; }; - template + template struct BuildConfigFromFlags< Node,FLAGS>, CONF> { typedef typename ConfigSetFlag< Fl @@ -134,8 +134,8 @@ namespace meta{ namespace { - /** helper comparing enum values and chars (flags) */ - template + /** helper comparing enum values and flags */ + template struct maxC { enum{ VAL = ii < jj? jj : ii }; @@ -157,7 +157,7 @@ namespace meta{ template struct FlagInfo; - template + template struct FlagInfo, FLAGS> > { enum{ BITS = maxC< ff, FlagInfo::BITS> ::VAL diff --git a/src/proc/engine/nodeoperation.hpp b/src/proc/engine/nodeoperation.hpp index a715353bf..7e48b5763 100644 --- a/src/proc/engine/nodeoperation.hpp +++ b/src/proc/engine/nodeoperation.hpp @@ -282,7 +282,7 @@ namespace config { ///////////////////////////: but BufferProvider selection is going to be solved differently anyway, see Ticket #249 template struct SelectBuffProvider { typedef AllocBufferFromParent Type; }; - template + template struct SelectBuffProvider< Config > { typedef AllocBufferFromCache Type; }; @@ -290,7 +290,7 @@ namespace config { struct Strategy ; - template + template struct Strategy< Config > : QueryCache< AllocBufferTable< @@ -302,7 +302,7 @@ namespace config { OperationBase > > > > > > > { }; - template + template struct Strategy< Config > : AllocBufferTable< PullInput< diff --git a/tests/lib/meta/config-flags-test.cpp b/tests/lib/meta/config-flags-test.cpp index 87649556f..9319a4e39 100644 --- a/tests/lib/meta/config-flags-test.cpp +++ b/tests/lib/meta/config-flags-test.cpp @@ -102,7 +102,7 @@ namespace test { template<> struct Maybe : Indeed { enum{ CODE = 10 }; }; template<> struct Maybe : Indeed { enum{ CODE = 30 }; }; - template + template struct Maybe > { typedef Yes_t is_defined; diff --git a/tests/lib/meta/typelist-diagnostics.hpp b/tests/lib/meta/typelist-diagnostics.hpp index 721498c45..d55a84fe2 100644 --- a/tests/lib/meta/typelist-diagnostics.hpp +++ b/tests/lib/meta/typelist-diagnostics.hpp @@ -22,6 +22,7 @@ /** @file typelist-diagnostics.hpp + ** Support for writing metaprogramming unit-tests dealing with typelists and flags. ** a Printer template usable for debugging the structure of a typelist built ** upon some simple debugging-style types. Examples being a Num template, ** or the Flag type. A Printer type generated from this template provides @@ -58,9 +59,9 @@ namespace meta { /** dummy interface / baseclass for diagnostics */ struct Numz { - char o_; - Numz (char x =0) : o_(x) { } - operator char () const { return o_; } + uint o_; + Numz (uint x =0) : o_(x) { } + operator uint () const { return o_; } }; @@ -72,18 +73,18 @@ namespace meta { { enum{ VAL=I }; - Num (char x = char(I)) : Numz(x) { } + Num (uint x = uint(I)) : Numz(x) { } }; /* some forwards used by config-flags-test.cpp */ - template struct Flag; - template< char f1 - , char f2 - , char f3 - , char f4 - , char f5 + template struct Flag; + template< uint f1 + , uint f2 + , uint f3 + , uint f4 + , uint f5 > struct Config; @@ -97,7 +98,7 @@ namespace meta { - namespace test { //< unit tests covering typelist manipulating templates + namespace test { // unit tests covering typelist manipulating templates namespace { // hidden internals for diagnostics.... using boost::format; @@ -129,7 +130,7 @@ namespace meta { static string print () { return str( fmt % uint(Num::VAL) % BASE::print()); } }; - template + template struct Printer, BASE> ///< display the presence of a Flag in the typelist : BASE { @@ -168,7 +169,7 @@ namespace meta { } }; - template + template struct Printer, BASE> : BASE { From 77548e74c6f6161e84d70f129c029b93c9cc1e15 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 3 Dec 2011 03:18:03 +0100 Subject: [PATCH 07/87] document a weakness of boost::hash for strings --- src/proc/asset/entry-id.hpp | 9 ++ tests/40components.tests | 5 + tests/components/proc/asset/entry-id-test.cpp | 15 ++- tests/lib/hash-generator-test.cpp | 113 ++++++++++++++++++ tests/lib/time/quantiser-basics-test.cpp | 2 +- 5 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 tests/lib/hash-generator-test.cpp diff --git a/src/proc/asset/entry-id.hpp b/src/proc/asset/entry-id.hpp index 7667c8ec6..445597fb8 100644 --- a/src/proc/asset/entry-id.hpp +++ b/src/proc/asset/entry-id.hpp @@ -82,12 +82,16 @@ namespace asset { * conjunction with LUID. How to create a LuidH instance, if not generating * a new random value. How to make EntryID and asset::Ident interchangeable, /////////TICKET #739 * which would require both to yield the same hash values.... + * @warning there is a weakness in boost::hash for strings of running numbers, causing + * collisions already for a small set with less than 100000 entries. + * To ameliorate the problem, we hash the symbol twice /////////TICKET #865 * @warning this code isn't portable and breaks if sizeof(size_t) < sizeof(void*) */ inline LuidH buildHash (string const& sym, HashVal seed =0) { boost::hash_combine(seed, sym); + boost::hash_combine(seed, sym); ////////////////////////TICKET #865 lumiera_uid tmpLUID; lumiera_uid_set_ptr (&tmpLUID, reinterpret_cast (seed)); return reinterpret_cast (tmpLUID); @@ -173,6 +177,11 @@ namespace asset { * EntryID template share a common baseclass, usable for type erased common registration. * @todo currently storing the symbolic-ID as string. It should be a lib::Symbol, * but this isn't possible unless we use a symbol table. //////TICKET #158 + * @warning there is a weakness in boost::hash applied to strings. EntryID by default + * generates symbolic IDs from a type prefix plus a running number, which causes + * collisions already with less than 100000 entries. + * @todo As a temporary workaround, we hash the symbolic ID twice, but we should look + * into using a better hash function ////////////TICKET #865 * * @see mobject::session::Track */ diff --git a/tests/40components.tests b/tests/40components.tests index da70c1ce4..9baa7e6b5 100644 --- a/tests/40components.tests +++ b/tests/40components.tests @@ -356,6 +356,11 @@ return: 0 END +TEST "HashGenerator_test" HashGenerator_test < +#include +#include +#include +#include + +using boost::lexical_cast; +using util::contains; +using std::string; +using std::cout; +using std::endl; + + +namespace lib { +namespace test{ + + + + + + /*************************************************************************** + * @test cover various detail aspects regarding hash value generation + * - weakness of boost::hash + * + * @see HashIndexed_test + * @see EntryID_test + */ + class HashGenerator_test : public Test + { + + virtual void + run (Arg) + { + demonstrate_boost_hash_weakness(); + } + + + /** @test demonstrate a serious weakness of boost::hash for strings. + * When hashing just the plain string representation of integers, + * we get collisions already with small numbers below 100000. + * This is counter-intuitive, as the generated hash values + * are 17 digits long and could span much wider scale. + * + * This problem is especially dangerous when storing objects keyed + * by a string-id, which is generated from running numbers. + */ + void + demonstrate_boost_hash_weakness () + { + typedef boost::hash BoostStringHasher; + typedef std::map StringsTable; + + BoostStringHasher hashFunction; + StringsTable hashValues; + string prefix = "Entry."; + uint collisions(0); + for (uint i=0; i<100000; ++i) + { + string candidate = prefix + lexical_cast (i); + size_t hashVal = hashFunction(candidate); + + if (contains (hashValues, hashVal)) + { + ++collisions; + string other = hashValues[hashVal]; + cout << "Duplicate at "<< i << endl; + cout << "existing--->" << other << endl; + cout << "new-------->" << candidate << endl; + + size_t exHash = hashFunction(other); + size_t newHash = hashFunction(candidate); + cout << "hash-ex---->" << exHash << endl; + cout << "hash_new--->" << newHash << endl; + } + hashValues[hashVal] = candidate; + } + CHECK (0 < collisions, "boost::hash for strings is expected to produce collisions"); + } + + }; + + + /** Register this test class... */ + LAUNCHER (HashGenerator_test, "unit common"); + + +}} // namespace lib::test diff --git a/tests/lib/time/quantiser-basics-test.cpp b/tests/lib/time/quantiser-basics-test.cpp index b503e3d29..cca585491 100644 --- a/tests/lib/time/quantiser-basics-test.cpp +++ b/tests/lib/time/quantiser-basics-test.cpp @@ -88,7 +88,7 @@ namespace test{ FixedFrameQuantiser fixQ(25); uint frames = (rand() % MAX_FRAMES); - FSecs dirt = (F25 / (rand() % DIRT_GRAIN)); + FSecs dirt = (F25 / (1 + rand() % DIRT_GRAIN)); Time rawTime (dirt + frames*F25); From 34f2de641fe3db1e419dcaa545695a69415f6fca Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 3 Dec 2011 01:56:30 +0100 Subject: [PATCH 08/87] Remove Debian/Lenny workarounds definitively requiring Squeeze now --- SConstruct | 7 +++---- src/gui/widgets/timecode-widget.cpp | 20 +++++++++----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/SConstruct b/SConstruct index 038958348..7abd1217b 100644 --- a/SConstruct +++ b/SConstruct @@ -1,6 +1,6 @@ # -*- python -*- ## -## SConstruct - SCons based build-sytem for Lumiera +## SConstruct - SCons based build-system for Lumiera ## # Copyright (C) Lumiera.org @@ -52,8 +52,9 @@ installIcon = '#$DESTDIR/share/lumiera/icons' installUIRes = '#$DESTDIR/share/lumiera/' installConf = '#$DESTDIR/lib/lumiera/config' -localDefinitions = locals() #-----------------------------------Configuration +localDefinitions = locals() + @@ -87,8 +88,6 @@ def setupBasicEnvironment(localDefinitions): ) handleVerboseMessages(env) - env.Append ( CCCOM=' -std=gnu99') - env.Append ( SHCCCOM=' -std=gnu99') # workaround for a bug: CCCOM currently doesn't honour CFLAGS, only CCFLAGS env.Replace( CPPPATH =["#src"] # used to find includes, "#" means always absolute to build-root , CPPDEFINES=['LUMIERA_VERSION='+VERSION ] # note: it's a list to append further defines , CCFLAGS='-Wall -Wextra ' diff --git a/src/gui/widgets/timecode-widget.cpp b/src/gui/widgets/timecode-widget.cpp index b46907e76..4fdd9180f 100644 --- a/src/gui/widgets/timecode-widget.cpp +++ b/src/gui/widgets/timecode-widget.cpp @@ -189,8 +189,7 @@ TimeCode::set_widget_name(string name) void TimeCode::setup_events() { - // FIXME: change to set_can_focus(true) once Debian squeeze is released - clock_base.set_flags(CAN_FOCUS); + clock_base.set_can_focus(true); const Gdk::EventMask eventMask = Gdk::BUTTON_PRESS_MASK| @@ -210,15 +209,14 @@ TimeCode::setup_events() ms_seconds_ebox.add_events(eventMask); audio_frames_ebox.add_events(eventMask); - // FIXME: change to set_can_focus(true) once Debian squeeze is released - hours_ebox.set_flags(CAN_FOCUS); - minutes_ebox.set_flags(CAN_FOCUS); - seconds_ebox.set_flags(CAN_FOCUS); - frames_ebox.set_flags(CAN_FOCUS); - audio_frames_ebox.set_flags(CAN_FOCUS); - ms_hours_ebox.set_flags(CAN_FOCUS); - ms_minutes_ebox.set_flags(CAN_FOCUS); - ms_seconds_ebox.set_flags(CAN_FOCUS); + hours_ebox.set_can_focus(true); + minutes_ebox.set_can_focus(true); + seconds_ebox.set_can_focus(true); + frames_ebox.set_can_focus(true); + audio_frames_ebox.set_can_focus(true); + ms_hours_ebox.set_can_focus(true); + ms_minutes_ebox.set_can_focus(true); + ms_seconds_ebox.set_can_focus(true); hours_ebox.signal_motion_notify_event().connect(bind(mem_fun( *this, &TimeCode::field_motion_notify_event), SMPTE_Hours)); From 08d330310fcda376fa44ac7c6264128841bc2394 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 3 Dec 2011 05:46:36 +0100 Subject: [PATCH 09/87] cleanup unnecessary builder function and flags in SCons build --- SConstruct | 11 +++++------ admin/scons/Buildhelper.py | 19 +++++-------------- admin/scons/LumieraEnvironment.py | 10 +++++----- tests/SConscript | 2 +- 4 files changed, 16 insertions(+), 26 deletions(-) diff --git a/SConstruct b/SConstruct index 7abd1217b..4fbfa0b84 100644 --- a/SConstruct +++ b/SConstruct @@ -332,10 +332,10 @@ def defineBuildTargets(env, artifacts): We use a custom function to declare a whole tree of srcfiles. """ - lLib = env.SharedLibrary('lumiera', srcSubtree(env,'src/lib'), install=True) - lApp = env.SharedLibrary('lumieracommon', srcSubtree(env,'src/common'), install=True, LIBS=lLib) - lBack = env.SharedLibrary('lumierabackend', srcSubtree(env,'src/backend'),install=True) - lProc = env.SharedLibrary('lumieraproc', srcSubtree(env,'src/proc'), install=True) + lLib = env.SharedLibrary('lumiera', srcSubtree('src/lib'), install=True) + lApp = env.SharedLibrary('lumieracommon', srcSubtree('src/common'), install=True, LIBS=lLib) + lBack = env.SharedLibrary('lumierabackend', srcSubtree('src/backend'),install=True) + lProc = env.SharedLibrary('lumieraproc', srcSubtree('src/proc'), install=True) core = lLib+lApp+lBack+lProc @@ -363,8 +363,7 @@ def defineBuildTargets(env, artifacts): envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','xext','sm']) envGtk.Append(LIBS=core) - objgui = srcSubtree(envGtk,'src/gui', appendCPP='LUMIERA_PLUGIN') - guimodule = envGtk.LumieraPlugin('gtk_gui', objgui, install=True) + guimodule = envGtk.LumieraPlugin('gtk_gui', srcSubtree('src/gui'), install=True) artifacts['gui'] = ( guimodule + [env.GuiResource(f) for f in env.Glob('src/gui/*.rc')] + artifacts['icons'] diff --git a/admin/scons/Buildhelper.py b/admin/scons/Buildhelper.py index e5d111885..990fa5921 100644 --- a/admin/scons/Buildhelper.py +++ b/admin/scons/Buildhelper.py @@ -49,20 +49,11 @@ def isHelpRequest(): -def srcSubtree(env,tree,isShared=True,builder=None,appendCPP=None, **args): - """ convenience wrapper: scans the given subtree, which is - relative to the current SConscript, find all source files and - declare them as Static or SharedObjects for compilation +def srcSubtree(tree, **args): + """ convenience wrapper: scan the given subtree, which is relative + to the current SConscript, and find all source files. """ - if appendCPP: env.Append(CPPDEFINES=appendCPP) - root = env.subst(tree) # expand Construction Vars - if not builder: - if isShared: - builder = lambda f: env.SharedObject(f, **args) - else: - builder = lambda f: env.Object(f, **args) - - return [builder(f) for f in scanSubtree(root)] + return list(scanSubtree(tree, **args)) @@ -161,7 +152,7 @@ def createPlugins(env, dir, **kw): @return: a list of build nodes defining a plugin for each of these source trees. """ return [env.LumieraPlugin( getDirname(tree) - , srcSubtree(env, tree, appendCPP='LUMIERA_PLUGIN') + , srcSubtree(tree) , **kw ) for tree in findSrcTrees(dir) diff --git a/admin/scons/LumieraEnvironment.py b/admin/scons/LumieraEnvironment.py index c0ce77375..1c314401b 100644 --- a/admin/scons/LumieraEnvironment.py +++ b/admin/scons/LumieraEnvironment.py @@ -205,8 +205,8 @@ def register_LumieraResourceBuilder(env): class WrappedStandardExeBuilder(SCons.Util.Proxy): """ Helper to add customisations and default configurations to SCons standard builders. The original builder object is wrapped and most calls are simply forwarded to this - wrapped object by Python magic. But some calls are intecepted in order to inject - suitalbe default configuration based on the project setup. + wrapped object by Python magic. But some calls are intercepted in order to inject + suitable default configuration based on the project setup. """ def __init__(self, originalBuilder): @@ -291,7 +291,7 @@ class LumieraModuleBuilder(WrappedStandardExeBuilder): explicit spec, falling back on the lib filename """ if 'soname' in kw: - soname = self.subst(kw['soname']) # explicitely defined by user + soname = self.subst(kw['soname']) # explicitly defined by user else: # else: use the library filename as DT_SONAME if SCons.Util.is_String(target): pathname = target.strip() @@ -331,7 +331,7 @@ class LumieraPluginBuilder(LumieraModuleBuilder): def register_LumieraCustomBuilders (lumiEnv): - """ install the customised builder versions tightly integrated with our buildsystem. + """ install the customised builder versions tightly integrated with our build system. Especially, these builders automatically add the build and installation locations and set the RPATH and SONAME in a way to allow a relocatable Lumiera directory structure """ @@ -362,7 +362,7 @@ def register_LumieraCustomBuilders (lumiEnv): action = Action(makeLink, "Install link: $TARGET -> "+srcSpec) env.Command (target,source, action) - # adding SymLink direclty as method on the environment object + # adding SymLink directly as method on the environment object # Probably that should better be a real builder, but I couldn't figure out # how to get the linktext through literally, which is necessary for relative links. # Judging from the sourcecode of SCons.Builder.BuilderBase, there seems to be no way diff --git a/tests/SConscript b/tests/SConscript index dd3584595..abbe86d35 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -29,7 +29,7 @@ def testExecutable(env,tree, exeName=None, obj=None): if obj: obj = [path.join(tree,name) for name in obj] else: - obj = srcSubtree(env,tree, isShared=False) # use all sourcefiles found in subtree + obj = srcSubtree(tree) # use all sourcefiles found in subtree if not exeName: exeName = 'test-%s' % tree return env.Program(exeName, obj + core) From 07002ab3af61138ddcb5aa70e7776f6922c387d2 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 3 Dec 2011 06:10:12 +0100 Subject: [PATCH 10/87] SCons: new build target for experimental code --- SConstruct | 6 +++--- research/DIR_INFO | 1 + research/SConscript | 21 +++++++++++++++++++++ {src/tool => research}/try.cpp | 0 src/tool/SConscript | 1 - 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 research/DIR_INFO create mode 100644 research/SConscript rename {src/tool => research}/try.cpp (100%) diff --git a/SConstruct b/SConstruct index 4fbfa0b84..16c8c3123 100644 --- a/SConstruct +++ b/SConstruct @@ -190,6 +190,7 @@ USAGE: scons [-c] [OPTS] [key=val [key=val...]] [TARGETS] Special Targets: build : just compile and link + research: build experimental code (might fail) testcode: additionally compile the Testsuite check : build and run the Testsuite doc : generate documentation (Doxygen) @@ -370,13 +371,12 @@ def defineBuildTargets(env, artifacts): ) # call subdir SConscript(s) for independent components - SConscript(dirs=['src/tool'], exports='env artifacts core') - SConscript(dirs=['tests'], exports='env artifacts core') + SConscript(dirs=['src/tool','research','tests'], exports='env artifacts core') def definePostBuildTargets(env, artifacts): - """ define further actions after the core build (e.g. Documentaion). + """ define further actions after the core build (e.g. Documentation). define alias targets to trigger the installing. """ build = env.Alias('build', ( artifacts['lumiera'] diff --git a/research/DIR_INFO b/research/DIR_INFO new file mode 100644 index 000000000..59b2583f4 --- /dev/null +++ b/research/DIR_INFO @@ -0,0 +1 @@ +Experiments and Investigations. Not installed diff --git a/research/SConscript b/research/SConscript new file mode 100644 index 000000000..0fef0dae8 --- /dev/null +++ b/research/SConscript @@ -0,0 +1,21 @@ +# -*- python -*- +## +## SConscript - SCons buildscript for experiments and investigations. +## Things defined here usuall won't be installed +## + +Import('env','artifacts','core') + +support_lib = artifacts['support'] + + + +# build additional test and administrative tools.... +experiments = [ env.Program('try', ['try.cpp'] + support_lib) #### to try out some feature... + ] + +# +# define Phony targets +# - 'scons research' triggers building of experimental code +# +env.Alias('research', experiments ) diff --git a/src/tool/try.cpp b/research/try.cpp similarity index 100% rename from src/tool/try.cpp rename to research/try.cpp diff --git a/src/tool/SConscript b/src/tool/SConscript index 583b7032f..49f03addf 100644 --- a/src/tool/SConscript +++ b/src/tool/SConscript @@ -17,7 +17,6 @@ rsvg = envSvg.Program('rsvg-convert','rsvg-convert.c') # build additional test and administrative tools.... artifacts['tools'] = [ env.Program('hello-world','hello.c', install=True) #### hello world (checks C build) - + env.Program('try', ['try.cpp'] + support_lib) #### to try out some feature... + luidgen + rsvg ] From aef3d50ffde789c8dc9cedcf36c46c6e9e5e28fe Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 8 Dec 2011 23:02:19 +0100 Subject: [PATCH 11/87] implement basics of the diagnostic OutputSlot ...specific diagnostic facilities still lacking --- src/lib/multifact.hpp | 4 +- src/proc/engine/buffhandle-attach.hpp | 2 +- .../engine/diagnostic-buffer-provider.hpp | 2 +- .../engine/tracking-heap-block-provider.cpp | 4 +- .../engine/tracking-heap-block-provider.hpp | 2 +- src/proc/play/output-slot-connection.hpp | 8 +- src/proc/play/output-slot.hpp | 2 +- .../proc/play/diagnostic-output-slot.hpp | 100 +++++++++++++++--- .../proc/play/output-slot-protocol-test.cpp | 1 - 9 files changed, 97 insertions(+), 28 deletions(-) diff --git a/src/lib/multifact.hpp b/src/lib/multifact.hpp index b598a198d..29bef6bce 100644 --- a/src/lib/multifact.hpp +++ b/src/lib/multifact.hpp @@ -21,7 +21,7 @@ */ /** @file multifact.hpp - ** Building blocks of a configurable factory, generating families of related objects. + ** Building blocks to create a configurable factory, generating families of related objects. ** Serving the "classical" factory situation: obtaining objects of various kinds, which ** are related somehow (usually through an common interface). The creation of these ** objects is non-trivial while number and exact parametrisation aren't known beforehand @@ -70,7 +70,7 @@ namespace lib { namespace factory { - //////TODO: couldn't these wrappers be extracted into a separate header? + /////////////////////////////////TICKET #470 : couldn't these wrappers be extracted into a separate header? /** * Dummy "wrapper", diff --git a/src/proc/engine/buffhandle-attach.hpp b/src/proc/engine/buffhandle-attach.hpp index aee29c386..f0447bcad 100644 --- a/src/proc/engine/buffhandle-attach.hpp +++ b/src/proc/engine/buffhandle-attach.hpp @@ -25,7 +25,7 @@ ** This extension is mostly helpful for writing unit-tests, and beyond that for the ** rather unusual case where we need to place an full-blown object into the buffer, ** instead of just plain data. A possible use case for this mechanism is to allow for - ** state pre calculation stream, feeding this local state to the individual render node + ** state per calculation stream, feeding this local state to the individual render node ** embedded into a "state frame". Some effect processors indeed need to maintain state ** beyond the single frame (e.g. averaging, integrating, sound compression), which usually ** is handled by applying an "instance" of that processor to the frames to be calculated diff --git a/src/proc/engine/diagnostic-buffer-provider.hpp b/src/proc/engine/diagnostic-buffer-provider.hpp index 8355188b6..9d1f3f303 100644 --- a/src/proc/engine/diagnostic-buffer-provider.hpp +++ b/src/proc/engine/diagnostic-buffer-provider.hpp @@ -21,7 +21,7 @@ */ /** @file diagnostic-buffer-provider.hpp - ** An facility for writing unit-tests targeting the BufferProvider interface. + ** A facility for writing unit-tests targeting the BufferProvider interface. ** ** @see buffer-provider-protocol-test.cpp */ diff --git a/src/proc/engine/tracking-heap-block-provider.cpp b/src/proc/engine/tracking-heap-block-provider.cpp index c9f96aa28..695f5674c 100644 --- a/src/proc/engine/tracking-heap-block-provider.cpp +++ b/src/proc/engine/tracking-heap-block-provider.cpp @@ -309,7 +309,7 @@ namespace engine { TrackingHeapBlockProvider::locateBlock (HashVal typeID, void* storage) { diagn::BlockPool& pool = getBlockPoolFor (typeID); - diagn::Block* block4buffer = pool.find (storage); + diagn::Block* block4buffer = pool.find (storage); ////////////////////////////////TICKET #856 return block4buffer? block4buffer : searchInOutSeqeuence (storage); } @@ -317,7 +317,7 @@ namespace engine { diagn::Block* TrackingHeapBlockProvider::searchInOutSeqeuence (void* blockLocation) { - return pick_Block_by_storage (outSeq_, blockLocation); + return pick_Block_by_storage (outSeq_, blockLocation); ////////////////////////////////TICKET #856 } diff --git a/src/proc/engine/tracking-heap-block-provider.hpp b/src/proc/engine/tracking-heap-block-provider.hpp index d9aa53c26..a6db03431 100644 --- a/src/proc/engine/tracking-heap-block-provider.hpp +++ b/src/proc/engine/tracking-heap-block-provider.hpp @@ -66,7 +66,7 @@ namespace engine { /** - * Helper for a diagnostic BufferProvider: + * Helper for implementing a diagnostic BufferProvider: * A block of heap allocated storage, with the capability * to store some additional tracking information. */ diff --git a/src/proc/play/output-slot-connection.hpp b/src/proc/play/output-slot-connection.hpp index 4ab5bdc8b..e4e9b6787 100644 --- a/src/proc/play/output-slot-connection.hpp +++ b/src/proc/play/output-slot-connection.hpp @@ -52,7 +52,7 @@ #include #include //#include -//#include +#include //#include @@ -66,7 +66,7 @@ namespace play { using lib::transform; using lib::iter_stl::eachElm; -//using std::vector; + using std::vector; //using std::tr1::shared_ptr; using boost::scoped_ptr; @@ -145,7 +145,7 @@ namespace play { : public OutputSlot::ConnectionState , public vector { - + typedef vector Connections; typedef OutputSlot::OpenedSinks OpenedSinks; @@ -161,7 +161,7 @@ namespace play { bool isActive() { - return 0 < vector::size(); + return 0 < Connections::size(); } diff --git a/src/proc/play/output-slot.hpp b/src/proc/play/output-slot.hpp index 095bfb5e1..6fe5b09a2 100644 --- a/src/proc/play/output-slot.hpp +++ b/src/proc/play/output-slot.hpp @@ -82,7 +82,7 @@ namespace play { protected: - /** Table to maintain connection state */ + /** active connections through this OutputSlot */ class ConnectionState; scoped_ptr state_; diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp index e3c45cac1..4023132c2 100644 --- a/tests/components/proc/play/diagnostic-output-slot.hpp +++ b/tests/components/proc/play/diagnostic-output-slot.hpp @@ -37,7 +37,8 @@ #include "proc/play/output-slot-connection.hpp" #include "proc/engine/buffhandle.hpp" #include "proc/engine/tracking-heap-block-provider.hpp" -#include "lib/iter-source.hpp" ////////////TODO really going down that path...? +#include "lib/scoped-ptrvect.hpp" +#include "lib/iter-source.hpp" #include "proc/engine/testframe.hpp" //#include "lib/sync.hpp" @@ -55,6 +56,7 @@ namespace play { using proc::engine::BufferDescriptor; using proc::engine::test::TestFrame; using proc::engine::TrackingHeapBlockProvider; + namespace diagn = proc::engine::diagn; //using std::vector; using std::tr1::shared_ptr; @@ -127,12 +129,34 @@ namespace play { { INFO (engine_dbg, "releasing diagnostic output sequence"); } + + + /* === Diagnostic API === */ + + TestFrame* + accessEmittedFrame (uint frameNo) const + { + REQUIRE (buffProvider_); + if (frameNo <= buffProvider_->emittedCnt()) + return &buffProvider_->accessAs (frameNo); + else + return 0; ////////////////////////////////TICKET #856 + } + + diagn::Block* + accessEmittedBuffer (uint bufferNo) const + { + REQUIRE (buffProvider_); + if (bufferNo <= buffProvider_->emittedCnt()) + return buffProvider_->access_emitted (bufferNo); + else + return 0; + } }; class SimulatedOutputSequences : public ConnectionStateManager - , boost::noncopyable { TrackingInMemoryBlockSequence buildConnection() @@ -162,13 +186,28 @@ namespace play { static const uint MAX_CHANNELS = 5; - /* === hook into the OutputSlot frontend === */ + /** hook into the OutputSlot frontend */ ConnectionState* buildState() { return new SimulatedOutputSequences(MAX_CHANNELS); } + /** @internal is self-managed and non-copyable. + * Clients use #build() to get an instance */ + DiagnosticOutputSlot() { } + + /** @internal access the implementation object + * representing a single stream connection + */ + TrackingInMemoryBlockSequence const& + accessSequence (uint channel) + { + REQUIRE (!isFree(), "diagnostic OutputSlot not (yet) connected"); + REQUIRE (channel <= MAX_CHANNELS); + return static_cast (*state_).at(channel); + } + public: /** build a new Diagnostic Output Slot instance, @@ -177,50 +216,81 @@ namespace play { static OutputSlot& build() { - UNIMPLEMENTED ("Diagnostic Output Slot instance"); + static lib::ScopedPtrVect diagnosticSlots; + return diagnosticSlots.manage(new DiagnosticOutputSlot); } static DiagnosticOutputSlot& access (OutputSlot& to_investigate) { - UNIMPLEMENTED ("access the diagnostics data for the given OutputSlot instance"); + return dynamic_cast (to_investigate); } + /* === diagnostics API === */ /** - * diagnostic facility to verify - * test data frames written to this - * Test/Dummy "output" + * diagnostic facility to verify test data frames + * written to this Test/Dummy "output". It exposes + * the emitted Data as a sequence of TestFrame objects. */ - struct OutputStreamProtocol - : lib::IterSource + class OutputFramesLog + : public lib::IterSource + , boost::noncopyable { - /////////////TODO: implement the extension points required to drive an IterSource + TrackingInMemoryBlockSequence const& outSeq_; + uint currentFrame_; + + + virtual Pos + firstResult () + { + REQUIRE (0 == currentFrame_); + return outSeq_.accessEmittedFrame (currentFrame_); + } + + virtual void + nextResult (Pos& pos) + { + ++currentFrame_; + pos = outSeq_.accessEmittedFrame(currentFrame_); + } + + public: + OutputFramesLog (TrackingInMemoryBlockSequence const& bs) + : outSeq_(bs) + , currentFrame_(0) + { } }; - typedef OutputStreamProtocol::iterator OutFrames; + typedef OutputFramesLog::iterator OutFrames; OutFrames getChannel (uint channel) { - UNIMPLEMENTED ("access output stream tracing entry"); + REQUIRE (channel < MAX_CHANNELS); + return OutputFramesLog::build( + new OutputFramesLog ( + accessSequence(channel))); } bool buffer_was_used (uint channel, FrameID frame) { - UNIMPLEMENTED ("determine if the denoted buffer was indeed used"); + diagn::Block* block = accessSequence(channel) + .accessEmittedBuffer(frame); + return block + && block->was_used(); } bool buffer_unused (uint channel, FrameID frame) { - UNIMPLEMENTED ("determine if the specified buffer was never touched/locked for use"); + return !buffer_was_used(channel, frame); } diff --git a/tests/components/proc/play/output-slot-protocol-test.cpp b/tests/components/proc/play/output-slot-protocol-test.cpp index ac92dd62e..480b664c8 100644 --- a/tests/components/proc/play/output-slot-protocol-test.cpp +++ b/tests/components/proc/play/output-slot-protocol-test.cpp @@ -63,7 +63,6 @@ namespace test { virtual void run (Arg) { - UNIMPLEMENTED ("build a mock output slot and perform a full lifecycle"); verifyStandardCase(); } From e7ae9a30825fd4fd86238db1016f6add31b8d8c9 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 9 Dec 2011 01:00:50 +0100 Subject: [PATCH 12/87] introduce marker time values to designate corner cases --- src/lib/time/lumitime.cpp | 3 +++ src/lib/time/timevalue.hpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/lib/time/lumitime.cpp b/src/lib/time/lumitime.cpp index f80dc9c6e..82de03645 100644 --- a/src/lib/time/lumitime.cpp +++ b/src/lib/time/lumitime.cpp @@ -41,6 +41,9 @@ namespace time { const Time Time::MIN ( TimeValue::buildRaw_(-_raw(Time::MAX) ) ); const Time Time::ZERO; + const Time Time::ANYTIME(Time::MAX); + const Time Time::NEVER (Time::MIN); + const Offset Offset::ZERO (Time::ZERO); diff --git a/src/lib/time/timevalue.hpp b/src/lib/time/timevalue.hpp index 0c8fb2e15..4b429b0ea 100644 --- a/src/lib/time/timevalue.hpp +++ b/src/lib/time/timevalue.hpp @@ -284,6 +284,9 @@ namespace time { static const Time MIN ; static const Time ZERO; + static const Time ANYTIME; ///< border condition marker value. #ANYTIME <= any time value + static const Time NEVER; ///< border condition marker value. #NEVER >= any time value + explicit Time (TimeValue const& val =TimeValue(0)) : TimeValue(val) From 477b443191a3b7616f1b0e7ba85c3657dcc2a3ab Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 9 Dec 2011 01:03:02 +0100 Subject: [PATCH 13/87] implement diagnostic OutputSlot simple frame tracking ...should be enough to run tests against the OutputSlot interface --- src/lib/time/grid.hpp | 2 +- src/proc/asset/meta/time-grid.cpp | 5 +- .../engine/tracking-heap-block-provider.cpp | 2 +- .../proc/play/diagnostic-output-slot.hpp | 90 +++++++++++++++---- 4 files changed, 78 insertions(+), 21 deletions(-) diff --git a/src/lib/time/grid.hpp b/src/lib/time/grid.hpp index 7ace4a12e..fe068b385 100644 --- a/src/lib/time/grid.hpp +++ b/src/lib/time/grid.hpp @@ -46,7 +46,7 @@ namespace time { * grid point, usable for grid aligning values. * * \par usage - * For one there is the lib::time::Quantiser, which directly + * First off, there is the lib::time::Quantiser, which directly * implements this interface and plays a central role when it comes * to converting continuous time into any kind of frame based timecode. * Besides that, the session stores asset::TimeGrid definitions, which diff --git a/src/proc/asset/meta/time-grid.cpp b/src/proc/asset/meta/time-grid.cpp index d37b77866..c46509787 100644 --- a/src/proc/asset/meta/time-grid.cpp +++ b/src/proc/asset/meta/time-grid.cpp @@ -127,6 +127,9 @@ namespace meta { * registered with the AssetManager. * @throw error::Config in case of invalid frames-per-second. The AssetManager * might raise further exception when asset registration fails. + * @note the newly created grid is automatically published through the Advice System. + * This allows client code to pick up that grid definition just by using the + * Grid ID, without requiring an explicit link to the session or Asset subsystem. * @todo currently (12/2010) the AssetManager is unable to detect duplicate assets. * Later on the intention is that in such cases, instead of creating a new grid * we'll silently return the already registered existing and equivalent grid. @@ -137,7 +140,7 @@ namespace meta { if (predecessor_) throw error::Invalid("compound and variable time grids are a planned feature" , error::LUMIERA_ERROR_UNIMPLEMENTED); - ENSURE (fps_, "infinite grid was not properly detected by FrameRate ctor"); + ENSURE (fps_, "infinite grid should have been detected by FrameRate ctor"); if (isnil (id_)) { diff --git a/src/proc/engine/tracking-heap-block-provider.cpp b/src/proc/engine/tracking-heap-block-provider.cpp index 695f5674c..ed056bbce 100644 --- a/src/proc/engine/tracking-heap-block-provider.cpp +++ b/src/proc/engine/tracking-heap-block-provider.cpp @@ -282,7 +282,7 @@ namespace engine { TrackingHeapBlockProvider::access_emitted (uint bufferID) { if (!withinOutputSequence (bufferID)) - return emptyPlaceholder; + return emptyPlaceholder; ////////////////////////////////TICKET #856 else return outSeq_[bufferID]; } diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp index 4023132c2..4a6f758d2 100644 --- a/tests/components/proc/play/diagnostic-output-slot.hpp +++ b/tests/components/proc/play/diagnostic-output-slot.hpp @@ -35,16 +35,20 @@ #include "include/logging.h" #include "proc/play/output-slot.hpp" #include "proc/play/output-slot-connection.hpp" +#include "proc/asset/meta/time-grid.hpp" #include "proc/engine/buffhandle.hpp" #include "proc/engine/tracking-heap-block-provider.hpp" +#include "lib/time/timevalue.hpp" #include "lib/scoped-ptrvect.hpp" #include "lib/iter-source.hpp" +#include "lib/util.hpp" #include "proc/engine/testframe.hpp" //#include "lib/sync.hpp" #include //#include //#include +#include #include //#include @@ -53,6 +57,10 @@ namespace proc { namespace play { //using std::string; + using util::contains; + using lib::time::FrameRate; + using proc::asset::meta::PGrid; + using proc::asset::meta::TimeGrid; using proc::engine::BufferDescriptor; using proc::engine::test::TestFrame; using proc::engine::TrackingHeapBlockProvider; @@ -62,33 +70,61 @@ namespace play { using std::tr1::shared_ptr; //using boost::scoped_ptr; - - + /** + * Diagnostic output connection for a single channel, + * allowing to track generated frames and verify + * the processing protocol for output buffers. + */ class TrackingInMemoryBlockSequence : public OutputSlot::Connection { + typedef std::tr1::unordered_set FrameTrackingInfo; + + shared_ptr buffProvider_; BufferDescriptor bufferType_; + FrameTrackingInfo frameTrackingIndex_; + PGrid frameGrid_; + + + BuffHandle + trackFrame (FrameID frameNr, BuffHandle const& newBuffer) + { + REQUIRE (contains (frameTrackingIndex_,frameNr), + "attempt to lock already used frame %lu", frameNr); + + frameTrackingIndex_.insert (frameNr); + return newBuffer; + } + + TimeValue + deadlineFor (FrameID frameNr) + { + return frameGrid_->timeOf (frameNr); + } + + + /* === Connection API === */ BuffHandle claimBufferFor(FrameID frameNr) { - return buffProvider_->lockBuffer (bufferType_); + return trackFrame (frameNr, + buffProvider_->lockBuffer (bufferType_)); } bool isTimely (FrameID frameNr, TimeValue currentTime) { - if (Time::MAX == currentTime) + if (Time::ANYTIME == currentTime) return true; - UNIMPLEMENTED ("find out about timings"); - return false; + return currentTime < deadlineFor (frameNr); } void @@ -120,6 +156,8 @@ namespace play { TrackingInMemoryBlockSequence() : buffProvider_(new TrackingHeapBlockProvider()) , bufferType_(buffProvider_->getDescriptor()) + , frameTrackingIndex_() + , frameGrid_(TimeGrid::build ("DiagnosticOutputSlot-buffer-grid", FrameRate::PAL)) /////////////TODO should rather pass that in as part of a "timings" definition { INFO (engine_dbg, "building in-memory diagnostic output sequence"); } @@ -134,27 +172,39 @@ namespace play { /* === Diagnostic API === */ TestFrame* - accessEmittedFrame (uint frameNo) const + accessEmittedFrame (uint frameNr) const { REQUIRE (buffProvider_); - if (frameNo <= buffProvider_->emittedCnt()) - return &buffProvider_->accessAs (frameNo); + if (frameNr <= buffProvider_->emittedCnt()) + return &buffProvider_->accessAs (frameNr); else return 0; ////////////////////////////////TICKET #856 } diagn::Block* - accessEmittedBuffer (uint bufferNo) const + accessEmittedBuffer (uint bufferNr) const { REQUIRE (buffProvider_); - if (bufferNo <= buffProvider_->emittedCnt()) - return buffProvider_->access_emitted (bufferNo); + if (bufferNr <= buffProvider_->emittedCnt()) + return & buffProvider_->access_emitted (bufferNr); else return 0; } + + bool + wasAllocated (uint frameNr) const + { + REQUIRE (buffProvider_); + return contains (frameTrackingIndex_, frameNr); + } }; + /** + * Special diagnostic connection state implementation, + * establishing diagnostic output connections for each channel, + * thus allowing to verify the handling of individual buffers + */ class SimulatedOutputSequences : public ConnectionStateManager { @@ -280,10 +330,8 @@ namespace play { bool buffer_was_used (uint channel, FrameID frame) { - diagn::Block* block = accessSequence(channel) - .accessEmittedBuffer(frame); - return block - && block->was_used(); + return accessSequence(channel) + .wasAllocated(frame); } @@ -297,14 +345,20 @@ namespace play { bool buffer_was_closed (uint channel, FrameID frame) { - UNIMPLEMENTED ("determine if the specified buffer was indeed closed properly"); + diagn::Block* block = accessSequence(channel) + .accessEmittedBuffer(frame); + return block + && block->was_closed(); } bool emitted (uint channel, FrameID frame) { - UNIMPLEMENTED ("determine if the specivied buffer was indeed handed over for emitting output"); + diagn::Block* block = accessSequence(channel) + .accessEmittedBuffer(frame); + return block + && block->was_used(); } From 83621450399193fd6d740bbbfaa95e172424519b Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 10 Dec 2011 03:13:45 +0100 Subject: [PATCH 14/87] spelling and comments --- src/lib/polymorphic-value.hpp | 10 +++++----- src/lib/simple-allocator.hpp | 2 +- src/proc/engine/calc-stream.hpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/polymorphic-value.hpp b/src/lib/polymorphic-value.hpp index a9b92bc5e..62db081f1 100644 --- a/src/lib/polymorphic-value.hpp +++ b/src/lib/polymorphic-value.hpp @@ -34,8 +34,8 @@ ** assume the presence of a garbage collector or similar mechanism, ** so 'objects' need just to be mentioned by reference. ** - ** In C++ to employ many of the well known techniques, you're more or less - ** bound to explicitly put the objects somewhere in heap allocated memory + ** In C++, in order to employ many of the well known techniques, we're bound + ** more or less to explicitly put the objects somewhere in heap allocated memory ** and then pass an interface pointer or reference into the actual algorithm. ** Often, this hinders a design based on constant values and small descriptor ** objects used inline, thus forcing into unnecessarily complex and heavyweight @@ -68,7 +68,7 @@ ** Moreover, the PolymorphicValue container provides static builder functions, ** allowing to place a concrete instance of a subclass into the content buffer. ** After construction, the actual type of this instance will be forgotten - ** (``type erasure''), but because the embedded vtable, on access the + ** (``type erasure''), but because of the embedded vtable, on access the ** proper implementation functions will be invoked. ** ** Expanding on that pattern, the copying and cloning operations of the whole @@ -86,7 +86,7 @@ ** the copy or clone operations, we need to do an elaborate re-cast operation, ** first going down to the leaf type and then back up into the mixed in ** management interface. Basically this operation is performed by using - ** an \c dynamic_cast(bufferContents) + ** a \c dynamic_cast(bufferContents) ** - but when the used client types provide some collaboration and implement ** this management interface either directly on the API or as an immediate ** sub-interface, then this copy/management interface is located within the @@ -345,7 +345,7 @@ namespace lib { * - the caller cares for thread safety. No concurrent get calls while in mutation! * * @warning when a create or copy-into operation fails with exception, the whole - * PolymorphicValue object is in undefined state and must not be used further. + * PolymorphicValue object is in undefined state and must not be used henceforth. */ template < class IFA ///< the nominal Base/Interface class for a family of types diff --git a/src/lib/simple-allocator.hpp b/src/lib/simple-allocator.hpp index 8dd5cea25..3f99387d8 100644 --- a/src/lib/simple-allocator.hpp +++ b/src/lib/simple-allocator.hpp @@ -143,7 +143,7 @@ namespace lib { : InstantiateForEach< typename TYPES::List // for each of those types... , CustomAllocator // ...mix in the custom allocator > - , COUNTER + , COUNTER // ...Instantiation accounting policy { /** forward plain memory allocation */ diff --git a/src/proc/engine/calc-stream.hpp b/src/proc/engine/calc-stream.hpp index b9b32c9fc..d1086abcf 100644 --- a/src/proc/engine/calc-stream.hpp +++ b/src/proc/engine/calc-stream.hpp @@ -73,13 +73,13 @@ namespace engine{ CalcStream() { - + UNIMPLEMENTED("build a calculation stream"); } public: CalcStream (CalcStream const& o) { - UNIMPLEMENTED("build a calculation stream"); + UNIMPLEMENTED("clone a calculation stream"); } ~CalcStream() { } From 76b24ce50d3ec160336851875bd5b7085b5e91f2 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 10 Dec 2011 03:18:48 +0100 Subject: [PATCH 15/87] WIP draft the building of a render CalculationStream --- src/proc/play/play-process.cpp | 13 ++-- src/proc/play/play-process.hpp | 13 +++- src/proc/play/play-service.cpp | 8 ++- src/proc/play/render-configurator.cpp | 79 ++++++++++++++++++++++++ src/proc/play/render-configurator.hpp | 87 +++++++++++++++++++++++++++ 5 files changed, 192 insertions(+), 8 deletions(-) create mode 100644 src/proc/play/render-configurator.cpp create mode 100644 src/proc/play/render-configurator.hpp diff --git a/src/proc/play/play-process.cpp b/src/proc/play/play-process.cpp index ca1417659..6a3f2e465 100644 --- a/src/proc/play/play-process.cpp +++ b/src/proc/play/play-process.cpp @@ -1,5 +1,5 @@ /* - PlayProcess.hpp - state frame for an ongoing play/render process + PlayProcess - state frame for an ongoing play/render process Copyright (C) Lumiera.org 2011, Hermann Vosseler @@ -22,6 +22,7 @@ #include "proc/play/play-process.hpp" +#include "proc/play/render-configurator.hpp" #include "lib/itertools.hpp" //#include @@ -57,7 +58,8 @@ namespace play { if (!slot.isFree()) throw error::State("unable to acquire a suitable output slot" /////////////////////TICKET #197 #816 , LUMIERA_ERROR_CANT_PLAY); - return Feed (port,slot); + + return Feed (port,slot); //////////////////////////////////TODO: how to get the RenderConfigurator (strategy) here??? } @@ -110,10 +112,9 @@ namespace play { /** */ - Feed::Feed (ModelPort port, OutputSlot& output) - { - UNIMPLEMENTED("build an active playback/render feed"); - } + Feed::Feed (ModelPort port, OutputSlot& output, RenderConfigurator& renderStrategy) + : renderStreams_(renderStrategy.buildCalculationStreams(port,output)) + { } diff --git a/src/proc/play/play-process.hpp b/src/proc/play/play-process.hpp index 193dc252e..818f0725f 100644 --- a/src/proc/play/play-process.hpp +++ b/src/proc/play/play-process.hpp @@ -83,6 +83,10 @@ namespace play { namespace error = lumiera::error; + /** Strategy for configuring the render process */ + class RenderConfigurator; + + /** * Rendering data feed, corresponding to a single * global pipe and to be delivered into a single OutputSlot. @@ -95,7 +99,14 @@ namespace play { public: typedef lib::IterSource::iterator Connections; - Feed (ModelPort, OutputSlot&); + typedef std::vector RenderStreams; + + RenderStreams renderStreams_; + + /** building a Feed effectively involves the EngineService + * to establish an actual rendering plan. Which is abstracted + * here through the RenderConfigurator instance */ + Feed (ModelPort, OutputSlot&, RenderConfigurator&); }; diff --git a/src/proc/play/play-service.cpp b/src/proc/play/play-service.cpp index aab3306b7..a3932d1c9 100644 --- a/src/proc/play/play-service.cpp +++ b/src/proc/play/play-service.cpp @@ -21,6 +21,8 @@ * *****************************************************/ +#include "lib/error.hpp" +#include "include/play-facade.h" #include "proc/play/play-service.hpp" #include "proc/play/play-process.hpp" #include "lib/util.hpp" @@ -97,6 +99,7 @@ namespace play { void endProcess (PlayProcess* dyingProcess) { + /////////////////////////////////////////////TICKET #867 : somehow ensure sane abort of all attached calculation efforts delete dyingProcess; Lock sync(this); @@ -114,7 +117,10 @@ namespace play { using lumiera::Play; - PlayService::~PlayService() { } + PlayService::~PlayService() + { + UNIMPLEMENTED ("block waiting for any ongoing play processes. Ensure the process table is empty -- OR -- hand it over to some kind of cleanup service"); + } /** bring up the global render- and playback service. diff --git a/src/proc/play/render-configurator.cpp b/src/proc/play/render-configurator.cpp new file mode 100644 index 000000000..ffd091feb --- /dev/null +++ b/src/proc/play/render-configurator.cpp @@ -0,0 +1,79 @@ +/* + RenderConfigurator - strategy to help building an actual render calculation stream + + Copyright (C) Lumiera.org + 2011, Hermann Vosseler + + 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 "proc/play/render-configurator.hpp" +#include "proc/engine/engine-service.hpp" +//#include "lib/itertools.hpp" + +//#include +//#include +//#include +//#include + + + +namespace proc { +namespace play { + +// using std::string; +// using lumiera::Subsys; +// using std::auto_ptr; +// using boost::scoped_ptr; +// using std::tr1::bind; + + + namespace { // Implementation details... + +// using std::tr1::bind; +// using std::tr1::function; +// using std::tr1::placeholders::_1; +// using lib::transform; + + class DefaultRenderProcessBuilder + : public RenderConfigurator + { + + RenderStreams + buildCalculationStreams (ModelPort port, OutputSlot& output) + { + UNIMPLEMENTED("build an active playback/render feed"); + + ///TODO allocate the output slot + ///TODO extract the individual channels + ///TODO get the timings + + engine::EngineService::instance().calculate(port, nominalTimings, activeOutputConnection, serviceQuality); + } + }; + + + } // (End) hidden service impl details + + + + + + /** */ + + +}} // namespace proc::play diff --git a/src/proc/play/render-configurator.hpp b/src/proc/play/render-configurator.hpp new file mode 100644 index 000000000..8811d803f --- /dev/null +++ b/src/proc/play/render-configurator.hpp @@ -0,0 +1,87 @@ +/* + RENDER-CONFIGURATOR.hpp - strategy to help building an actual render calculation stream + + Copyright (C) Lumiera.org + 2011, Hermann Vosseler + + 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. + +*/ + +/** @file render-configurator.hpp + ** Strategy holding all the detail knowledge necessary to establish + ** a running render CalculationStream. + ** + ** @see engine::EngineService + ** @see engine::Feed + ** @see engine::PlayService + */ + + +#ifndef PROC_PLAY_RENDER_CONFIGURATOR_H +#define PROC_PLAY_RENDER_CONFIGURATOR_H + + +#include "lib/error.hpp" +//#include "include/dummy-player-facade.h" +//#include "include/display-facade.h" +//#include "common/instancehandle.hpp" +//#include "lib/singleton-ref.hpp" +#include "proc/mobject/model-port.hpp" +//#include "proc/play/output-manager.hpp" +//#include "lib/iter-source.hpp" +//#include "lib/util.hpp" +// +//#include +//#include +//#include +#include + + +namespace proc { +namespace play { + +// using std::string; +// using lumiera::Subsys; +// using lumiera::Display; +// using lumiera::DummyPlayer; +// using util::isnil; + using proc::mobject::ModelPort; + +// typedef proc::play::POutputManager POutputManager; +// typedef lib::IterSource::iterator ModelPorts; + + namespace error = lumiera::error; + + + /** Strategy for configuring the render process */ + class RenderConfigurator + { + + public: + virtual ~RenderConfigurator(); ///< this is an interface + + + typedef std::vector RenderStreams; ////TODO this belongs rather into class Feed + + virtual RenderStreams buildCalculationStreams (ModelPort, OutputSlot&) =0; + + }; + + + + +}} // namespace proc::play +#endif From bda0dea9903d47b761dc558db79ba42cef7e8bf5 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 17 Dec 2011 02:20:48 +0100 Subject: [PATCH 16/87] clarify the relation of PlayProcess, CalcStream and EngineFacade --- src/include/play-facade.h | 4 +-- src/lib/iter-source.hpp | 4 +-- src/proc/engine/calc-stream.hpp | 4 +-- src/proc/engine/dispatcher.hpp | 2 +- src/proc/play/output-manager.hpp | 2 ++ src/proc/play/play-process.cpp | 3 +- src/proc/play/play-process.hpp | 1 + src/proc/play/play-service.cpp | 38 +++++++++++++++++----- src/proc/play/play-service.hpp | 31 +++++++++++++++--- src/proc/play/render-configurator.cpp | 5 ++- src/proc/play/render-configurator.hpp | 5 ++- wiki/renderengine.html | 47 +++++++++++++++++++-------- 12 files changed, 107 insertions(+), 39 deletions(-) diff --git a/src/include/play-facade.h b/src/include/play-facade.h index c5c2c0f00..480a1d6fd 100644 --- a/src/include/play-facade.h +++ b/src/include/play-facade.h @@ -60,7 +60,7 @@ namespace lumiera { /****************************************************************** - * Interface to the Player subsystem of Lumiera (Proc-Layer). + * Interface to the Player subsystem of Lumiera (Proc-Layer). * Global access point for starting playback and render processes, * calculating media data by running the render engine. * @@ -100,7 +100,7 @@ namespace lumiera { void play(bool); ///< play/pause toggle void scrub(bool); ///< scrubbing playback void adjustSpeed(double); ///< playback speed control - void go(lib::time::Time); ///< skip to the given point in time + void go(time::Time); ///< skip to the given point in time void controlPlayhead (time::Control & ctrl); void controlDuration (time::Control & ctrl); diff --git a/src/lib/iter-source.hpp b/src/lib/iter-source.hpp index 83f55e373..41b56e2c5 100644 --- a/src/lib/iter-source.hpp +++ b/src/lib/iter-source.hpp @@ -339,10 +339,10 @@ namespace lib { /** pipes a given Lumiera Forward Iterator through * a transformation function and wraps the resulting - * transforming Iterator, exposing just a IterSource. + * transforming Iterator, exposing just an IterSource. * This convenience shortcut can be used to build a * processing chain; the resulting IterSource will - * hide any involved detail types. + * hide any detail types involved. * @note as with any IterSource, there is one virtual * function call for every fetched element. */ diff --git a/src/proc/engine/calc-stream.hpp b/src/proc/engine/calc-stream.hpp index d1086abcf..3263ddfd5 100644 --- a/src/proc/engine/calc-stream.hpp +++ b/src/proc/engine/calc-stream.hpp @@ -71,12 +71,12 @@ namespace engine{ friend class EngineService; + public: CalcStream() { - UNIMPLEMENTED("build a calculation stream"); + UNIMPLEMENTED("build a disabled/dead calculation stream"); } - public: CalcStream (CalcStream const& o) { UNIMPLEMENTED("clone a calculation stream"); diff --git a/src/proc/engine/dispatcher.hpp b/src/proc/engine/dispatcher.hpp index 6be0a2634..d96c40e96 100644 --- a/src/proc/engine/dispatcher.hpp +++ b/src/proc/engine/dispatcher.hpp @@ -40,7 +40,7 @@ namespace engine { // class ExitNode; /** - * @todo + * @todo 11/11 extremely fuzzy at the moment */ class Dispatcher { diff --git a/src/proc/play/output-manager.hpp b/src/proc/play/output-manager.hpp index 165c1af2f..696350e1a 100644 --- a/src/proc/play/output-manager.hpp +++ b/src/proc/play/output-manager.hpp @@ -61,6 +61,8 @@ namespace play { /****************************************************** * Management of external Output connections. * + * @todo need a concrete implementation + * @todo need a unit-test * @todo write Type comment */ class OutputManager diff --git a/src/proc/play/play-process.cpp b/src/proc/play/play-process.cpp index 6a3f2e465..01301d102 100644 --- a/src/proc/play/play-process.cpp +++ b/src/proc/play/play-process.cpp @@ -59,7 +59,8 @@ namespace play { throw error::State("unable to acquire a suitable output slot" /////////////////////TICKET #197 #816 , LUMIERA_ERROR_CANT_PLAY); - return Feed (port,slot); //////////////////////////////////TODO: how to get the RenderConfigurator (strategy) here??? + RenderConfigurator& configurator (*(RenderConfigurator*)NULL); //////////////////////////////////TODO: how to get the RenderConfigurator (strategy) here??? + return Feed (port,slot,configurator); } diff --git a/src/proc/play/play-process.hpp b/src/proc/play/play-process.hpp index 818f0725f..80df7a389 100644 --- a/src/proc/play/play-process.hpp +++ b/src/proc/play/play-process.hpp @@ -58,6 +58,7 @@ //#include "lib/singleton-ref.hpp" #include "proc/mobject/model-port.hpp" #include "proc/play/output-manager.hpp" +#include "proc/engine/calc-stream.hpp" #include "lib/iter-source.hpp" #include "lib/util.hpp" // diff --git a/src/proc/play/play-service.cpp b/src/proc/play/play-service.cpp index a3932d1c9..c2265c588 100644 --- a/src/proc/play/play-service.cpp +++ b/src/proc/play/play-service.cpp @@ -25,7 +25,7 @@ #include "include/play-facade.h" #include "proc/play/play-service.hpp" #include "proc/play/play-process.hpp" -#include "lib/util.hpp" +#include "lib/util-foreach.hpp" #include @@ -61,6 +61,7 @@ namespace play { //using std::tr1::function; using std::tr1::placeholders::_1; using util::remove_if; + using util::and_all; namespace { // hidden local details of the service implementation.... @@ -80,6 +81,8 @@ namespace play { typedef weak_ptr Entry; typedef std::vector ProcTable; + /** @note holding just weak references + * to any ongoing playback processes */ ProcTable processes_; public: @@ -88,13 +91,26 @@ namespace play { establishProcess (PlayProcess* newProcess) { lumiera::Play::Controller frontend; + try { + frontend.activate (newProcess, bind (&ProcessTable::endProcess, this, _1 )); + } + catch(...) + { + delete newProcess; + throw; + } Lock sync(this); - frontend.activate (newProcess, bind (&ProcessTable::endProcess, this, _1 )); - processes_.push_back (frontend); + processes_.push_back (frontend); // keeping a weak-reference return frontend; } + bool + isActive() const + { + return ! and_all (processes_, isDead); + } + private: void endProcess (PlayProcess* dyingProcess) @@ -119,7 +135,11 @@ namespace play { PlayService::~PlayService() { - UNIMPLEMENTED ("block waiting for any ongoing play processes. Ensure the process table is empty -- OR -- hand it over to some kind of cleanup service"); + if (pTable_->isActive()) + { + UNIMPLEMENTED ("block waiting for any ongoing play processes. Ensure the process table is empty -- OR -- hand it over to some kind of cleanup service"); + } + ENSURE (!pTable_->isActive()); } @@ -127,7 +147,7 @@ namespace play { * This service allows to create individual PlayProcess instances * to \em perform a timeline or similar model object, creating * rendered data for output. Client code is assumed to access - * this service through the lumiera::Play facade. + * this service through the lumiera::Play facade. */ PlayService::PlayService() : facadeAccess_(*this, "Player") @@ -143,11 +163,11 @@ namespace play { * * Invoking this function investigates the given exit nodes of the * render nodes network and retrieves actual output destinations - * through the given OutputManager. The goal is to configure an + * through the given OutputManager. The goal is to configure an * PlayProcess, based on the renderengine and the collection of * OutputSlot instances retrieved for each of the given exit nodes. * Running this PlayProcess will activate the render engine to deliver - * calculated media data to the outputs. + * calculated media data to the outputs. */ Play::Controller PlayService::connect (ModelPorts dataGenerators, Output outputDestinations) @@ -155,7 +175,7 @@ namespace play { return pTable_->establishProcess( PlayProcess::initiate(dataGenerators, outputDestinations)); } - + LUMIERA_ERROR_DEFINE (CANT_PLAY, "unable to build playback or render process for this configuration"); @@ -195,7 +215,7 @@ namespace lumiera { Play::Controller Play::perform(Viewer) { - UNIMPLEMENTED ("build PlayProcess directly for a Viwer element"); + UNIMPLEMENTED ("build PlayProcess directly for a Viewer element"); } diff --git a/src/proc/play/play-service.hpp b/src/proc/play/play-service.hpp index 9d70e23b6..144e24925 100644 --- a/src/proc/play/play-service.hpp +++ b/src/proc/play/play-service.hpp @@ -21,10 +21,33 @@ */ /** @file play-service.hpp - ** Player subsystem...... - ** - ** @see lumiera::DummyPlayer - ** @see gui::PlaybackController usage example + ** Primary service of the Player subsystem: Starting and controlling render/playback. + ** This is the implementation level service interface for the "Player". Client code + ** should access this service through the lumiera::Play facade interface. + ** + ** The player and render control subsystem allows to start and control playback and + ** rendering at any given collection of model ports (the conceptual exit points + ** of the High-Level-Model). These model ports are the (side effect) result of a + ** build process performed on the High-Level-Model, causing all nominal output + ** designations within the model to be resolved as far as possible. Additionally, + ** for \em playback, the global level of the model (the global pipes of a timeline) + ** need to be connected to a viewer component. This results in a further resolution + ** step, mapping the output designations to the concrete output possibilities of + ** the running Lumiera instance. This mapping information is kept embedded within + ** an OutputManager instance, passed as parameter when invoking the player service. + ** Alternatively, for \em rendering, a similar kind of output mapping information + ** needs to be provided, again embedded within an OutputManager instance, this + ** time leading to an output file to be rendered. + ** + ** The result of an invocation of the Player service is a Play::Controller + ** frontend object. This smart-ptr like handle can be used by the client to + ** control all aspects of playback or rendering; it behaves like a state machine. + ** When the last copy of this Play::Controller frontend goes out of scope, behind + ** the scenes the corresponding PlayProcess gets terminated and prepared for cleanup. + ** + ** @see engine::EngineService + ** @todo WIP-WIP-WIP as of Nov.2011 + ** */ diff --git a/src/proc/play/render-configurator.cpp b/src/proc/play/render-configurator.cpp index ffd091feb..65df04958 100644 --- a/src/proc/play/render-configurator.cpp +++ b/src/proc/play/render-configurator.cpp @@ -53,16 +53,19 @@ namespace play { : public RenderConfigurator { - RenderStreams + Feed::RenderStreams buildCalculationStreams (ModelPort port, OutputSlot& output) { UNIMPLEMENTED("build an active playback/render feed"); +#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #832 ///TODO allocate the output slot ///TODO extract the individual channels ///TODO get the timings + ///TODO define the Quality engine::EngineService::instance().calculate(port, nominalTimings, activeOutputConnection, serviceQuality); +#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #832 } }; diff --git a/src/proc/play/render-configurator.hpp b/src/proc/play/render-configurator.hpp index 8811d803f..4dc94861b 100644 --- a/src/proc/play/render-configurator.hpp +++ b/src/proc/play/render-configurator.hpp @@ -40,6 +40,7 @@ //#include "common/instancehandle.hpp" //#include "lib/singleton-ref.hpp" #include "proc/mobject/model-port.hpp" +#include "proc/play/play-process.hpp" //#include "proc/play/output-manager.hpp" //#include "lib/iter-source.hpp" //#include "lib/util.hpp" @@ -74,9 +75,7 @@ namespace play { virtual ~RenderConfigurator(); ///< this is an interface - typedef std::vector RenderStreams; ////TODO this belongs rather into class Feed - - virtual RenderStreams buildCalculationStreams (ModelPort, OutputSlot&) =0; + virtual Feed::RenderStreams buildCalculationStreams (ModelPort, OutputSlot&) =0; }; diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 848bfeafd..a80120a0d 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -1376,6 +1376,25 @@ at the lowest level within the builder there is the step of building a //connect * by default, a timeline is outfitted with one video and one sound master bus +
+
Calculation stream is an organisational unit used at the interface level of the Lumiera engine.
+Representing a //stream of calculations,// delivering generated data within //timing constraints,// it is used
+*by the [[play process(es)|PlayProcess]] to define and control properties of the output generation
+*at the engine backbone to feed the [[Scheduler]] with individual [[render jobs|RenderJob]] to implement this stream of calculations
+Calculation stream objects are stateless, constant chunks of definition -- any altering of playback or rendering parameters just causes the respective descriptors to be superseeded. The presence of a CalcStream (being alive within the denoted time span) implies that using any of the associated jobs, dispatcher tables, node and wiring descriptors is safe
+
+!lifecycle
+Calculation stream descriptors can be default constructed, representing a //void calculation.// You can't do anything with these.
+Any really interesting calculation stream needs to be retrieved from the EngineFaçade. Additionally, an existing calculation stream can be chained up or superseded, yielding a new CalcStream based on the parameters of the existing one, possibly with some alterations.
+
+!purpose
+When a calculation stream is retrieved from the EngineFaçade it is already registered and attached there and represents an ongoing activity. Under the hood, several further collaborators will hold a copy of that calculation stream descriptor. While, as such, a CalcStream has no explicit state, at any time it //represents a current state.// In case the running time span of that stream is limited, it becomes superseded automatically, just by the passing of time.
+
+Each calculation stream refers a relevant [[frame dispatcher table|FrameDispatcher]]. Thus, for the engine (interface level), the calculation stream allows to produce the individual [[render jobs|RenderJob]] to enqueue with the [[Scheduler]]. This translation step is what links and relates nominal time with running wall clock time, thereby obeying the [[timing constraints|Timings]] given while initially defining the calculation stream.
+
+Additionally, each calculation stream knows how to access a //render environment closure,// allowing to re-schedule and re-adjust the setup of this stream. Basically, this closure is comprised of several functors (callbacks), which could be invoked to perform management tasks later on. Amongst others, this allows the calculation stream to redefine, supersede or "cancel itself", without the need to access a central registration table at the engine interface level.
+
+
Background: #fefefd
 Foreground: #000
@@ -1973,12 +1992,12 @@ The fixture is like a grid, where one dimension is given by the [[model ports|Mo
 :Thus the exit nodes are keyed by ~Pipe-ID as well (and consequently have a distinct [[stream type|StreamType]]) -- each model port coresponds to {{{<number_of_segments>}}} separate exit nodes, but of course an exit node may be //mute.//
 
-
+
Generally speaking, the datastructure to implement the ''Fixture'' (&rarr; see a more general description [[here|Fixture]]) is comprised of a ModelPortRegistry and a set of [[segmentations|Segmentation]] per Timeline.
 This page focusses on the actual data structure and usage details on that level. See also &rarr; [[storage|FixtureStorage]] considerations.
 
 !transactional switch
-A key point to note is the fact that the fixture is frequently [[re-built||BuildFixture]] by the [[Builder]], while render processes may be going on in parallel. Thus, when a build process is finished, a transactional ''commit'' happens to ''hot swap'' the new parts of the model. This is complemented by a clean-up of tainted render processes; finally, storage can be reclaimed.
+A key point to note is the fact that the fixture is frequently [[re-built|BuildFixture]] by the [[Builder]], while render processes may be going on in parallel. Thus, when a build process is finished, a transactional ''commit'' happens to ''hot swap'' the new parts of the model. This is complemented by a clean-up of tainted render processes; finally, storage can be reclaimed.
 
 To support this usage pattern, the Fixture implementation makes use of the [[PImpl pattern|http://c2.com/cgi/wiki?PimplIdiom]]
 
@@ -4386,13 +4405,13 @@ We need a way of addressing existing [[pipes|Pipe]]. Besides, as the Pipes and T
 <<tasksum end>>
 
-
+
With //play process//&nbsp; we denote an ongoing effort to calculate a stream of frames for playback or rendering.
 The play process is an conceptual entity linking together several activities in the [[Backend]] and the RenderEngine. Creating a play process is the central service provided by the [[player subsystem|Player]]: it maintains a registration entry for the process to keep track of associated entities, resources allocated and calls [[dispatched|FrameDispatcher]] as a consequence, and it wires and exposes a PlayController to serve as an interface and information hub.
 
 ''Note'': the player is in no way engaged in any of the actual calculation and management tasks necessary to make this [[stream of calculations|CalcStream]] happen. The play process code contained within the player subsystem is largely comprised of organisational concerns and not especially performance critical.
-* the [[Backend]] is responsible for scheduling and [[dispatching|Dispatcher]] the [[calculation stream|CalcStream]]
-* the RenderEngine has the ability to cary out individual frame calculations
+* the [[Backend]] is responsible for [[dispatching|Dispatcher]] the [[calculation stream|CalcStream]] and scheduling individual calculation jobs
+* the RenderEngine has the ability to carry out individual frame calculations
 * the OutputSlot exposed by the [[output manager|OutputManagement]] is responsible for accepting timed frame delivery
 
 [>img[Anatomy of a Play Process|uml/fig144005.png]]
@@ -4402,7 +4421,7 @@ The Controller is exposed to the client and acts as frontend handle, while the p
 Right within the play process, there is a separation into two realms, relying on different programming paradigms. Obviously the play controller is a state machine, and similarily the body object (play process) has a distinct operation state. Moreover, the current collection of individual objects hooked up at any given instance is a stateful variable. To the contrary, when we enter the realm of actual processing, operations are carried out in parallel, relying on stateless descriptor objects, wired into individual calculation jobs, to be scheduled as non-blocking units of operation. For each series of consecutive frames to be calculated, there is a descriptor object, the CalcStream, which also links to a specificaly tailored dispatcher table, allowing to schedule the individual frame jobs. Whenever the controller determines a change in the playback plan (speed change, skip, scrubbing, looping, ...), a new CalcStream is created, while the existing one is just used to mark any not-yet processed job as superseded.
 
-
+
The [[Player]] is an independent [[Subsystem]] within Lumiera, located at Proc-Layer level. A more precise term would be "rendering and playback coordination subsystem". It provides the capability to generate media data, based on a high-level model object, and send this generated data to an OutputDesignation, creating an continuous and timing controlled output stream. Clients may utilise these functionality through the ''play service'' interface.
 
 !provided services
@@ -4415,7 +4434,7 @@ This is the core service provided by the player subsystem. The purpose is to cre
 ;data producers
 :a set of ModelPort elements to ''pull'' for generating output. They can either be handed in direcly, or resolved from a set of OutputDesignation elements
 ;data sinks
-:to be able to create output, the PlayProcess needs to cooperate with OutputSlot.s
+:to be able to create output, the PlayProcess needs to cooperate with [[output slots|OutputSlot]]
 :physical outputs are never handled directly, rather, the playback or rendering needs an OutputManager to resolve the output designations into output slots
 ;controller
 :when provided with these two prerequisites, the play service is able to build a PlayProcess.
@@ -4425,16 +4444,16 @@ This is the core service provided by the player subsystem. The purpose is to cre
 :any details of this processing remain opaque for the clients; even the player subsystem just accesses the EngineFaçade
 
-
+
Within Lumiera, &raquo;Player&laquo; is the name for a [[Subsystem]] responsible for organising and tracking //ongoing playback and render processes.// &rarr; [[PlayProcess]]
 The player subsystem does not perform or even manage any render operations, nor does it handle the outputs directly.
-Yet it adresses some central concerns:
+Yet it addresses some central concerns:
 
 ;uniformity
 :all playback and render processes are on equal footing, handled in a similar way.
 ;integration
 :the player cares for the necessary integration with the other subsystems
-:it consults the OutputManagement, retrieves the necessary informations from the [[Session]] and coordinates [[Backend]] calls.
+:it consults the OutputManagement, retrieves the necessary informations from the [[Session]] and coordinates the forwarding of [[Backend]] calls.
 ;time quantisation
 :the player translates continuous time values into discrete frame counts.
 :to perform this [[quantisation|TimeQuant]], the help of the session for building a TimeGrid for each output channel is required.
@@ -5132,8 +5151,8 @@ __see also__
 &rarr; the protocol [[how to operate the nodes|NodeOperationProtocol]]
 
-
-
For each segment (of the effective timeline), there is a Processor holding the exit node(s) of a processing network, which is a "Directed Acyclic Graph" of small, preconfigured, stateless [[processing nodes|ProcNode]]. This network is operated according to the ''pull principle'', meaning that the rendering is just initiated by "pulling" output from the exit node, causing a cascade of recursive downcalls or prerequisite calculations to be scheduled as separate jobs. Each node knows its predecessor(s), thus the necessary input can be pulled from there. Consequently, there is no centralized "engine object" which may invoke nodes iteratively or table driven &mdash; rather, the rendering can be seen as a passive service provided for the backend, which may pull from the exit nodes at any time, in any order (?), and possibly multithreaded.
+
+
For each segment (of the effective timeline), there is a Processor holding the exit node(s) of a processing network, which is a "Directed Acyclic Graph" of small, preconfigured, stateless [[processing nodes|ProcNode]]. This network is operated according to the ''pull principle'', meaning that the rendering is just initiated by "pulling" output from the exit node, causing a cascade of recursive downcalls or prerequisite calculations to be scheduled as individual [[jobs|RenderJob]]. Each node knows its predecessor(s), thus the necessary input can be pulled from there. Consequently, there is no centralized "engine object" which may invoke nodes iteratively or table driven &mdash; rather, the rendering can be seen as a passive service provided for the backend, which may pull from the exit nodes at any time, in any order (?), and possibly multithreaded.
 All State necessary for a given calculation process is encapsulated and accessible by a StateProxy object, which can be seen as the representation of "the process". At the same time, this proxy provides the buffers holding data to be processed and acts as a gateway to the backend to handle the communication with the Cache. In addition to this //top-level State,// each calculation step includes a small [[state adapter object|StateAdapter]] (stack allocated), which is pre-configured by the builder and serves the purpose to isolate the processing function from the detals of buffer management.
 
 
@@ -5167,8 +5186,8 @@ Later on we expect a distinct __query subsystem__ to emerge, presumably embeddin
 
 &rarr; QuantiserImpl
-
-
The Scheduler is responsible for geting the individual render jobs to run. The basic idea is that individual render jobs //should never block// -- and thus the calculation of a single frame might be split into several jobs, including resource fetching. This, together with the data exchange protocol defined for the OutputSlot, and the requirements of storage management (especially releasing of superseded render nodes), leads to certain requirements to be ensured by the scheduler:
+
+
The [[Scheduler]] is responsible for geting the individual [[render jobs|RenderJob]] to run. The basic idea is that individual render jobs //should never block// -- and thus the calculation of a single frame might be split into several jobs, including resource fetching. This, together with the data exchange protocol defined for the OutputSlot, and the requirements of storage management (especially releasing of superseded render nodes), leads to certain requirements to be ensured by the scheduler:
 ;ordering of jobs
 :the scheduler has to ensure all prerequisites of a given job are met
 ;job time window

From 6852a6feffc4757dcdc0a6e3e12f7abca0ceef53 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 17 Dec 2011 04:45:42 +0100
Subject: [PATCH 17/87] WIP refactor building of the active render feeds

RenderConfigurator becomes an internal strategy
controlled by the PlayService
---
 src/proc/engine/calc-stream.hpp               |  4 ++
 src/proc/engine/engine-service.cpp            | 18 +++--
 src/proc/engine/engine-service.hpp            |  4 +-
 src/proc/play/output-slot-connection.hpp      |  8 ++-
 src/proc/play/output-slot.hpp                 |  9 +--
 src/proc/play/play-process.cpp                | 47 +++---------
 src/proc/play/play-process.hpp                | 16 ++---
 src/proc/play/play-service.cpp                | 29 ++++++--
 src/proc/play/play-service.hpp                |  6 ++
 src/proc/play/render-configurator.cpp         | 72 +++++++++++++++----
 src/proc/play/render-configurator.hpp         | 31 +++++++-
 src/proc/play/timings.hpp                     |  6 ++
 .../proc/engine/engine-interface-test.cpp     |  2 +-
 13 files changed, 171 insertions(+), 81 deletions(-)

diff --git a/src/proc/engine/calc-stream.hpp b/src/proc/engine/calc-stream.hpp
index 3263ddfd5..9772c1c34 100644
--- a/src/proc/engine/calc-stream.hpp
+++ b/src/proc/engine/calc-stream.hpp
@@ -35,6 +35,7 @@
 //#include 
 //#include 
 //#include 
+#include 
 
 
 namespace proc  {
@@ -86,6 +87,9 @@ namespace engine{
       
     };
   
+  typedef std::vector CalcStreams;
+      
+
   
   
   
diff --git a/src/proc/engine/engine-service.cpp b/src/proc/engine/engine-service.cpp
index a4e989a19..926cef268 100644
--- a/src/proc/engine/engine-service.cpp
+++ b/src/proc/engine/engine-service.cpp
@@ -57,25 +57,33 @@ namespace engine{
   
   
   
-  /** */
-  CalcStream
+  /** core operation: activate the Lumiera Render Engine.
+   * Invoking this service effectively hooks up each channel
+   * of the given model exit point to deliver into the corresponding
+   * output sink on the given OutputConnection (which is assumed
+   * to be already allocated for active use by this connection).
+   * The generated calculation streams represent actively ongoing
+   * calculations within the engine, started right away, according
+   * to the given timing constraints and service quality.
+   */
+  CalcStreams
   EngineService::calculate(ModelPort mPort,
                            Timings nominalTimings,
                            OutputConnection& output,
                            Quality serviceQuality)
   {
-    UNIMPLEMENTED ("build a standard calculation stream");
+    UNIMPLEMENTED ("build a list of standard calculation streams");
   }
   
   
   
   /** */
-  CalcStream
+  CalcStreams
   EngineService::calculateBackground(ModelPort mPort,
                                      Timings nominalTimings,
                                      Quality serviceQuality)
   {
-    UNIMPLEMENTED ("build a calculation stream for background rendering");
+    UNIMPLEMENTED ("build calculation streams for background rendering");
   }
   
   
diff --git a/src/proc/engine/engine-service.hpp b/src/proc/engine/engine-service.hpp
index 7e5c1339b..3c0c1e708 100644
--- a/src/proc/engine/engine-service.hpp
+++ b/src/proc/engine/engine-service.hpp
@@ -138,13 +138,13 @@ namespace engine{
       EngineService();
      ~EngineService() { }
       
-      CalcStream
+      CalcStreams
       calculate(ModelPort mPort,
                 Timings nominalTimings,
                 OutputConnection& output,
                 Quality serviceQuality =QoS_DEFAULT);
       
-      CalcStream
+      CalcStreams
       calculateBackground(ModelPort mPort,
                           Timings nominalTimings,
                           Quality serviceQuality =QoS_BACKGROUND);
diff --git a/src/proc/play/output-slot-connection.hpp b/src/proc/play/output-slot-connection.hpp
index e4e9b6787..2cbd34c4e 100644
--- a/src/proc/play/output-slot-connection.hpp
+++ b/src/proc/play/output-slot-connection.hpp
@@ -158,8 +158,14 @@ namespace play {
           return transform (eachElm(*this), connectOutputSink);
         }
       
+      Timings
+      getTimingConstraints()
+        {
+          UNIMPLEMENTED ("find out about timing constraints");                   //////////////////////////TICKET #831
+        }
+
       bool
-      isActive()
+      isActive()  const
         {
           return 0 < Connections::size();
         }
diff --git a/src/proc/play/output-slot.hpp b/src/proc/play/output-slot.hpp
index 6fe5b09a2..8c7dd9c86 100644
--- a/src/proc/play/output-slot.hpp
+++ b/src/proc/play/output-slot.hpp
@@ -98,12 +98,13 @@ namespace play {
       class Allocation
         {
         public:
-          virtual OpenedSinks getOpenedSinks()  =0;
-          virtual bool isActive()               =0;
+          virtual OpenedSinks getOpenedSinks()   =0;
+          virtual bool isActive()  const         =0;
+          
+          virtual Timings getTimingConstraints() =0;
           
-          /////TODO add here the getters for timing constraints
         protected:
-         ~Allocation();
+         ~Allocation(); ///< never to be managed by clients directly 
         };
       
       /** established output channel */
diff --git a/src/proc/play/play-process.cpp b/src/proc/play/play-process.cpp
index 01301d102..de1a66795 100644
--- a/src/proc/play/play-process.cpp
+++ b/src/proc/play/play-process.cpp
@@ -22,6 +22,7 @@
 
 
 #include "proc/play/play-process.hpp"
+#include "proc/play/play-service.hpp"
 #include "proc/play/render-configurator.hpp"
 #include "lib/itertools.hpp"
 
@@ -40,65 +41,33 @@ namespace play {
 //    using std::auto_ptr;
 //    using boost::scoped_ptr;
 //    using std::tr1::bind;
+  using lib::transform;
   
   
   namespace { // Implementation details...
     
-    using std::tr1::bind;
-    using std::tr1::function;
-    using std::tr1::placeholders::_1;
-    using lib::transform;
-    
-    
-    Feed
-    resolveOutputConnection (ModelPort port, POutputManager outputResolver)
-    {
-      REQUIRE (outputResolver);
-      OutputSlot& slot = outputResolver->getOutputFor (port);
-      if (!slot.isFree())
-        throw error::State("unable to acquire a suitable output slot"   /////////////////////TICKET #197 #816
-                          , LUMIERA_ERROR_CANT_PLAY);
-      
-      RenderConfigurator& configurator (*(RenderConfigurator*)NULL); //////////////////////////////////TODO: how to get the RenderConfigurator (strategy) here??? 
-      return Feed (port,slot,configurator); 
-    }
-    
-    
-    typedef function ConnectFunction;
-    
-    /** try to establish an output slot for the given 
-     *  global bus or data production exit point.
-     * @param outputResolver a facility able to resolve to
-     *        a concrete output slot within the actual context 
-     * @throw error::State when resolution fails 
-     */
-    ConnectFunction
-    resolve (POutputManager outputResolver)
-    {
-      return bind (resolveOutputConnection, _1, outputResolver);
-    }
     
   } // (End) hidden service impl details
   
   
   
   
+  
   /**
    * Factory: Initialise and configure a new PlayProcess.
    * The caller gets to own and manage the returned process entry.
    */
   PlayProcess*
-  PlayProcess::initiate (ModelPorts dataGenerators, POutputManager outputDestinations)
+  PlayProcess::initiate (ModelPorts dataGenerators, RenderConfigurator& activeOutputFeedBuilder)
   {
     return new PlayProcess (transform (dataGenerators,
-                            resolve(outputDestinations)));
-
+                                       activeOutputFeedBuilder));
   }
   
   
   
   /** @internal actually create and configure a play process instance */
-  PlayProcess::PlayProcess (Feed::Connections pipeConnections)
+  PlayProcess::PlayProcess (Connections pipeConnections)
   {
     if (isnil (pipeConnections))
       throw error::State ("creating a PlayProcess without any usable output connections"
@@ -113,8 +82,8 @@ namespace play {
   
   
   /** */
-  Feed::Feed (ModelPort port, OutputSlot& output, RenderConfigurator& renderStrategy)
-    : renderStreams_(renderStrategy.buildCalculationStreams(port,output))
+  Feed::Feed (engine::CalcStreams const& newActiveRenderingConnections)
+    : renderStreams_(newActiveRenderingConnections)
     { }
 
   
diff --git a/src/proc/play/play-process.hpp b/src/proc/play/play-process.hpp
index 80df7a389..532c3c70c 100644
--- a/src/proc/play/play-process.hpp
+++ b/src/proc/play/play-process.hpp
@@ -57,7 +57,6 @@
 //#include "common/instancehandle.hpp"
 //#include "lib/singleton-ref.hpp"
 #include "proc/mobject/model-port.hpp"
-#include "proc/play/output-manager.hpp"
 #include "proc/engine/calc-stream.hpp"
 #include "lib/iter-source.hpp"
 #include "lib/util.hpp"
@@ -78,7 +77,6 @@ namespace play {
   using util::isnil;
   using proc::mobject::ModelPort;
   
-  typedef proc::play::POutputManager POutputManager;
   typedef lib::IterSource::iterator ModelPorts;
   
   namespace error = lumiera::error;
@@ -96,18 +94,14 @@ namespace play {
    */
   class Feed
     {
+      engine::CalcStreams renderStreams_;
       
     public:
-      typedef lib::IterSource::iterator Connections;
-      
-      typedef std::vector RenderStreams;
-      
-      RenderStreams renderStreams_;
       
       /** building a Feed effectively involves the EngineService
        *  to establish an actual rendering plan. Which is abstracted
        *  here through the RenderConfigurator instance */
-      Feed (ModelPort, OutputSlot&, RenderConfigurator&);
+      Feed (engine::CalcStreams const&);
     };
     
   
@@ -132,11 +126,13 @@ namespace play {
     {
       std::vector outputFeeds_;
       
-      PlayProcess (Feed::Connections pipeConnections);
+      typedef lib::IterSource::iterator Connections;
+      
+      PlayProcess (Connections pipeConnections);
       
     public:
       static PlayProcess*
-      initiate (ModelPorts dataGenerators, POutputManager outputDestinations);
+      initiate (ModelPorts dataGenerators, RenderConfigurator&);
     };
   
   
diff --git a/src/proc/play/play-service.cpp b/src/proc/play/play-service.cpp
index c2265c588..b6ae24042 100644
--- a/src/proc/play/play-service.cpp
+++ b/src/proc/play/play-service.cpp
@@ -25,6 +25,7 @@
 #include "include/play-facade.h"
 #include "proc/play/play-service.hpp"
 #include "proc/play/play-process.hpp"
+#include "proc/play/render-configurator.hpp"
 #include "lib/util-foreach.hpp"
 
 
@@ -62,7 +63,7 @@ namespace play {
   using std::tr1::placeholders::_1;
   using util::remove_if;
   using util::and_all;
-  
+
   
   namespace { // hidden local details of the service implementation....
   
@@ -74,6 +75,11 @@ namespace play {
     
   } // (End) hidden service impl details
   
+  using lumiera::Play;
+  
+  typedef POutputManager Output;
+  
+  
   
   class ProcessTable
     : public Sync
@@ -87,10 +93,10 @@ namespace play {
       
     public:
       
-      lumiera::Play::Controller
+      Play::Controller
       establishProcess (PlayProcess* newProcess)
         {
-          lumiera::Play::Controller frontend;
+          Play::Controller frontend;
           try {
               frontend.activate (newProcess, bind (&ProcessTable::endProcess, this, _1 ));
             }
@@ -105,6 +111,7 @@ namespace play {
           return frontend;
         }
       
+      
       bool
       isActive()  const
         {
@@ -130,8 +137,7 @@ namespace play {
     };
   
   
-  using lumiera::Play;
-  
+    
   
   PlayService::~PlayService()
     {
@@ -173,11 +179,22 @@ namespace play {
   PlayService::connect (ModelPorts dataGenerators, Output outputDestinations)
   {
     return pTable_->establishProcess(
-            PlayProcess::initiate(dataGenerators, outputDestinations));
+            PlayProcess::initiate(dataGenerators, 
+                buildRenderConfiguration(outputDestinations)));
   }
   
   
   
+  /** */
+  RenderConfigurator&
+  PlayService::buildRenderConfiguration (Output outputDestinations)
+  {
+    UNIMPLEMENTED ("how to build a suitable render configuration");
+  }
+  
+  
+  
+  
   LUMIERA_ERROR_DEFINE (CANT_PLAY, "unable to build playback or render process for this configuration");
  
 
diff --git a/src/proc/play/play-service.hpp b/src/proc/play/play-service.hpp
index 144e24925..6cc4f9386 100644
--- a/src/proc/play/play-service.hpp
+++ b/src/proc/play/play-service.hpp
@@ -78,6 +78,7 @@ namespace play {
 //  class DummyImageGenerator;
 //  class TickService;
   class ProcessTable;
+  class RenderConfigurator;
   
   
   
@@ -108,6 +109,8 @@ namespace play {
       /** Implementation: build a PlayProcess */
       virtual Controller connect(ModelPorts, Output);
       
+      RenderConfigurator& buildRenderConfiguration(Output);
+      
       
     public:
       PlayService();   /////TODO Subsys::SigTerm terminationHandle);
@@ -117,6 +120,9 @@ namespace play {
     };
   
   
+  LUMIERA_ERROR_DECLARE (CANT_PLAY); ///< unable to build playback or render process for this configuration
+  
+  
   
   
 }} // namespace proc::play
diff --git a/src/proc/play/render-configurator.cpp b/src/proc/play/render-configurator.cpp
index 65df04958..b134de40b 100644
--- a/src/proc/play/render-configurator.cpp
+++ b/src/proc/play/render-configurator.cpp
@@ -21,13 +21,15 @@
 * *****************************************************/
 
 
+#include "lib/error.hpp"
 #include "proc/play/render-configurator.hpp"
+#include "proc/play/output-manager.hpp"
 #include "proc/engine/engine-service.hpp"
 //#include "lib/itertools.hpp"
 
 //#include 
 //#include 
-//#include 
+#include 
 //#include 
 
 
@@ -35,11 +37,36 @@
 namespace proc {
 namespace play {
   
+  namespace error = lumiera::error;
 //    using std::string;
 //    using lumiera::Subsys;
 //    using std::auto_ptr;
 //    using boost::scoped_ptr;
-//    using std::tr1::bind;
+  using std::tr1::bind;
+  using std::tr1::placeholders::_1;
+  using engine::EngineService;
+  
+  typedef EngineService::QoS_Definition RenderQuality;
+  
+  
+  
+  /** Template Method: how to build an active render feed,
+   *  pulling from the given exit point of the model and
+   *  feeding the OutputSlot established appropriately
+   *  to deliver media data of suitable type */
+  Feed
+  RenderConfigurator::buildActiveFeed (ModelPort port)
+  {
+    OutputSlot& slot = getOutputFor (port);
+    return Feed (buildCalculationStreams (port,slot)); 
+  }
+  
+  
+  RenderConfigurator::RenderConfigurator()
+    : function (bind (&RenderConfigurator::buildActiveFeed, this, _1))
+    { }
+  
+  
   
   
   namespace { // Implementation details...
@@ -53,20 +80,41 @@ namespace play {
       : public RenderConfigurator
       {
         
-        Feed::RenderStreams
+        POutputManager outputResolver_;
+        Timings        playbackTimings_;
+        RenderQuality  renderQuality_;
+        
+        
+        OutputSlot&
+        getOutputFor (ModelPort port)
+          {
+            REQUIRE (outputResolver_);
+            OutputSlot& slot = outputResolver_->getOutputFor (port);
+            if (!slot.isFree())
+              throw error::State("unable to acquire a suitable output slot"   /////////////////////TICKET #197 #816
+                                , LUMIERA_ERROR_CANT_PLAY);
+            return slot;
+          }
+        
+        
+        engine::CalcStreams
         buildCalculationStreams (ModelPort port, OutputSlot& output)
           {
-            UNIMPLEMENTED("build an active playback/render feed");
-#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #832
+            OutputSlot::Allocation& activeOutputConnection = output.allocate();
+            Timings nominalTimings = activeOutputConnection.getTimingConstraints()
+                                                           .constrainedBy(playbackTimings_);
             
-            ///TODO allocate the output slot
-            ///TODO extract the individual channels
-            ///TODO get the timings
-            ///TODO define the Quality
-            
-            engine::EngineService::instance().calculate(port, nominalTimings, activeOutputConnection, serviceQuality);
-#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #832
+            return EngineService::instance().calculate(port, nominalTimings, activeOutputConnection, renderQuality_);
           }
+        
+        
+      public:
+        DefaultRenderProcessBuilder(POutputManager outputManager, Timings playbackSpeed)
+          : outputResolver_(outputManager)
+          , playbackTimings_(playbackSpeed)
+          , renderQuality_(EngineService::QoS_DEFAULT)
+          { }
+        
       };
   
     
diff --git a/src/proc/play/render-configurator.hpp b/src/proc/play/render-configurator.hpp
index 4dc94861b..7b9ef6336 100644
--- a/src/proc/play/render-configurator.hpp
+++ b/src/proc/play/render-configurator.hpp
@@ -41,6 +41,8 @@
 //#include "lib/singleton-ref.hpp"
 #include "proc/mobject/model-port.hpp"
 #include "proc/play/play-process.hpp"
+#include "proc/engine/calc-stream.hpp"
+#include "proc/play/output-slot.hpp"
 //#include "proc/play/output-manager.hpp"
 //#include "lib/iter-source.hpp"
 //#include "lib/util.hpp"
@@ -48,6 +50,7 @@
 //#include 
 //#include 
 //#include 
+#include 
 #include 
 
 
@@ -59,6 +62,7 @@ namespace play {
 //    using lumiera::Display;
 //    using lumiera::DummyPlayer;
 //  using util::isnil;
+  using std::tr1::function;
   using proc::mobject::ModelPort;
   
 //  typedef proc::play::POutputManager POutputManager;
@@ -69,13 +73,38 @@ namespace play {
   
   /** Strategy for configuring the render process */
   class RenderConfigurator
+    : public function
     {
       
     public:
       virtual ~RenderConfigurator();  ///< this is an interface
       
+    private:
+      Feed buildActiveFeed (ModelPort);
       
-      virtual Feed::RenderStreams buildCalculationStreams (ModelPort, OutputSlot&)  =0;
+    protected:
+      RenderConfigurator();
+      
+      /** retrieve a suitable output sink for the data
+       *  to be produced at the given model exit point.
+       *  While the port already defines the necessary StreamType,
+       *  this strategy still has to decide what concrete output sink
+       *  to use accordingly.
+       */
+      virtual OutputSlot& getOutputFor (ModelPort port)                             =0;
+      
+      
+      /** build active rendering connections, thereby delivering each channel
+       *  of the given model port into the corresponding output sink.
+       *  This strategy will try to allocate the output slot for output (may fail).
+       *  Moreover, a suitable combination of output timings and service quality
+       *  will be picked
+       * @return List of active CalcStream descriptors, created and registered 
+       *         with the EngineFacade, one for each channel connection.
+       * @note   when this strategy function returns, the corresponding
+       *         render activities are already up and running.
+       */
+      virtual engine::CalcStreams buildCalculationStreams (ModelPort, OutputSlot&)  =0;
       
     };
     
diff --git a/src/proc/play/timings.hpp b/src/proc/play/timings.hpp
index a3613bbf9..5c6963f17 100644
--- a/src/proc/play/timings.hpp
+++ b/src/proc/play/timings.hpp
@@ -81,6 +81,12 @@ namespace play {
     {
     public:
       //////////////TODO accessor functions here
+      
+      Timings
+      constrainedBy (Timings additionalConditions)
+        {
+          UNIMPLEMENTED ("how to combine timing constraints");
+        }
     };
   
   
diff --git a/tests/components/proc/engine/engine-interface-test.cpp b/tests/components/proc/engine/engine-interface-test.cpp
index 3b0e96bd8..0345b0334 100644
--- a/tests/components/proc/engine/engine-interface-test.cpp
+++ b/tests/components/proc/engine/engine-interface-test.cpp
@@ -97,7 +97,7 @@ namespace test  {
           Timings timings; /////////TODO
           
           // Invoke test subject...
-          CalcStream calc = engine.calculate(port, timings, output);
+          CalcStreams calc = engine.calculate(port, timings, output);
           
           ////TODO some direct checks on the calculation stream??
           

From c4bc53b6f6cb689a65363d2386489912be901a80 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 17 Dec 2011 22:37:53 +0100
Subject: [PATCH 18/87] how to pass a render configuration strategy when
 creating a new play process

---
 src/proc/play/play-process.cpp        |  2 +-
 src/proc/play/play-process.hpp        |  6 +++---
 src/proc/play/play-service.cpp        | 15 ++++++-------
 src/proc/play/play-service.hpp        |  4 +---
 src/proc/play/render-configurator.cpp | 31 +++++++++++++++++++++++----
 src/proc/play/render-configurator.hpp | 21 ++++++++++++------
 6 files changed, 53 insertions(+), 26 deletions(-)

diff --git a/src/proc/play/play-process.cpp b/src/proc/play/play-process.cpp
index de1a66795..709b508c4 100644
--- a/src/proc/play/play-process.cpp
+++ b/src/proc/play/play-process.cpp
@@ -58,7 +58,7 @@ namespace play {
    * The caller gets to own and manage the returned process entry.
    */
   PlayProcess*
-  PlayProcess::initiate (ModelPorts dataGenerators, RenderConfigurator& activeOutputFeedBuilder)
+  PlayProcess::initiate (ModelPorts dataGenerators, function activeOutputFeedBuilder)
   {
     return new PlayProcess (transform (dataGenerators,
                                        activeOutputFeedBuilder));
diff --git a/src/proc/play/play-process.hpp b/src/proc/play/play-process.hpp
index 532c3c70c..fdcb68b10 100644
--- a/src/proc/play/play-process.hpp
+++ b/src/proc/play/play-process.hpp
@@ -63,6 +63,7 @@
 //
 #include 
 //#include 
+#include 
 //#include 
 #include 
 
@@ -76,14 +77,13 @@ namespace play {
 //    using lumiera::DummyPlayer;
   using util::isnil;
   using proc::mobject::ModelPort;
+  using std::tr1::function;
   
   typedef lib::IterSource::iterator ModelPorts;
   
   namespace error = lumiera::error;
   
   
-  /** Strategy for configuring the render process */
-  class RenderConfigurator;
   
   
   /**
@@ -132,7 +132,7 @@ namespace play {
       
     public:
       static PlayProcess*
-      initiate (ModelPorts dataGenerators, RenderConfigurator&);
+      initiate (ModelPorts dataGenerators, function);
     };
   
   
diff --git a/src/proc/play/play-service.cpp b/src/proc/play/play-service.cpp
index b6ae24042..5ddb4fe3f 100644
--- a/src/proc/play/play-service.cpp
+++ b/src/proc/play/play-service.cpp
@@ -26,12 +26,13 @@
 #include "proc/play/play-service.hpp"
 #include "proc/play/play-process.hpp"
 #include "proc/play/render-configurator.hpp"
+#include "proc/play/output-manager.hpp"
 #include "lib/util-foreach.hpp"
 
 
 #include 
 //#include 
-//#include 
+////#include 
 #include 
 //#include 
 
@@ -176,22 +177,18 @@ namespace play {
    * calculated media data to the outputs.
    */
   Play::Controller
-  PlayService::connect (ModelPorts dataGenerators, Output outputDestinations)
+  PlayService::connect (ModelPorts dataGenerators, POutputManager outputPossibilities)
   {
+    Timings playbackTimings; /////////////////////////////////////////////////////////////TODO
+    
     return pTable_->establishProcess(
             PlayProcess::initiate(dataGenerators, 
-                buildRenderConfiguration(outputDestinations)));
+                buildRenderConfiguration(outputPossibilities, playbackTimings)));
   }
   
   
   
   /** */
-  RenderConfigurator&
-  PlayService::buildRenderConfiguration (Output outputDestinations)
-  {
-    UNIMPLEMENTED ("how to build a suitable render configuration");
-  }
-  
   
   
   
diff --git a/src/proc/play/play-service.hpp b/src/proc/play/play-service.hpp
index 6cc4f9386..daa494122 100644
--- a/src/proc/play/play-service.hpp
+++ b/src/proc/play/play-service.hpp
@@ -107,9 +107,7 @@ namespace play {
       
       
       /** Implementation: build a PlayProcess */
-      virtual Controller connect(ModelPorts, Output);
-      
-      RenderConfigurator& buildRenderConfiguration(Output);
+      virtual Controller connect(ModelPorts, POutputManager);
       
       
     public:
diff --git a/src/proc/play/render-configurator.cpp b/src/proc/play/render-configurator.cpp
index b134de40b..42fc31a37 100644
--- a/src/proc/play/render-configurator.cpp
+++ b/src/proc/play/render-configurator.cpp
@@ -29,6 +29,7 @@
 
 //#include 
 //#include 
+#include 
 #include 
 //#include 
 
@@ -42,6 +43,7 @@ namespace play {
 //    using lumiera::Subsys;
 //    using std::auto_ptr;
 //    using boost::scoped_ptr;
+  using std::tr1::shared_ptr;
   using std::tr1::bind;
   using std::tr1::placeholders::_1;
   using engine::EngineService;
@@ -49,6 +51,10 @@ namespace play {
   typedef EngineService::QoS_Definition RenderQuality;
   
   
+ 
+  RenderConfigurator::~RenderConfigurator() { } // emit VTable here...
+  
+  
   
   /** Template Method: how to build an active render feed,
    *  pulling from the given exit point of the model and
@@ -62,9 +68,6 @@ namespace play {
   }
   
   
-  RenderConfigurator::RenderConfigurator()
-    : function (bind (&RenderConfigurator::buildActiveFeed, this, _1))
-    { }
   
   
   
@@ -124,7 +127,27 @@ namespace play {
   
   
   
-  /** */
+  /** @internal this builder function is used by the PlayService
+   * when it comes to creating a new PlayProcess. The generated RenderConfigurator
+   * embodies the specific knowledge how to configure and setup the rendering or
+   * playback at the EngineFacade, based on the general playback speed and
+   * quality desirable for this playback process to be initiated.
+   * @remarks building a special subclass here and managing this instance
+   *          by smart-ptr. Then wrapping all of this up into a functor,
+   *          which can thus be passed on by value. This functor will
+   *          later on be used to transform each desired model port
+   *          into a suitable output connection, where the actual
+   *          output will be resolved through the given
+   *          OutputManager
+   */
+  RenderConfigurator::ConnectFunction
+  buildRenderConfiguration (POutputManager outputPossibilities, Timings playbackTimings)
+  {
+    shared_ptr specialConfig (new DefaultRenderProcessBuilder (outputPossibilities, playbackTimings));
+    
+    return bind (&RenderConfigurator::buildActiveFeed, specialConfig, _1 );
+  }
   
+ 
   
 }} // namespace proc::play
diff --git a/src/proc/play/render-configurator.hpp b/src/proc/play/render-configurator.hpp
index 7b9ef6336..44b44f171 100644
--- a/src/proc/play/render-configurator.hpp
+++ b/src/proc/play/render-configurator.hpp
@@ -43,11 +43,11 @@
 #include "proc/play/play-process.hpp"
 #include "proc/engine/calc-stream.hpp"
 #include "proc/play/output-slot.hpp"
-//#include "proc/play/output-manager.hpp"
+#include "proc/play/output-manager.hpp"
 //#include "lib/iter-source.hpp"
 //#include "lib/util.hpp"
 //
-//#include 
+#include 
 //#include 
 //#include 
 #include 
@@ -73,18 +73,17 @@ namespace play {
   
   /** Strategy for configuring the render process */
   class RenderConfigurator
-    : public function
+    : boost::noncopyable
     {
       
     public:
       virtual ~RenderConfigurator();  ///< this is an interface
       
-    private:
       Feed buildActiveFeed (ModelPort);
       
-    protected:
-      RenderConfigurator();
+      typedef function ConnectFunction;
       
+    protected:
       /** retrieve a suitable output sink for the data
        *  to be produced at the given model exit point.
        *  While the port already defines the necessary StreamType,
@@ -107,6 +106,16 @@ namespace play {
       virtual engine::CalcStreams buildCalculationStreams (ModelPort, OutputSlot&)  =0;
       
     };
+  
+  
+  /** Factory function to build a RenderConfigurator
+   *  specifically tailored for a given PlayProcess.
+   * @return the public access point to an RenderConfigurator,
+   *         wrapped as generic function object 
+   */
+  RenderConfigurator::ConnectFunction
+  buildRenderConfiguration (POutputManager outputPossibilities, Timings playbackTimings);
+  
     
   
   

From cedfa3407400bdc3c5ee3117d3178f64a92bb991 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 17 Dec 2011 22:40:01 +0100
Subject: [PATCH 19/87] considerations regarding clean-up of superseded model
 segments

---
 wiki/renderengine.html | 48 +++++++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 22 deletions(-)

diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index a80120a0d..9f4be7f2b 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -1958,7 +1958,7 @@ Some further details
 * a special case of this factory use is the [[Singleton]] factory, which is used a lot within the Proy-Layer code
 
-
+
a specially configured view -- joining together high-level and low-level model.
 The Fixture acts as //isolation layer// between the two models, and as //backbone to attach the render nodes.//
 * all MObjects have their position, length and configuration set up ready for rendering.
@@ -1967,7 +1967,7 @@ The Fixture acts as //isolation layer// between the two models, and as //backbon
 * these ~ExplicitPlacements are contained immediately within the Fixture, ordered by time
 * besides, there is a collection of all effective, possibly externally visible [[model ports|ModelPortRegistry]]
 
-As the builder and thus render engine //only consults the fixture,// while all editing operations finally propagate to the fixture as well, we get an isolation layer between the high level part of the Proc layer (editing, object manipulation) and the render engine. [[Creating the Fixture|BuildFixture]] is an important sideeffect of running the [[Builder]] when createing the [[render engine network|LowLevelModel]].
+As the builder and thus render engine //only consults the fixture,// while all editing operations finally propagate to the fixture as well, we get an isolation layer between the high level part of the Proc layer (editing, object manipulation) and the render engine. [[Creating the Fixture|BuildFixture]] is an important first step and sideeffect of running the [[Builder]] when createing the [[render engine network|LowLevelModel]].
 ''Note'': all of the especially managed storage of the LowLevelModel is hooked up behind the Fixture
 &rarr; FixtureStorage
 &rarr; FixtureDatastructure
@@ -1985,14 +1985,14 @@ The fixture is like a grid, where one dimension is given by the [[model ports|Mo
 ;Segmentation
 :The segmentation partitiones the time axis of a single timeline into segments of constant (wiring) configuration
 :Together, the segments form a seamless sequence of time intervals. They contain a copy of each (explicit) placement of a visible object touching that time interval. Besides that, segments are the top level grouping device of the render engine node graph; they are always built and discarded at once.
-:Segments may be //hot swapped// into an ongoing render.
+:Segments (and even a different Segmentation) may be //hot swapped// into an ongoing render.
 
 ;Exit Nodes
 :Each segment holds an ExitNode for each relevant ModelPort of the corresponding timeline.
 :Thus the exit nodes are keyed by ~Pipe-ID as well (and consequently have a distinct [[stream type|StreamType]]) -- each model port coresponds to {{{<number_of_segments>}}} separate exit nodes, but of course an exit node may be //mute.//
 
-
+
Generally speaking, the datastructure to implement the ''Fixture'' (&rarr; see a more general description [[here|Fixture]]) is comprised of a ModelPortRegistry and a set of [[segmentations|Segmentation]] per Timeline.
 This page focusses on the actual data structure and usage details on that level. See also &rarr; [[storage|FixtureStorage]] considerations.
 
@@ -2009,7 +2009,7 @@ To support this usage pattern, the Fixture implementation makes use of the [[PIm
 ** get or create the frame dispatcher table
 ** dispatch a single frame to yield the corresponding ExitNode
 * (re)building
-** create a new implementation frame
+** create a new implementation transaction
 ** create a new segmentation
 ** establish what segments actually need to be rebuilt
 ** dispatch a newly built segment into the transaction
@@ -2022,7 +2022,7 @@ To support this usage pattern, the Fixture implementation makes use of the [[PIm
 * moreover, this necessitates a tight integration down to implementation level, both with the clean-up and the render processes themselves
 
-
+
The Fixture &rarr; [[data structure|FixtureDatastructure]] acts as umbrella to hook up the elements of the render engine's processing nodes network (LowLevelModel).
 Each segment within the [[Segmentation]] of any timeline serves as ''extent'' or unit of memory management: it is built up completely during the corresponding build process and becomes immutable thereafter, finally to be discarded as a whole when superseded by a modified version of that segment (new build process) -- but only after all related render processes (&rarr; CalcStream) are known to be terminated.
 
@@ -2037,10 +2037,10 @@ Basically the concern is that each new CalcStream had to access the shared count
 ''Note'': {{{shared_ptr}}} is known to be implemented by a lock-free algorithm (yes it is, at least since boost 1.33. Don't believe what numerous FUD spreaders have written). Thus lock contention isn't a problem, but at least a memory barrier is involved (and if I&nbsp;judge GCC's internal documentation right, currently their barriers extend to //all// globally visible variables)
 
 !!question: alternatives?
-There are. As the builder is known to be run again and again, no one forces us to deallocate as soon as we could. That's the classical argument exploited by any garbage collector too. Thus we could just note the fact that a calculation stream is done and re-evaluate all those noted results on later occasion.
+There are. As the builder is known to be run again and again, no one forces us to deallocate as soon as we could. That's the classical argument exploited by any garbage collector too. Thus we could just note the fact that a calculation stream is done and re-evaluate all those noted results on later occasion. Obviously, the [[Scheduler]] is in the best position for notifying the rest of the system when this and that [[job|RenderJob]] has terminated, because the Scheduler is the only facility required to touch each job reliably. Thus it seems favourable to add basic support for either termination callbacks or for guaranteed execution of some notification jobs to the [[Scheduler's requirements|SchedulerRequirements]].
 
 !!exploiting the frame-dispatch step
-Irrespective of the decision in favour or against ref-counting, it seems reasonable to make use of the //frame dispatch step,// which is necessary anyway. The idea is to give each render process (maybe even each CalcStram)  a //copy//&nbsp; of an dispatcher table object -- basically just a list of time breaking points and a pointer to the relevant exit node. If we keep track of those dispatcher tables, add a back-link to identify the process and require the process in turn to deregister, we get a tracking of tainted processes for free.
+Irrespective of the decision in favour or against ref-counting, it seems reasonable to make use of the //frame dispatch step,// which is necessary anyway. The idea is to give each render process (maybe even each CalcStream)  a //copy//&nbsp; of an dispatcher table object -- basically just a list of time breaking points and a pointer to the relevant exit node. If we keep track of those dispatcher tables, add some kind of back-link to identify the process and require the process in turn to deregister, we get a tracking of tainted processes for free.
 
 !!assessment {{red{WIP 12/10}}}
 But the primary question here is to judge the impact of such an implementation. What would be the costs?
@@ -2059,22 +2059,22 @@ But the primary question here is to judge the impact of such an implementation.
 &rArr; we should spend a second thought about how actually to find and process the segments to be discarded
 
 !!!identifying tainted and disposable segments
-Above estimation hints at the necessity of frequently finding some 30 to 100 segments to be disposed, out of thousands, assumed the original reason for triggering the build process was a typically local change in the high-level model. We can only discard when all related processes are finished, but there is a larger number of segments as candidate for eviction. These candidates are rather easy to pinpoint -- they will be uncovered during a linear comparison pass prior to commiting the changed Fixture. Usually, the number of candidates will be low (localised changes), but global manipulations might invalidate thousands of segments.
+Above estimation hints at the necessity of frequently finding some 30 to 100 segments to be disposed, out of thousands, assumed the original reason for triggering the build process was a typically local change in the high-level model. We can only discard when all related processes are finished, but there is a larger number of segments as candidate for eviction. These candidates are rather easy to pinpoint -- they will be uncovered during a linear comparison pass prior to committing the changed Fixture. Usually, the number of candidates will be low (localised changes), but global manipulations might invalidate thousands of segments.
 * if we frequently pick the segments actually to be disposed, there is the danger of performance degeneration when the number of segments is high
 * the other question is if we can afford just to keep all of those candidates around, as all of them are bound to get discardable eventually
 * and of course there is also the question how to detect //when// they're due.
 
 ;Model A
-:use a logarithmic datastructure, e.g. a priority queue
-:problem here is that the priorities change, which either means shared access or a lot of "superseeded" entries
+:use a logarithmic datastructure, e.g. a priority queue. Possibly together with LRU ordering
+:problem here is that the priorities change, which either means shared access or a lot of "superseded" entries
 ;Model B
-:keep all candidates around and track the tainted processes instead
+:keep all superseded segments around and track the tainted processes instead
 :problem here is how to get the tainted processes precisely and with low overhead
 //currently {{red{12/10}}} I tend to prefer Model B...// while the priority queue remains to be investigated in more detail for organising the actual build process.
 But actually I'm struck here, because of the yet limited knowledge about those render processes....
 * how do we //join// an aborted/changed rendering process to his successor, without creating a jerk in the output?
-* is it even possible to continue a process when parts of the covered timerange are affected by a build?
-If the latter question is answered with "No!", then the problem gets simple in solution, but maybe memory consuming: In that case, //all//&nbsp; processes linked to a timeline gets affected and thus tainted; we'd just dump them onto a pile and delay releasing all of the superseeded segments until all of them are known to be terminated.
+* is it even possible to continue a process when parts of the covered time-range are affected by a build?
+If the latter question is answered with "No!", then the problem gets simple in solution, but maybe memory consuming: In that case, //all//&nbsp; processes linked to a timeline gets affected and thus tainted; we'd just dump them onto a pile and delay releasing all of the superseded segments until all of them are known to be terminated.
 
@@ -5186,8 +5186,8 @@ Later on we expect a distinct __query subsystem__ to emerge, presumably embeddin &rarr; QuantiserImpl
-
-
The [[Scheduler]] is responsible for geting the individual [[render jobs|RenderJob]] to run. The basic idea is that individual render jobs //should never block// -- and thus the calculation of a single frame might be split into several jobs, including resource fetching. This, together with the data exchange protocol defined for the OutputSlot, and the requirements of storage management (especially releasing of superseded render nodes), leads to certain requirements to be ensured by the scheduler:
+
+
The [[Scheduler]] is responsible for geting the individual [[render jobs|RenderJob]] to run. The basic idea is that individual render jobs //should never block// -- and thus the calculation of a single frame might be split into several jobs, including resource fetching. This, together with the data exchange protocol defined for the OutputSlot, and the requirements of storage management (especially releasing of superseded render nodes &rarr; FixtureStorage), leads to certain requirements to be ensured by the scheduler:
 ;ordering of jobs
 :the scheduler has to ensure all prerequisites of a given job are met
 ;job time window
@@ -5195,7 +5195,11 @@ Later on we expect a distinct __query subsystem__ to emerge, presumably embeddin
 ;failure propagation
 :when a job fails, either due to an job internal error, or by timing glitch, any dependent jobs need to receive that failure state
 ;guaranteed execution
-:some jobs are marked as "ensure run". These need to run reliable, even when prerequisite jobs fail -- and this failure state needs to be propagated
+:some jobs are marked as "ensure run". These need to run reliable, even when prerequisite jobs fail -- and this failure state needs to be propagated + +!detecting termination +The way other parts of the system are built, requires us to obtain a guaranteed knowledge of some job's termination. It is possible to obtain that knowledge with some limited delay, but it nees to be absoultely reliable (violations leading to segfault). The requirements stated above assume this can be achieved through //jobs with guaranteed execution.// Alternatively we could consider installing specific callbacks -- in this case the scheduler itself has to guarantee the invocation of these callbacks, even if the corresponding job fails or is never invoked. It doesn't seem there is any other option. +
A link to relate a compound of [[nested placement scopes|PlacementScope]] to the //current// session and the //current//&nbsp; [[focus for querying|QueryFocus]] and exploring the structure. ScopeLocator is a singleton service, allowing to ''explore'' a [[Placement]] as a scope, i.e. discover any other placements within this scope, and allowing to locate the position of this scope by navigating up the ScopePath finally to reach the root scope of the HighLevelModel.
@@ -5249,13 +5253,13 @@ We need to detect attaching and detaching of
 * root &harr; [[Track]]
 
-
+
//Segmentation of timeline// denotes a data structure and a step in the BuildProcess.
 When [[building the fixture|BuildFixture]], ~MObjects -- as handled by their Placements -- are grouped below each timeline using them; Placements are then to be resolved into [[explicit Placements|ExplicitPlacement]], resulting in a single well defined time interval for each object. This allows to cut this effective timeline into slices of constant wiring structure, which are represented through the ''Segmentation Datastructure'', a time axis with segments holding object placements and [[exit nodes|ExitNode]]. &nbsp;&rarr; see [[structure of the Fixture|Fixture]]
 * for each Timeline we get a Segmentation
 ** which in turn is a list of non-overlapping segments
 *** each holding
-**** an ExplicitPlacement for each covered object
+**** an ExplicitPlacement for each object touching that time interval
 **** an ExitNode for each ModelPort of the corresponding timeline
 
 !Usage pattern
@@ -5264,9 +5268,9 @@ When [[building the fixture|BuildFixture]], ~MObjects -- as handled by their Pla
 :&rarr; after //sorting,// the segmentation can be established, thereby copying placements spanning multiple segments
 :&rarr; only //after running the complete build process for each segment,// the list of model ports and exit nodes can be established
 ;(2) commit stage
-: -- after the build process(es) are completed, the new fixture gets ''committed'', thus becoming the officially valid state to be rendered. As render processes might be going on in parallel, some kind of locking or barrier is required. It seems advisable to make the change into a single atomic hot-swap. Meaning we'd get a single access point to be protected. But there is another twist: We need to find out which render processes to cancel an restart, to pick up the changes introduced by this build process, which might include adding and deleting of timelines as a whole, and any changes to the segmentation grid. Because of the highly dynamic nature of the placements, on the other hand it isn't viable to expect the high-level model to provide this information. Thus we need to find out about a ''change coverage'' at this point. We might expand on that idea to //prune any new segments which aren't changed.// This way, only a write barrier would be necessary on switching the actually changed segments, and any render processes touching these would be //tainted.// Old allocations could be released after all tainted processes are known to be terminated.
+: -- after the build process(es) are completed, the new fixture gets ''committed'', thus becoming the officially valid state to be rendered. As render processes might be going on in parallel, some kind of locking or barrier is required. It seems advisable to make the change into a single atomic hot-swap. Meaning we'd get a single access point to be protected. But there is another twist: We need to find out which render processes to cancel and restart, to pick up the changes introduced by this build process -- which might include adding and deleting of timelines as a whole, and any conceivable change to the segmentation grid. Because of the highly dynamic nature of the placements, on the other hand it isn't viable to expect the high-level model to provide this information. Thus we need to find out about a ''change coverage'' at this point. We might expand on that idea to //prune any new segments which aren't changed.// This way, only a write barrier would be necessary on switching the actually changed segments, and any render processes touching these would be //tainted.// Old allocations could be released after all tainted processes are known to be terminated.
 ;(3) rendering use
-:Each play/render process employs a ''frame dispatch step'' to get the right exit node for pulling a given frame. From there on, the process proceeds into the [[processing nodes|ProcNodes]], interleaved with backend/scheduler actions due to splitting into individually scheduled jobs. The storage of these processing nodes and accompanying wiring descriptors is hooked up behind the individual segments, by sharing a common {{{AllocationCluster}}}. Yet the calculation of individual frames also depends on ''parameters'' and especially ''automation'' connected with objects in the high-level model. It is likely that there might be some sharing, as the intention was to allow ''live changes'' to automated values. <br/>{{red{WIP 12/2010}}} details need to be worked out. &rarr; [[parameter wiring concept|Wiring]]
+:Each play/render process employs a ''frame dispatch step'' to get the right exit node for pulling a given frame. From there on, the process proceeds into the [[processing nodes|ProcNodes]], interleaved with backend/scheduler actions due to splitting into individually scheduled jobs. The storage of these processing nodes and accompanying wiring descriptors is hooked up behind the individual segments, by sharing a common {{{AllocationCluster}}}. Yet the calculation of individual frames also depends on ''parameters'' and especially ''automation'' linked with objects in the high-level model. It is likely that there might be some sharing or some kind of additional communication interface, as the intention was to allow ''live changes'' to automated values. <br/>{{red{WIP 12/2010}}} details need to be worked out. &rarr; [[parameter wiring concept|Wiring]]
 !!!observations
 * Storage and initialisation for explicit placements is an issue. We should strive at making that inline as much as possible.
 * the overall segmentation emerges from a sorting of time points, which are start points of explicit placements
@@ -5280,7 +5284,7 @@ When [[building the fixture|BuildFixture]], ~MObjects -- as handled by their Pla
 !!!conclusions
 The Fixture is mostly comprised of the Segementation datastructure, but some other facilities are involved too
 # at top level, access is structured by groups of model ports, actually grouped by timeline. This first access level is handled by the Fixture
-# during the build process, there is a collection of placements; this can be discarded afterwards
+# during the build process, there is a collecting and ordering of placements; these intermediaries as well as the initial collection can be discarded afterwards
 # the backbone of the segmentation is closely linked to an ordering by time. Initially it should support sorting, access by time interval search later on.
 # discarding a segment (or failing to do so) has an high impact on the whole application. We should employ a reliable mechanism for that.
 # the frame dispatch and the tracking of processes can be combined; data duplication is a virtue when it comes to parallel processes

From fa0588b584536aaa07ec04fefa02f9c23442dc1d Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sun, 18 Dec 2011 02:02:55 +0100
Subject: [PATCH 20/87] refactor to simplify generating a PlayProcess

---
 src/proc/play/play-process.cpp | 36 +++++++++++++++++-----------------
 src/proc/play/play-process.hpp | 11 ++++++-----
 2 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/src/proc/play/play-process.cpp b/src/proc/play/play-process.cpp
index 709b508c4..159e111df 100644
--- a/src/proc/play/play-process.cpp
+++ b/src/proc/play/play-process.cpp
@@ -28,7 +28,7 @@
 
 //#include 
 //#include 
-#include 
+//#include 
 //#include 
 
 
@@ -42,6 +42,7 @@ namespace play {
 //    using boost::scoped_ptr;
 //    using std::tr1::bind;
   using lib::transform;
+  using lib::append_all;
   
   
   namespace { // Implementation details...
@@ -50,6 +51,13 @@ namespace play {
   } // (End) hidden service impl details
   
   
+  PlayProcess::PlayProcess (OutputFeeds feeds)
+    : outputFeeds_(feeds)
+    {
+      if (isnil (feeds))
+        throw error::State ("creating a PlayProcess without any usable output connections"
+                           , LUMIERA_ERROR_CANT_PLAY);
+    }
   
   
   
@@ -58,27 +66,19 @@ namespace play {
    * The caller gets to own and manage the returned process entry.
    */
   PlayProcess*
-  PlayProcess::initiate (ModelPorts dataGenerators, function activeOutputFeedBuilder)
-  {
-    return new PlayProcess (transform (dataGenerators,
-                                       activeOutputFeedBuilder));
+  PlayProcess::initiate (ModelPorts dataGenerators, FeedBuilder activeOutputFeedBuilder)
+  { 
+    OutputFeeds newFeeds;
+    append_all (transform (dataGenerators, activeOutputFeedBuilder), newFeeds);
+    return new PlayProcess (newFeeds);
+/////////////////////////////////////////////////////////////////////////////////////////////TICKET #874 : use a pipeline builder to write it as follows:
+//                      treat_all(dataGenerators)
+//                        .apply (activeOutputFeedBuilder)
+//                        .buildVector();
   }
   
   
   
-  /** @internal actually create and configure a play process instance */
-  PlayProcess::PlayProcess (Connections pipeConnections)
-  {
-    if (isnil (pipeConnections))
-      throw error::State ("creating a PlayProcess without any usable output connections"
-                         , LUMIERA_ERROR_CANT_PLAY);
-    
-    UNIMPLEMENTED ("iterate over the connections and allocate/establish each of them, creating and storing Feed objects");
-    while (pipeConnections)
-      {
-        
-      }
-  }
   
   
   /** */
diff --git a/src/proc/play/play-process.hpp b/src/proc/play/play-process.hpp
index fdcb68b10..bf0733a72 100644
--- a/src/proc/play/play-process.hpp
+++ b/src/proc/play/play-process.hpp
@@ -103,6 +103,9 @@ namespace play {
        *  here through the RenderConfigurator instance */
       Feed (engine::CalcStreams const&);
     };
+  
+  typedef function FeedBuilder;
+  typedef std::vector         OutputFeeds;
     
   
   /******************************************************
@@ -124,15 +127,13 @@ namespace play {
   class PlayProcess
     : boost::noncopyable
     {
-      std::vector outputFeeds_;
+      OutputFeeds outputFeeds_;
       
-      typedef lib::IterSource::iterator Connections;
-      
-      PlayProcess (Connections pipeConnections);
+      PlayProcess (OutputFeeds feeds);
       
     public:
       static PlayProcess*
-      initiate (ModelPorts dataGenerators, function);
+      initiate (ModelPorts dataGenerators, FeedBuilder);
     };
   
   

From 7fc84733375f5ae66b9c2de4e05c70337a57959c Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 19 Dec 2011 03:02:48 +0100
Subject: [PATCH 21/87] fix some size_t printf specs (32/64bit problem)

---
 src/proc/asset.cpp                      | 4 ++--
 src/proc/mobject/session/scope-path.cpp | 2 +-
 tests/lib/meta/generator-test.cpp       | 2 +-
 tests/lib/scoped-holder-test.cpp        | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/proc/asset.cpp b/src/proc/asset.cpp
index 531566b63..8b8865c65 100644
--- a/src/proc/asset.cpp
+++ b/src/proc/asset.cpp
@@ -66,12 +66,12 @@ namespace asset {
     , id(AssetManager::reg (this, idi))
     , enabled(true)
     {
-      TRACE (assetmem, "ctor Asset(id=%lu) :  adr=%p %s", size_t(id), this, cStr(this->ident) );
+      TRACE (assetmem, "ctor Asset(id=%zu) :  adr=%p %s", size_t(id), this, cStr(this->ident) );
     }
   
   Asset::~Asset ()
     { 
-      TRACE (assetmem, "dtor Asset(id=%lu) :  adr=%p", size_t(id), this );
+      TRACE (assetmem, "dtor Asset(id=%zu) :  adr=%p", size_t(id), this );
     }
   
 
diff --git a/src/proc/mobject/session/scope-path.cpp b/src/proc/mobject/session/scope-path.cpp
index badf0b1db..f48054802 100644
--- a/src/proc/mobject/session/scope-path.cpp
+++ b/src/proc/mobject/session/scope-path.cpp
@@ -134,7 +134,7 @@ namespace session {
   
   ScopePath::~ScopePath()
   {
-    WARN_IF (refcount_, session, "Destroying a scope path frame with ref-count=%lu", refcount_);
+    WARN_IF (refcount_, session, "Destroying a scope path frame with ref-count=%zu", refcount_);
   }
   
   
diff --git a/tests/lib/meta/generator-test.cpp b/tests/lib/meta/generator-test.cpp
index 00a816c22..9e1583ed2 100644
--- a/tests/lib/meta/generator-test.cpp
+++ b/tests/lib/meta/generator-test.cpp
@@ -134,7 +134,7 @@ namespace test {
           subInterface.eat (b13);
           me_can_has_more_numberz.eat();
           
-          INFO (test, "SizeOf = %lu", sizeof(me_can_has_more_numberz));
+          INFO (test, "SizeOf = %zu", sizeof(me_can_has_more_numberz));
         }
     };
   
diff --git a/tests/lib/scoped-holder-test.cpp b/tests/lib/scoped-holder-test.cpp
index dd0734bb7..40b2637e7 100644
--- a/tests/lib/scoped-holder-test.cpp
+++ b/tests/lib/scoped-holder-test.cpp
@@ -108,8 +108,8 @@ namespace test{
             
             TRACE (test, "holder at %p", &holder);
             TRACE (test, "object at %p", holder.get() );
-            TRACE (test, "size(object) = %lu", sizeof(*holder));
-            TRACE (test, "size(holder) = %lu", sizeof(holder));
+            TRACE (test, "size(object) = %zu", sizeof(*holder));
+            TRACE (test, "size(holder) = %zu", sizeof(holder));
           }
           CHECK (0 == Dummy::checksum());
         }

From 74a982409e42794fda5ad0888d01ca52a6ddc41c Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 20 Dec 2011 04:59:00 +0100
Subject: [PATCH 22/87] document the internal structore of OutputSlot

...as far as decided and clarified by now
---
 doc/devel/uml/fig151685.png     | Bin 0 -> 26732 bytes
 uml/lumiera/132229              |  35 ++-
 uml/lumiera/133637              | 404 ++++++++++++++++++++++++++++++--
 uml/lumiera/136453.diagram      |  38 +--
 uml/lumiera/138885.diagram      |  66 +++---
 uml/lumiera/143877.diagram      |  58 ++---
 uml/lumiera/144005.diagram      |  40 ++--
 uml/lumiera/145157.diagram      |  88 +++----
 uml/lumiera/151685.diagram      | 114 +++++++++
 uml/lumiera/5.session           |  14 +-
 uml/lumiera/generation_settings |   4 +
 uml/lumiera/lumiera.prj         |  14 +-
 uml/lumiera/stereotypes         |   3 +
 wiki/renderengine.html          |  96 ++++++--
 14 files changed, 751 insertions(+), 223 deletions(-)
 create mode 100644 doc/devel/uml/fig151685.png
 create mode 100644 uml/lumiera/151685.diagram

diff --git a/doc/devel/uml/fig151685.png b/doc/devel/uml/fig151685.png
new file mode 100644
index 0000000000000000000000000000000000000000..a84679ddfc3db15f873cd102bc00ff9f97c7f5a9
GIT binary patch
literal 26732
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
KlP^S=`u_)cmFs~3

literal 0
HcmV?d00001

diff --git a/uml/lumiera/132229 b/uml/lumiera/132229
index eebdd4e5b..1c0d62b34 100644
--- a/uml/lumiera/132229
+++ b/uml/lumiera/132229
@@ -1,16 +1,16 @@
-format 58
+format 74
 "Session" // ProcessingLayer::MObject::Session
-  revision 4
+  revision 6
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
-  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 default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
   //use case diagram settings
   package_name_in_tab default show_context default auto_label_position default draw_all_relations default class_drawing_mode default shadow default show_stereotype_properties default
   //sequence diagram settings
-  show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default
+  show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default show_class_context_mode default show_msg_context_mode default
   //collaboration diagram settings
-  show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default show_stereotype_properties default
+  show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default show_msg_context default draw_all_relations default shadow default show_stereotype_properties default
   //object diagram settings
    write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default show_stereotype_properties default
   //component diagram settings
@@ -28,13 +28,13 @@ format 58
   
   classview 128005 "Session parts"
     //class diagram settings
-    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 default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
     //collaboration diagram settings
-    show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default show_stereotype_properties default
+    show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default show_msg_context default draw_all_relations default shadow default show_stereotype_properties default
     //object diagram settings
      write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default show_stereotype_properties default
     //sequence diagram settings
-    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default
+    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default show_class_context_mode default show_msg_context_mode default
     //state diagram settings
     package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
     show_activities default region_horizontally default drawing_language default show_stereotype_properties default
@@ -43,7 +43,7 @@ format 58
     package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
     show_infonote default drawing_language default show_stereotype_properties default
     classdiagram 128133 "Session structure"
-      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
+      draw_all_relations no hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
       size A4
     end
 
@@ -846,7 +846,6 @@ ${members}};
 	python_decl ""
 	idl_decl ""
       end
-
     end
 
     class 128773 "AbstractMO"
@@ -1478,13 +1477,13 @@ ${inlines}
 
   classview 131973 "Object ref"
     //class diagram settings
-    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 default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
     //collaboration diagram settings
-    show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default show_stereotype_properties default
+    show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default show_msg_context default draw_all_relations default shadow default show_stereotype_properties default
     //object diagram settings
      write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default show_stereotype_properties default
     //sequence diagram settings
-    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default
+    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default show_class_context_mode default show_msg_context_mode default
     //state diagram settings
     package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
     show_activities default region_horizontally default drawing_language default show_stereotype_properties default
@@ -1493,7 +1492,7 @@ ${inlines}
     package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
     show_infonote default drawing_language default show_stereotype_properties default
     classdiagram 136581 "MObjectRef"
-      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 default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
       size A4
     end
 
@@ -1625,13 +1624,13 @@ ${inlines}
 
   classview 132101 "Datastructure"
     //class diagram settings
-    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 default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
     //collaboration diagram settings
-    show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default show_stereotype_properties default
+    show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default show_msg_context default draw_all_relations default shadow default show_stereotype_properties default
     //object diagram settings
      write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default show_stereotype_properties default
     //sequence diagram settings
-    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default
+    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default show_class_context_mode default show_msg_context_mode default
     //state diagram settings
     package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
     show_activities default region_horizontally default drawing_language default show_stereotype_properties default
@@ -1640,7 +1639,7 @@ ${inlines}
     package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
     show_infonote default drawing_language default show_stereotype_properties default
     classdiagram 136453 "Session backbone"
-      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
+      draw_all_relations no hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
       size A4
     end
 
diff --git a/uml/lumiera/133637 b/uml/lumiera/133637
index 9857cb0e0..6aa5780ec 100644
--- a/uml/lumiera/133637
+++ b/uml/lumiera/133637
@@ -1,16 +1,16 @@
-format 58
+format 74
 "Play" // ProcessingLayer::Play
-  revision 3
+  revision 5
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
-  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 default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
   //use case diagram settings
   package_name_in_tab default show_context default auto_label_position default draw_all_relations default class_drawing_mode default shadow default show_stereotype_properties default
   //sequence diagram settings
-  show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default
+  show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default show_class_context_mode default show_msg_context_mode default
   //collaboration diagram settings
-  show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default show_stereotype_properties default
+  show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default show_msg_context default draw_all_relations default shadow default show_stereotype_properties default
   //object diagram settings
    write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default show_stereotype_properties default
   //component diagram settings
@@ -28,13 +28,13 @@ format 58
   
   classview 136837 "PlayOut"
     //class diagram settings
-    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 default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
     //collaboration diagram settings
-    show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default show_stereotype_properties default
+    show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default show_msg_context default draw_all_relations default shadow default show_stereotype_properties default
     //object diagram settings
      write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default show_stereotype_properties default
     //sequence diagram settings
-    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default
+    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default show_class_context_mode default show_msg_context_mode default
     //state diagram settings
     package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
     show_activities default region_horizontally default drawing_language default show_stereotype_properties default
@@ -43,7 +43,12 @@ format 58
     package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
     show_infonote default drawing_language default show_stereotype_properties default
     classdiagram 143877 "Player Entities"
-      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 default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+      size A4
+    end
+
+    classdiagram 151685 "Player Output"
+      draw_all_relations no hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
       size A4
     end
 
@@ -65,6 +70,276 @@ ${inlines}
       idl_decl ""
       explicit_switch_type ""
       
+      class 185221 "Allocation"
+	visibility protected 
+	cpp_decl "${comment}${template}class ${name}${inherit}
+  {
+${members}  };
+${inlines}
+"
+	java_decl ""
+	php_decl ""
+	python_2_2 python_decl ""
+	idl_decl ""
+	explicit_switch_type ""
+	
+	classrelation 223749 // 
+	  relation 212613 *-->
+	    stereotype "for_each_channel"
+	    a role_name "" protected
+	      cpp default "    ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value};
+"
+	      classrelation_ref 223749 // 
+	    b parent class_ref 178565 // DataSink
+	end
+
+	operation 151301 "getOpenedSinks"
+	  public explicit_return_type ""
+	  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
+
+	operation 151429 "getTimings"
+	  public explicit_return_type ""
+	  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
+      end
+
+      classrelation 223621 // 
+	relation 212485 -_->
+	  stereotype "when-in-use"
+	  a package
+	    cpp default "#include in source"
+	    classrelation_ref 223621 // 
+	  b parent class_ref 185221 // Allocation
+      end
+
+      operation 150917 "isFree"
+	public explicit_return_type ""
+	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
+
+      operation 151045 "allocate"
+	public explicit_return_type ""
+	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
+
+      operation 151173 "disconnect"
+	public explicit_return_type ""
+	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
+    end
+
+    class 178565 "DataSink"
+      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 ""
+      
+      classrelation 223877 // 
+	relation 212741 --->
+	  stereotype "smart-Handle"
+	  a role_name "" protected
+	    cpp default "    ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
+"
+	    classrelation_ref 223877 // 
+	  b parent class_ref 185349 // Connection
+      end
+
+      operation 150661 "lockBufferFor"
+	public explicit_return_type ""
+	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
+
+      operation 150789 "emit"
+	public explicit_return_type ""
+	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
+    end
+
+    class 185349 "Connection"
+      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 ""
+      
+      operation 150277 "claimBufferFor"
+	public explicit_return_type ""
+	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
+
+      operation 150405 "transfer"
+	public explicit_return_type ""
+	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
+
+      operation 150533 "pushout"
+	public explicit_return_type ""
+	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
+    end
+
+    class 185477 "OutputSlotImpl"
+      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 ""
+      
+      classrelation 224005 // 
+	relation 212869 ---|>
+	  a public
+	    cpp default "${type}"
+	    classrelation_ref 224005 // 
+	  b parent class_ref 176133 // OutputSlot
+      end
+
+      classrelation 224773 // 
+	relation 213637 -_->
+	  a default
+	    cpp default "#include in source"
+	    classrelation_ref 224773 // 
+	  b parent class_ref 185861 // ConnectionStateManager
+      end
     end
 
     class 176261 "Controller"
@@ -354,7 +629,7 @@ ${inlines}
     end
 
     sequencediagram 145157 "output data exchange"
-      show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default
+      show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default show_class_context_mode default show_msg_context_mode default
       overlapping_bars size A4
     end
 
@@ -373,21 +648,6 @@ ${inlines}
       
     end
 
-    class 178565 "DataSink"
-      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
-
     class 178693 "BufferProvider"
       visibility package 
       cpp_decl "${comment}${template}class ${name}${inherit}
@@ -402,5 +662,99 @@ ${inlines}
       explicit_switch_type ""
       
     end
+
+    class 185605 "ConnectionState"
+      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 ""
+      
+      classrelation 224133 // 
+	relation 212997 -_-|>
+	  a public
+	    cpp default "${type}"
+	    classrelation_ref 224133 // 
+	  b parent class_ref 185221 // Allocation
+      end
+    end
+
+    class 185733 "ConcreteConnection"
+      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 ""
+      
+      classrelation 224261 // 
+	relation 213125 -_-|>
+	  a public
+	    cpp default "${type}"
+	    classrelation_ref 224261 // 
+	  b parent class_ref 185349 // Connection
+      end
+
+      classrelation 224901 // 
+	relation 213765 --->
+	  a role_name "" protected
+	    cpp default "    ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
+"
+	    classrelation_ref 224901 // 
+	  b parent class_ref 178693 // BufferProvider
+      end
+    end
+
+    class 185861 "ConnectionStateManager"
+      visibility package 
+      nformals 1
+      formal name "CON" type "class" explicit_default_value ""
+        explicit_extends ""
+      cpp_decl "${comment}${template}class ${name}${inherit}
+  {
+${members}  };
+${inlines}
+"
+      java_decl ""
+      php_decl ""
+      python_2_2 python_decl ""
+      idl_decl ""
+      explicit_switch_type ""
+      
+      classrelation 224389 // 
+	relation 213253 ---|>
+	  a public
+	    cpp default "${type}"
+	    classrelation_ref 224389 // 
+	  b parent class_ref 185605 // ConnectionState
+      end
+
+      classrelation 224517 // 
+	relation 213381 -_->
+	  a default
+	    cpp default "#include in source"
+	    classrelation_ref 224517 // 
+	  b parent class_ref 185733 // ConcreteConnection
+      end
+
+      classrelation 224645 // 
+	relation 213509 -_->
+	  a default
+	    cpp default "#include in source"
+	    classrelation_ref 224645 // 
+	  b parent class_ref 185733 // ConcreteConnection
+      end
+    end
   end
 end
diff --git a/uml/lumiera/136453.diagram b/uml/lumiera/136453.diagram
index 3635c7caa..19f68b7d3 100644
--- a/uml/lumiera/136453.diagram
+++ b/uml/lumiera/136453.diagram
@@ -1,39 +1,39 @@
-format 58
+format 74
 
 classcanvas 128005 class_ref 152069 // PlacementIndex
-  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 410 14 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 420.5 15.9 2000
 end
 classcanvas 128261 class_ref 145541 // Timeline
-  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 43 87 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 50.8 88.8 2000
 end
 classcanvas 129029 class_ref 152197 // Sequence
-  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 124 194 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 130 195.9 2000
 end
 classcanvas 129157 class_ref 152325 // Binding
-  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 124 87 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 130.2 88.8 2000
 end
 classcanvas 129285 class_ref 128389 // Track
-  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 247 194 3005
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 248 195.9 3005
 end
 classcanvas 130437 class_ref 128005 // SessionImpl
-  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 34 15 3005
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 43.4 16.2 3005
 end
 classcanvas 130821 class_ref 167429 // BusMO
-  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 229 88 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 233.8 89.1 2000
 end
 classcanvas 131077 class_ref 138117 // Pipe
-  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 318 88 3005
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 318 89.1 3005
 end
 textcanvas 131845 "»global pipes«"
-  xyzwh 245 73 2005 69 13
+  xyzwh 245.9 73.9 2005 69 13
 relationcanvas 129797 relation_ref 193413 // 
   decenter_end 409
   from ref 129157 z 1999 to ref 129029
@@ -52,7 +52,7 @@ relationcanvas 130309 relation_ref 193669 // 
 end
 relationcanvas 130565 relation_ref 184709 // 
   from ref 130437 z 1999 to ref 128261
-  role_a_pos 80 69 3000 no_role_b
+  role_a_pos 87 71 3000 no_role_b
   no_multiplicity_a no_multiplicity_b
 end
 relationcanvas 130693 relation_ref 193797 // 
diff --git a/uml/lumiera/138885.diagram b/uml/lumiera/138885.diagram
index adeb01316..4b5a3c397 100644
--- a/uml/lumiera/138885.diagram
+++ b/uml/lumiera/138885.diagram
@@ -1,97 +1,97 @@
-format 58
+format 74
 
 classinstancecanvas 128005 classinstance_ref 138373 // 
-  xyz 32 157 2000
+  xyz 32.7 158.8 2000 show_context_mode no
 end
 classinstancecanvas 128133 classinstance_ref 138501 // 
-  xyz 200 157 2000
+  xyz 200.5 158.8 2000 show_context_mode no
 end
 classinstancecanvas 128261 classinstance_ref 138629 // 
-  xyz 200 211 2000
+  xyz 200.5 212.2 2000 show_context_mode no
 end
 classinstancecanvas 128389 classinstance_ref 138757 // 
-  xyz 236 252 2000
+  xyz 236.1 253.3 2000 show_context_mode no
 end
 classinstancecanvas 128517 classinstance_ref 138885 // 
-  xyz 236 279 2000
+  xyz 236.1 280 2000 show_context_mode no
 end
 classinstancecanvas 128645 classinstance_ref 139013 // 
-  xyz 236 307 2000
+  xyz 236.1 308.8 2000 show_context_mode no
 end
 classinstancecanvas 128773 classinstance_ref 139141 // 
-  xyz 33 211 2000
+  xyz 37.2 212.2 2000 show_context_mode no
 end
 classinstancecanvas 128901 classinstance_ref 139269 // 
-  xyz 96 211 2000
+  xyz 100.1 212.2 2000 show_context_mode no
 end
 classinstancecanvas 130693 classinstance_ref 139397 // 
-  xyz 319 191 2000
+  xyz 323.8 192.2 2000 show_context_mode no
 end
 classinstancecanvas 130949 classinstance_ref 139525 // 
-  xyz 313 157 2000
+  xyz 317.8 158.8 2000 show_context_mode no
 end
 classinstancecanvas 131333 classinstance_ref 139653 // 
-  xyz 319 308 2000
+  xyz 319.4 309.9 2000 show_context_mode no
 end
 classinstancecanvas 131461 classinstance_ref 139781 // 
-  xyz 276 346 2000
+  xyz 276.1 347.7 2000 show_context_mode no
 end
 classinstancecanvas 131589 classinstance_ref 139909 // 
-  xyz 393 343 2000
+  xyz 393.8 344.4 2000 show_context_mode no
 end
 classinstancecanvas 131717 classinstance_ref 140037 // 
-  xyz 393 274 2005
+  xyz 393.8 275.5 2005 show_context_mode no
 end
 classinstancecanvas 132741 classinstance_ref 140165 // 
-  xyz 319 91 2004
+  xyz 319.4 92.2 2004 show_context_mode no
 end
 classinstancecanvas 133125 classinstance_ref 140293 // 
-  xyz 236 129 2009
+  xyz 236.1 130 2009 show_context_mode no
 end
 classinstancecanvas 133637 classinstance_ref 140421 // 
-  xyz 503 308 2000
+  xyz 503.8 309.9 2000 show_context_mode no
 end
 classinstancecanvas 133893 classinstance_ref 140677 // 
-  xyz 492 252 2000
+  xyz 497.5 253.3 2000 show_context_mode no
 end
 classinstancecanvas 134021 classinstance_ref 140805 // 
-  xyz 562 129 2000
+  xyz 566.1 130 2000 show_context_mode no
 end
 classinstancecanvas 134789 classinstance_ref 141189 // 
-  xyz 319 53 2000
+  xyz 319.4 54.4 2000 show_context_mode no
 end
 classinstancecanvas 135173 classinstance_ref 141317 // 
-  xyz 562 91 2000
+  xyz 566.1 92.2 2000 show_context_mode no
 end
 classinstancecanvas 135301 classinstance_ref 141445 // 
-  xyz 562 53 2005
+  xyz 566.1 54.4 2005 show_context_mode no
 end
 fragment 135813 "TypedLookup"
-  xyzwh 532 23 1994 148 137
+  xyzwh 531.5 23.3 1994 148 137
 end
 classinstancecanvas 136197 classinstance_ref 141573 // plugin1
-  xyz 490 342 2000
+  xyz 495.4 343.3 2000 show_context_mode no
 end
 classinstancecanvas 136325 classinstance_ref 141701 // plugin2
-  xyz 490 396 2000
+  xyz 495.4 397.7 2000 show_context_mode no
 end
 classinstancecanvas 137221 classinstance_ref 141829 // 
-  xyz 32 263 2000
+  xyz 36.4 264.4 2000 show_context_mode no
 end
 packagecanvas 137477 
   package_ref 128133 // Asset
-  name_in_tab yes color verylightorange  xyzwh 470 183 1989 213 254
+  name_in_tab yes color verylightorange  xyzwh 470.6 181.8 1989 213 254
 end
 packagecanvas 137605 
   package_ref 132229 // Session
-  name_in_tab yes  xyzwh 15 25 1984 456 408
+  name_in_tab yes  xyzwh 15.2 23.7 1984 456 408
 end
 note 137733 "top-level Timeline"
-  xyzwh 91 263 2000 64 45
+  xyzwh 90.6 263.5 2000 64 45
 note 137861 "virtual clip"
-  xyzwh 393 235 2010 69 35
+  xyzwh 393.1 235.6 2010 69 35
 classinstancecanvas 138117 classinstance_ref 139653 // 
-  xyz 319 252 2015
+  xyz 319.4 253.3 2015 show_context_mode no
 end
 objectlinkcanvas 129029 norel
   from ref 128773 z 1999 to ref 128901
@@ -161,7 +161,7 @@ objectlinkcanvas 138373 norel
   no_role_a no_role_b
 objectlinkcanvas 138885 norel
   decenter_begin 205
-  from ref 133893 z 1999 to point 411 198
+  from ref 133893 z 1999 to point 411.3 199
   line 139013 z 1999 to ref 130693
   no_role_a no_role_b
 line 130565 -_-_
diff --git a/uml/lumiera/143877.diagram b/uml/lumiera/143877.diagram
index f49ed5f08..e39b7082b 100644
--- a/uml/lumiera/143877.diagram
+++ b/uml/lumiera/143877.diagram
@@ -1,56 +1,56 @@
-format 58
+format 74
 
 classcanvas 128005 class_ref 176133 // OutputSlot
-  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 349 106 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 356.7 107.5 2000
 end
 classcanvas 128133 class_ref 176261 // Controller
-  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 71 172 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 78.4 173.3 2000
 end
 classcanvas 128261 class_ref 176389 // PlayProcess
-  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 143 222 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 150.8 223.3 2000
 end
 classcanvas 128389 class_ref 176517 // OutputManager
-  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 472 47 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 482.8 48.8 2000
 end
 classcanvas 128517 class_ref 176645 // OutputDirector
-  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 474 165 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 484.8 166.2 2000
 end
 classcanvas 129541 class_ref 176773 // ModelPort
-  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 355 266 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 362.9 267.5 2000
 end
 classcanvas 129669 class_ref 176901 // CalcStream
-  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 207 380 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 207.4 381.7 2000
 end
 classcanvas 129797 class_ref 177029 // Dispatcher
-  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 355 381 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 362.2 382 2000
 end
 fragment 130053 "output management"
-  xyzwh 299 17 2000 324 218
+  xyzwh 299 16.5 2000 324 218
 end
 fragment 130181 "Model / Fixture"
-  xyzwh 299 239 1995 323 91
+  xyzwh 299 239.2 1995 323 91
 end
 fragment 130309 "Player"
-  xyzwh 16 87 1990 274 243
+  xyzwh 15.6 87.4 1990 274 243
 end
 classcanvas 130437 class_ref 177157 // PlayService
-  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 40 118 2005
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 46.3 119.1 2005
 end
 fragment 130565 "Engine"
-  xyzwh 16 346 1995 606 208
+  xyzwh 16.4 345.7 1995 606 208
 end
 classcanvas 130693 class_ref 177285 // Feed
-  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 218 273 2000
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 218 274.6 2000
 end
 relationcanvas 128645 relation_ref 205445 // 
   from ref 128517 z 1999 to ref 128389
@@ -59,15 +59,15 @@ relationcanvas 128645 relation_ref 205445 // 
 end
 relationcanvas 128773 relation_ref 205573 // 
   geometry HVH
-  from ref 128389 z 1999 to point 439 64
-  line 129285 z 1999 to point 439 123
+  from ref 128389 z 1999 to point 453 64
+  line 129285 z 1999 to point 453 138
   line 129413 z 1999 to ref 128005
   no_role_a no_role_b
   no_multiplicity_a no_multiplicity_b
 end
 relationcanvas 130821 relation_ref 205701 // 
   geometry VH
-  from ref 128261 z 1999 to point 178 290
+  from ref 128261 z 1999 to point 183 290
   line 130949 z 1999 to ref 130693
   no_role_a no_role_b
   no_multiplicity_a no_multiplicity_b
@@ -83,6 +83,6 @@ relationcanvas 131205 relation_ref 205957 // 
   no_multiplicity_a no_multiplicity_b
 end
 line 131333 -_-_ geometry VH
-  from ref 128133 z 1999 to point 99 239
+  from ref 128133 z 1999 to point 105 239
   line 131461 z 1999 to ref 128261
 end
diff --git a/uml/lumiera/144005.diagram b/uml/lumiera/144005.diagram
index 8a28bdf33..6e70081c9 100644
--- a/uml/lumiera/144005.diagram
+++ b/uml/lumiera/144005.diagram
@@ -1,59 +1,59 @@
-format 58
+format 74
 
 classinstancecanvas 128005 classinstance_ref 145669 // 
-  xyz 41 85 2000
+  xyz 46.7 86.6 2000 show_context_mode no
 end
 classinstancecanvas 128133 classinstance_ref 145797 // 
-  xyz 105 142 2000
+  xyz 112.7 143.3 2000 show_context_mode no
 end
 classinstancecanvas 128261 classinstance_ref 145925 // 
-  xyz 171 173 2000
+  xyz 171.6 174.4 2000 show_context_mode no
 end
 classinstancecanvas 128389 classinstance_ref 146053 // 
-  xyz 171 240 2000
+  xyz 171.6 241.1 2000 show_context_mode no
 end
 classinstancecanvas 128517 classinstance_ref 146181 // video-L
-  xyz 233 194 2000 color lightgreen
+  xyz 242.4 195.5 2000 color lightgreen show_context_mode no
 end
 classinstancecanvas 128645 classinstance_ref 146309 // video-R
-  xyz 233 216 2000 color lightgreen
+  xyz 243.5 217.7 2000 color lightgreen show_context_mode no
 end
 classinstancecanvas 128773 classinstance_ref 146437 // sound-W
-  xyz 233 269 2000 color lightgreen
+  xyz 243.8 270 2000 color lightgreen show_context_mode no
 end
 classinstancecanvas 128901 classinstance_ref 146565 // sound-X
-  xyz 233 291 2000 color lightgreen
+  xyz 242.6 292.2 2000 color lightgreen show_context_mode no
 end
 classinstancecanvas 129029 classinstance_ref 146693 // sound-Y
-  xyz 233 313 2000 color lightgreen
+  xyz 242.6 314.4 2000 color lightgreen show_context_mode no
 end
 classinstancecanvas 132101 classinstance_ref 146821 // 
-  xyz 420 269 2000 color lightblue
+  xyz 425.6 270 2000 color lightblue show_context_mode no
 end
 classinstancecanvas 132229 classinstance_ref 146949 // 
-  xyz 420 194 2000 color lightblue
+  xyz 425.6 195.5 2000 color lightblue show_context_mode no
 end
 note 132357 "stateless (functional)"
-  xyzwh 348 140 2000 124 35
+  xyzwh 347.7 140.1 2000 124 35
 note 132485 "stateful"
-  color verylightorange  xyzwh 131 85 2000 72 36
+  color verylightorange  xyzwh 130.8 84.6 2000 72 36
 classinstancecanvas 132613 classinstance_ref 147077 // 
-  xyz 233 23 2000
+  xyz 237 24.4 2000 show_context_mode no
 end
 classinstancecanvas 132741 classinstance_ref 147205 // 
-  xyz 233 46 2000
+  xyz 237 47.7 2000 show_context_mode no
 end
 classinstancecanvas 132869 classinstance_ref 148357 // sound-Z
-  xyz 233 335 2000 color lightgreen
+  xyz 242.6 336.6 2000 color lightgreen show_context_mode no
 end
 objectlinkcanvas 129285 norel
   geometry VH
-  from ref 128133 z 1999 to point 139 181
+  from ref 128133 z 1999 to point 144 181
   line 129413 z 1999 to ref 128261
   no_role_a no_role_b
 objectlinkcanvas 129541 norel
   geometry VH
-  from ref 128133 z 1999 to point 139 248
+  from ref 128133 z 1999 to point 144 248
   line 129797 z 1999 to ref 128389
   no_role_a no_role_b
 objectlinkcanvas 129925 norel
@@ -83,7 +83,7 @@ objectlinkcanvas 130949 norel
   no_role_a no_role_b
 objectlinkcanvas 131845 norel
   geometry VH
-  from ref 128005 z 1999 to point 68 150
+  from ref 128005 z 1999 to point 74 150
   line 131973 z 1999 to ref 128133
   no_role_a no_role_b
 objectlinkcanvas 132997 norel
diff --git a/uml/lumiera/145157.diagram b/uml/lumiera/145157.diagram
index f75dd4db5..b051824fd 100644
--- a/uml/lumiera/145157.diagram
+++ b/uml/lumiera/145157.diagram
@@ -1,130 +1,130 @@
-format 58
+format 74
 
 classinstance 128005 class_ref 178437 // Client
-  name ""   xyz 53 4 2000 life_line_z 2000
+  name ""   xyz 53.1 3.7 2000 life_line_z 2000
 classinstance 128133 class_ref 176133 // OutputSlot
-  name ""   xyz 281 5 2000 life_line_z 2000
+  name ""   xyz 285.4 5 2000 life_line_z 2000
 classinstance 128261 class_ref 178565 // DataSink
-  name ""   xyz 140 28 2000 life_line_z 2000
+  name ""   xyz 143.6 27.9 2000 life_line_z 2000
 classinstance 128389 class_ref 178693 // BufferProvider
-  name ""   xyz 463 5 2000 life_line_z 2000
+  name ""   xyz 471.5 5 2000 life_line_z 2000
 fragment 131845 "client side"
-  xyzwh 41 28 1995 156 279
+  xyzwh 41.4 28.1 1995 156 279
 end
 fragment 131973 "output implementation"
-  xyzwh 281 29 1995 262 277
+  xyzwh 281.3 29.1 1995 262 277
 end
 durationcanvas 128517 classinstance_ref 128005 // :Client
-  xyzwh 72 83 2010 11 52
+  xyzwh 72 81.7 2010 11 52
 end
 durationcanvas 129541 classinstance_ref 128005 // :Client
-  xyzwh 72 211 2010 11 41
+  xyzwh 72 211.1 2010 11 41
 end
 durationcanvas 129669 classinstance_ref 128261 // :DataSink
-  xyzwh 162 238 2010 11 25
+  xyzwh 166 238 2010 11 25
 end
 durationcanvas 129925 classinstance_ref 128133 // :OutputSlot
-  xyzwh 307 242 2010 11 63
+  xyzwh 313 242.3 2010 11 63
   overlappingdurationcanvas 133637
-    xyzwh 313 272 2020 11 28
+    xyzwh 319 271.5 2020 11 28
   end
 end
 durationcanvas 130309 classinstance_ref 128389 // :BufferProvider
-  xyzwh 497 250 2010 11 26
+  xyzwh 507 250.2 2010 11 26
 end
 durationcanvas 131333 classinstance_ref 128133 // :OutputSlot
-  xyzwh 307 85 2010 11 34
+  xyzwh 313 85.1 2010 11 34
 end
 durationcanvas 132101 classinstance_ref 128261 // :DataSink
-  xyzwh 162 107 2010 11 25
+  xyzwh 166 107.9 2010 11 25
 end
 durationcanvas 132485 classinstance_ref 128005 // :Client
   xyzwh 72 167 2010 11 27
 end
 durationcanvas 132613 classinstance_ref 128261 // :DataSink
-  xyzwh 162 169 2010 11 25
+  xyzwh 166 169.1 2010 11 25
 end
 durationcanvas 132869 classinstance_ref 128133 // :OutputSlot
-  xyzwh 307 173 2010 11 25
+  xyzwh 313 173.5 2010 11 25
 end
 durationcanvas 133125 classinstance_ref 128005 // :Client
-  xyzwh 72 211 2010 11 29
+  xyzwh 72 211.5 2010 11 29
 end
 durationcanvas 133381 classinstance_ref 128389 // :BufferProvider
-  xyzwh 497 180 2010 11 25
+  xyzwh 507 180.2 2010 11 25
 end
 durationcanvas 133893 classinstance_ref 128389 // :BufferProvider
-  xyzwh 497 280 2010 11 25
+  xyzwh 507 280.2 2010 11 25
 end
 msg 129797 synchronous
   from durationcanvas_ref 129541
   to durationcanvas_ref 129669
   yz 238 2015 explicitmsg "emit()"
-  show_full_operations_definition default drawing_language default
-  label_xy 109 230
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 110 231
 msg 130053 synchronous
   from durationcanvas_ref 129669
   to durationcanvas_ref 129925
   yz 242 2020 explicitmsg "transfer()"
-  show_full_operations_definition default drawing_language default
-  label_xy 217 234
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 220 235
 msg 130437 synchronous
   from durationcanvas_ref 129925
   to durationcanvas_ref 130309
   yz 250 2030 explicitmsg "transition to EMITTED"
-  show_full_operations_definition default drawing_language default
-  label_xy 374 243
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 383 244
 msg 131461 synchronous
   from durationcanvas_ref 128517
   to durationcanvas_ref 131333
   yz 85 2015 explicitmsg "allocate()"
-  show_full_operations_definition default drawing_language default
-  label_xy 102 75
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 105 76
 msg 132229 synchronous
   from durationcanvas_ref 131333
   to durationcanvas_ref 132101
   yz 108 2020 explicitmsg "create DataSink"
-  show_full_operations_definition default drawing_language default
-  label_xy 201 99
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 208 100
 msg 132357 return
   from durationcanvas_ref 132101
   to durationcanvas_ref 128517
   yz 116 2025 explicitmsg "DataSink"
-  show_full_operations_definition default drawing_language default
-  label_xy 101 121
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 105 122
 msg 132741 synchronous
   from durationcanvas_ref 132485
   to durationcanvas_ref 132613
   yz 169 2015 explicitmsg "lockBuffer()"
-  show_full_operations_definition default drawing_language default
-  label_xy 97 159
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 102 160
 msg 132997 synchronous
   from durationcanvas_ref 132613
   to durationcanvas_ref 132869
   yz 175 2020 explicitmsg "lock()"
-  show_full_operations_definition default drawing_language default
-  label_xy 225 165
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 227 166
 reflexivemsg 133253 synchronous
   to durationcanvas_ref 133125
   yz 211 2020 explicitmsg "generate Data"
-  show_full_operations_definition default drawing_language default
-  label_xy 84 199
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 90 200
 msg 133509 synchronous
   from durationcanvas_ref 132869
   to durationcanvas_ref 133381
   yz 180 2025 explicitmsg "transition to LOCKED"
-  show_full_operations_definition default drawing_language default
-  label_xy 374 173
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 383 174
 reflexivemsg 133765 synchronous
   to durationcanvas_ref 133637
   yz 272 2040 explicitmsg "pushout()"
-  show_full_operations_definition default drawing_language default
-  label_xy 325 260
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 328 261
 msg 134021 synchronous
   from durationcanvas_ref 133637
   to durationcanvas_ref 133893
   yz 289 2025 explicitmsg "transition to FREE"
-  show_full_operations_definition default drawing_language default
-  label_xy 374 282
+  show_full_operations_definition default drawing_language default show_context_mode default
+  label_xy 381 283
 preferred_whz 586 416 1
 end
diff --git a/uml/lumiera/151685.diagram b/uml/lumiera/151685.diagram
new file mode 100644
index 000000000..359efa5c4
--- /dev/null
+++ b/uml/lumiera/151685.diagram
@@ -0,0 +1,114 @@
+format 74
+
+classcanvas 128005 class_ref 176133 // OutputSlot
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 157.7 37 2000
+end
+fragment 128261 "output management"
+  xyzwh 123 14 1990 244 292
+end
+classcanvas 129029 class_ref 185221 // Allocation
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 260 126 2005
+end
+classcanvas 129541 class_ref 178565 // DataSink
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 14 191 2005
+end
+classcanvas 129925 class_ref 185349 // Connection
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 443 184 2000
+end
+classcanvas 130309 class_ref 185477 // OutputSlotImpl
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  color green
+  xyz 149 422 2000
+end
+classcanvas 130565 class_ref 185605 // ConnectionState
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 261 250 2000
+end
+classcanvas 130949 class_ref 185733 // ConcreteConnection
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  color lightgreen
+  xyz 432 357 2000
+end
+classcanvas 131205 class_ref 185861 // ConnectionStateManager
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 240 351 2000
+end
+classcanvas 132613 class_ref 178693 // BufferProvider
+  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
+  xyz 534 456 2000
+end
+fragment 132997 "concrete output driver"
+  xyzwh 123 309 1995 508 205
+end
+note 133125 "Client
+front-end"
+  xyzwh 15 270 2000 75 43
+note 133381 "Knowledge specific to this external output and driver"
+  xyzwh 564 338 2000 129 57
+relationcanvas 129157 relation_ref 212485 // 
+  decenter_begin 726
+  from ref 128005 z 2006 stereotype "<>" xyz 229 73 3000 to point 227 82
+  line 132485 z 2006 to point 295 82
+  line 132357 z 2006 to ref 129029
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 129669 relation_ref 212613 // 
+  geometry HV
+  from ref 129029 z 2006 stereotype "<>" xyz 70 155 3000 to point 52 153
+  line 130821 z 2006 to ref 129541
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+line 130053 ---+ decenter_end 876
+  from ref 129029 z 2006 to ref 128005
+relationcanvas 130181 relation_ref 212741 // 
+  from ref 129541 z 2006 stereotype "<>" xyz 92 206 3000 to ref 129925
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 130437 relation_ref 212869 // 
+  from ref 130309 z 2001 to ref 128005
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 130693 relation_ref 212997 // 
+  from ref 130565 z 2006 to ref 129029
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 131077 relation_ref 213125 // 
+  from ref 130949 z 2001 to ref 129925
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 131333 relation_ref 213253 // 
+  from ref 131205 z 2001 to ref 130565
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 131717 relation_ref 213509 // 
+  from ref 131205 z 2001 to ref 130949
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 131845 relation_ref 213637 // 
+  geometry HV
+  decenter_end 197
+  from ref 130309 z 2001 to point 264 438
+  line 132101 z 2001 to ref 131205
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 132741 relation_ref 213765 // 
+  from ref 130949 z 2001 to point 574 423
+  line 133253 z 2001 to ref 132613
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
+preferred_whz 723 654 1
+end
diff --git a/uml/lumiera/5.session b/uml/lumiera/5.session
index 87c7f7827..eff2c4d90 100644
--- a/uml/lumiera/5.session
+++ b/uml/lumiera/5.session
@@ -1,4 +1,4 @@
-window_sizes 1615 1020 270 1335 872 71
+window_sizes 1619 1028 270 1339 881 71
 diagrams
   classdiagram_ref 136453 // Session backbone
     631 352 100 4 0 0
@@ -8,8 +8,10 @@ diagrams
     663 648 100 4 0 0
   objectdiagram_ref 144005 // Play Process Structure
     562 424 100 4 0 0
-  active  sequencediagram_ref 145157 // output data exchange
+  sequencediagram_ref 145157 // output data exchange
     586 416 100 4 0 0
+  active  classdiagram_ref 151685 // Player Output
+    723 654 100 4 0 0
 end
 show_stereotypes
 selected 
@@ -18,7 +20,13 @@ open
   
   package_ref 128005 // design
   classview_ref 128389 // Controller Workings
-  classview_ref 136837 // PlayOut
+  class_ref 185221 // Allocation
+  class_ref 178565 // DataSink
+  class_ref 185349 // Connection
+  class_ref 185477 // OutputSlotImpl
+  class_ref 178693 // BufferProvider
+  
+  package_ref 132229 // Session
   class_ref 153733 // QueryFocusStack
   usecaseview_ref 128261 // config examples
   
diff --git a/uml/lumiera/generation_settings b/uml/lumiera/generation_settings
index 7ce8e827c..fd55246b6 100644
--- a/uml/lumiera/generation_settings
+++ b/uml/lumiera/generation_settings
@@ -244,6 +244,10 @@ ${docstring}${members}
 " // multiplicity != 1
   python_default_operation_definition "${@}${static}${abstract}def ${name}${(}${)}:
 ${docstring}${body}
+"
+  python_default_initoperation_definition "${@}${static}${abstract}def ${name}${(}${p0}${v0}${)}:
+${docstring}super(${class}, ${p0}).__init__()
+${body}
 "
   python_get "get${Name}"
   python_set "set${Name}"
diff --git a/uml/lumiera/lumiera.prj b/uml/lumiera/lumiera.prj
index 6c6cb4c64..b8b727236 100644
--- a/uml/lumiera/lumiera.prj
+++ b/uml/lumiera/lumiera.prj
@@ -1,6 +1,6 @@
-format 58
+format 74
 "lumiera"
-  revision 71
+  revision 73
   modified_by 5 "hiv"
   cpp_root_dir "../../src/"
 
@@ -9,13 +9,13 @@ format 58
   // class settings
   default_attribute_visibility protected default_relation_visibility protected default_operation_visibility public
   //class diagram settings
-  draw_all_relations yes hide_attributes no hide_operations no show_members_full_definition no show_members_visibility no show_members_stereotype no show_members_multiplicity no show_members_initialization no member_max_width 127 show_parameter_dir yes show_parameter_name yes package_name_in_tab yes class_drawing_mode natural drawing_language uml show_context_mode no auto_label_position yes show_infonote no shadow yes show_stereotype_properties no
+  draw_all_relations yes hide_attributes no hide_operations no hide_getset_operations no show_members_full_definition no show_members_visibility no show_members_stereotype no show_members_context no show_members_multiplicity no show_members_initialization no show_attribute_modifiers no member_max_width 127 show_parameter_dir yes show_parameter_name yes package_name_in_tab yes class_drawing_mode natural drawing_language uml show_context_mode no auto_label_position yes show_relation_modifiers no show_relation_visibility no show_infonote no shadow yes show_stereotype_properties no
   //use case diagram settings
   package_name_in_tab no show_context no auto_label_position yes draw_all_relations yes class_drawing_mode actor shadow yes show_stereotype_properties no
   //sequence diagram settings
-  show_full_operations_definition no write_horizontally yes class_drawing_mode natural drawing_language uml draw_all_relations yes shadow yes show_stereotype_properties no
+  show_full_operations_definition no write_horizontally yes class_drawing_mode natural drawing_language uml draw_all_relations yes shadow yes show_stereotype_properties no show_class_context_mode no show_msg_context_mode no
   //collaboration diagram settings
-  show_full_operations_definition no show_hierarchical_rank no write_horizontally yes drawing_language uml package_name_in_tab no show_context no draw_all_relations yes shadow yes show_stereotype_properties no
+  show_full_operations_definition no show_hierarchical_rank no write_horizontally yes drawing_language uml package_name_in_tab no show_context no show_msg_context no draw_all_relations yes shadow yes show_stereotype_properties no
   //object diagram settings
    write_horizontally yes package_name_in_tab no show_context no auto_label_position yes draw_all_relations yes shadow yes show_stereotype_properties no
   //component diagram settings
@@ -31,8 +31,8 @@ format 58
   package_name_in_tab yes show_context no show_opaque_action_definition yes auto_label_position yes write_flow_label_horizontally no draw_all_relations yes shadow yes
   show_infonote yes drawing_language uml show_stereotype_properties no
   
-  class_color yellow duration_color transparent continuation_color gray note_color blue fragment_color transparent subject_color transparent usecase_color yellow package_color transparent component_color green artifact_color green deploymentnode_color gray state_color yellow stateaction_color transparent activity_color lightgreen activityregion_color transparent activityaction_color mediumgreen parameterpin_color white 
-  font_size 8
+  class_color yellow duration_color transparent continuation_color gray note_color blue fragment_color transparent subject_color transparent usecase_color yellow package_color transparent component_color green artifact_color green deploymentnode_color gray state_color yellow stateaction_color transparent activity_color lightgreen activityregion_color transparent activitypartition_color transparent activityaction_color mediumgreen parameterpin_color white 
+  font_size 7
   diagram_format A4
 
   mark_for_import
diff --git a/uml/lumiera/stereotypes b/uml/lumiera/stereotypes
index d127ffd99..6d58da350 100644
--- a/uml/lumiera/stereotypes
+++ b/uml/lumiera/stereotypes
@@ -36,6 +36,8 @@
   activitynode_stereotypes  0
   activityaction_stereotypes  0
   activityobject_stereotypes  2 "datastore" "centralBuffer"
+  expansionregion_stereotypes  0
+  activitypartition_stereotypes  0
   pin_stereotypes  0
   component_stereotypes  7 "build" "component" "entity" "implement" "process" "service" "subsystem"
   deploymentnode_stereotypes  2 "cpu" "device"
@@ -45,6 +47,7 @@
   deploymentview_stereotypes  0
   classdiagram_stereotypes  0
   seqdiagram_stereotypes  0
+  msg_stereotypes  0
   coldiagram_stereotypes  0
   usecasediagram_stereotypes  0
   statediagram_stereotypes  0
diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index 9f4be7f2b..a3d7da184 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -1839,14 +1839,18 @@ When building the low-level model, the actual processing code is resolved and a
 Initially, only the parameter (descriptors) are present on the effect ~MObject, while the actual [[parameter providers|ParamProvider]] are created or wired (by the ConManager) on demand.
 
-
+
The primary interface used by the upper application layers to interact with the render engine, to create and manage ongoing [[calculation streams|CalcStream]].
 
 Below this facade, there is a thin adaptadion and forwarding layer, mainly talking to
 * the individual [[Calculation Streams|CalcStream]] created for each PlayProcess.
 * the FrameDispatcher, which translates such streams into a series of RenderJob entries
 * the [[Scheduler]], which is responsible to perform these jobs in a timely fashion
-
+ +!Quality of Service +Within the Facade, there is the definition of the {{{EngineService::Quality}}} tag, alongside with several pre-defined quality settings. +Actually this interface is a strategy, allowing to define quite specific quality levels, in case we need that. Clients can usually just use +these ~QoS-tags like enum values (they are copyable), without caring for the engine implementation related details.
A general identification scheme, ombining a human readable symbolic name, unique within a //specifically typed context,// and machine readable hash ID (LUID). ~Entry-IDs allow for asset-like position accounting and for type safe binding between configuration rules and model obects. They allow for creating an entry with symbolic id and distinct type, combined with an derived hash value, without the overhead in storage and instance management imposed by using a full-fledged Asset.
@@ -3444,7 +3448,7 @@ Thus the mapping is a copyable value object, based on a associative array. It ma
 First and foremost, mapping can be seen as a //functional abstraction.// As it's used at implementation level, encapsulation of detail types in't the primary concern, so it's a candidate for generic programming: For each of those use cases outlined above, a distinct mapping type is created by instantiating the {{{OutputMapping<DEF>}}} template with a specifically tailored definition context ({{{DEF}}}), which takes on the role of a strategy. Individual instances of this concrete mapping type may be default created and copied freely. This instantiation process includes picking up the concrete result type and building a functor object for resolving on the fly. Thus, in the way typical for generic programming, the more involved special details are moved out of sight, while being still in scope for the purpose of inlining. But there //is// a concern better to be encapsulated and concealed at the usage site, namely accessing the rules system. Thus mapping leads itself to the frequently used implementation pattern where there is a generic frontend as header, calling into opaque functions embedded within a separate compilation unit.
 
-
+
Within the Lumiera player and output subsystem, actually sending data to an external output requires to allocate an ''output slot''
 This is the central metaphor for the organisation of actual (system level) outputs; using this concept allows to separate and abstract the data calculation and the organisation of playback and rendering from the specifics of the actual output sink. Actual output possibilities (video in GUI window, video fullscreen, sound, Jack, rendering to file) can be added and removed dynamically from various components (backend, GUI), all using the same resolution and mapping mechanisms (&rarr; OutputManagement)
 
@@ -3453,17 +3457,76 @@ Each OutputSlot is an unique and distinguishable entity. It corresponds explicit
 
 In order to be usable as //output sink,// an output slot needs to be //allocated,// i.e. tied to and locked for a specific client. At any time, there may be only a single client using a given output slot this way. To stress this point: output slots don't provide any kind of inherent mixing capability; any adaptation, mixing, overlaying and sharing needs to be done within the nodes network producing the output data fed to the slot. (in special cases, some external output capabilities -- e.g. the Jack audio connection system -- may still provide additional mixing capabilities, but that's beyond the scope of the Lumiera application)
 
+[>img[Outputslot implementation structures|uml/fig151685.png]]
 Once allocated, the output slot returns a set of concrete ''sink handles'' (one for each physical channel expecting data). The calculating process feeds its results into those handles. Size and other characteristics of the data frames are assumed to be suitable, which typically won't be verified at that level anymore (but the sink handle provides a hook for assertions). Besides that, the allocation of an output slot reveals detailed ''timing expectations''. The client is required to comply to these timings when ''emitting'' data -- he's even required to provide a //current time specification,// alongside with the data. Yet the output slot has the ability to handle timing failures gracefully; the concrete output slot implementation is expected to provide some kind of de-click or de-flicker facility, which kicks in automatically when a timing failure is detected.
 
-!!!data exchange models
+!!!usage and implementation
+Clients retrieve just a reference to an output slot by asking a suitable OutputManager for an output possibility supporting a specific format. Usually, they just "claim" this slot by invoking {{{allocate()}}}, which behind the scenes causes building of the actual output connections and mechanisms. For each such connection -- corresponding to a single channel within the media format handled by this ~OutputSlot -- the client gets a smart-handle {{{DataSink}}}. The concrete ~OutputSlot implementation performs operations quite specific to the kind of output and external interface in question. All tese specific handling is embodied within the concrete connection implementation used by the concrete ~OutputSlot
+
+!!!timing expectations
+Besides the sink handles, allocation of an output slot defines some timing constraints, which are binding for the client. These [[Timings]] are detailed and explicit, including a grid of deadlines for each frame to deliver, plus a fixed //latency.// Within this context, &raquo;latency&laquo; means the requirement to be ahead of the nominal time by a certain amount, to compensate for the processing time necessary to propagate the media to the physical output pin. The output slot implementation itself is bound by external constraints to deliver data at a fixed framerate and aligned to an externally defined timing grid, plus the data needs to be handed over ahead of these time points by an time amount given by the latency. Depending on the data exchange model, there is an additional time window limiting the buffer management.
+
+The assumption is for the client to have elaborate timing capabilities at his disposal. More specifically, the client is assumed to be a job running within the engine scheduler and thus can be configured to run //after// another job has finished, and to run within certain time limits. Thus the client is able to provide a //current nominal time// -- which is suitably close to the actual wall clock time. The output slot implementation can be written such as to work out from this time specification if the call is timely or overdue -- and react accordingly.
+
+!!!Lifecycle and storage
+The concrete OutputSlot implementation is owned and managed by the facility actually providing the output possibility in question. For example, the GUI provides viewer widgets, while some sound output backend provides sound ports. The associated OutputSlot implementation object is required to stay alive as long as it's registered with some OutputManager. It needs to be de-registered explicitly prior to destruction -- and this deregistration may block until all clients using this slot did terminate. Beyond that, an output slot implementation is expected to handle all kinds of failures gracefully -- preferably just emitting a signal (callback functor).
+{{red{TODO 7/11: Deregistration is an unsolved problem....}}}
+
+!!!unified data exchange cycle
+The planned delivery time of a frame is used as an ID throughout that cycle
+# within a defined time window prior to delivery, the client can ''allocate and retrieve the buffer'' from the BufferProvider.
+# the client has to ''emit'' within a (short) time window prior to deadline
+# now the slot gets exclusive access to the buffer for output, signalling the buffer release to the buffer provider when done.
+
+!!!lapses
+This data exchange protocol operates on a rather low level; there is only limited protection against timing glitches
+|  !step|!problem ||!consequences | !protection |
+| (1)|out of time window ||interference with previous/later use of the buffer | prevent in scheduler! |
+|~|does not happen ||harmless as such | emit ignored |
+|~|buffer unavailable ||inhibits further operation | ↯ |
+| (2)|out of time window ||harmless as such | emit ignored |
+|~|out of order ||allowed, unless out of time | -- |
+|~|does not happen ||frame treated as glitch | -- |
+|~|buffer unallocated ||frame treated as glitch | emit ignored |
+| (3)|emit missing ||frame treated as glitch | -- |
+|~|fail to release buffer ||unable to use buffer further | mark unavailable |
+|~|buffer unavailable ||serious malfunction of playback | request playback stop |
+
+Thus there are two serious problem situations
+* allocating the buffer out of time window bears the danger of output data corruption; but the general assumption is for the scheduler to ensure each job start time remains within the defined window and all prerequisite jobs have terminated successfully. To handle clean-up, we additionally need special jobs running always, in order, and be notified of prerequisite failures.
+* failure to release a buffer in a timely fashion blocks any further use of that buffer, any further jobs in need of that buffer will die immediately. This situation can only be caused by a serious problem //within the slot, related to the output mechanism.// Thus there should be some kind of trigger (e.g. when this happens 2 times consecutively) to request aborting the playback or render as a whole.
+&rarr; SchedulerRequirements
+&rarr; OutputSlotDesign
+&rarr; OutputSlotImpl
+
+
+
+
The OutputSlot interface describes a point where generated media data can actually be sent to the external world. It is expected to be implemented by adapters and bridges to existing drivers or external interface libraries, like a viewer widget in the GUI, ALSA or Jack sound output, rendering to file, using an external media format library. The design of this core facility was rather difficult and stretched out over quite some time span -- this page documents the considerations and the decisions taken.
+
+!intention
+OutpotSlot is a metaphor to unify the organisation of actual (system level) outputs; using this concept allows to separate and abstract the data calculation and the organisation of playback and rendering from the specifics of the actual output sink. Actual output possibilities (video in GUI window, video fullscreen, sound, Jack, rendering to file) can be added and removed dynamically from various components (backend, GUI), all using the same resolution and mapping mechanisms (&rarr; OutputManagement)
+
+!design possibilities
+!!properties as a starting point
+* each OutputSlot is an unique and distinguishable entity. It corresponds explicitly to an external output
+* an output slot needs to be provided, configured and registered, using an implementation specifically tailored for the kind of media data
+* an output slot is always limited to a single kind of media, and to a single connection unit, but this connection may still be comprised of multiple channels.
+* in order to be usable as //output sink,// an output slot needs to be //allocated,// i.e. tied to and locked for a specific client.
+* this allocation is exclusive: at any time, there may be only a single client using a given output slot.
+* the calculating process feeds its results into //sink handles//&nbsp; provided by the allocated output slot.
+* allocation of an output slot leads to very specific [[timing expectations|Timings]]
+* the client is required to comply to these timings and operate according to a strictly defined protocol.
+* timing glitches will be detected due to this protocol; the output slot provides mechanisms for failing gracefully in these cases
+
+!!data exchange models
 Data is handed over by the client invoking an {{{emit(time,...)}}} function on the sink handle. Theoretically there are two different models how this data hand-over might be performed. This corresponds to the fact, that in some cases our own code manages the output and the buffers, while in other situations we intend to use existing library solutions or even external server applications to handle output
 ;buffer handover model
 :the client owns the data buffer and cares for allocation and de-allocation. The {{{emit()}}}-call just propagates a pointer to the buffer holding the data ready for output. The output slot implementation in turn has the liability to copy or otherwise use this data within a given time limit.
 ;shared buffer model
 :here the output mechanism owns the buffer. Within a certain time window prior to the expected time of the {{{emit()}}}-call, the client may obtain this buffer (pointer) to fill in the data. The slot implementation won't touch this buffer until the {{{emit()}}} handover, which in this case just provides the time and signalles the client is done with that buffer. If the data emitting handshake doesn't happen at all, it counts as late and superseded by the next handshake.
 
-!!!timing expectations
-Besides the sink handles, allocation of an output slot defines some timing constraints, which are binding for the client. These timings are detailed and explicit, including a grid of deadlines for each frame to deliver, plus a fixed //latency.// Within this context, &raquo;latency&laquo; means the requirement to be ahead of the nominal time by a certain amount, to compensate for the processing time necessary to propagate the media to the physical output pin. The output slot implementation itself is bound by external constraints to deliver data at a fixed framerate and aligned to an externally defined timing grid, plus the data needs to be handed over ahead of these time points by an time amount given by the latency. Depending on the data exchange model, there is an additional time window limiting the buffer management.
+!!relation to timing
+Besides the sink handles, allocation of an output slot defines some timing constraints, which are binding for the client. These include a grid of deadlines for each frame to deliver, plus a fixed //latency.// The output slot implementation itself is bound by external constraints to deliver data at a fixed framerate and aligned to an externally defined timing grid, plus the data needs to be handed over ahead of these time points by an time amount given by the latency. Depending on the data exchange model, there is an additional time window limiting the buffer management.
 
 The assumption is for the client to have elaborate timing capabilities at his disposal. More specifically, the client is assumed to be a job running within the engine scheduler and thus can be configured to run //after// another job has finished, and to run within certain time limits. Thus the client is able to provide a //current nominal time// -- which is suitably close to the actual wall clock time. The output slot implementation can be written such as to work out from this time specification if the call is timely or overdue -- and react accordingly.
 
@@ -3498,25 +3561,8 @@ The planned delivery time of a frame is used as an ID throughout that cycle
 # the client has to ''emit'' within a (short) time window prior to deadline
 # now the slot gets exclusive access to the buffer for output, signalling the buffer release to the buffer provider when done.
 
-!!!lapses
-This data exchange protocol operates on a rather low level; there is only limited protection against timing glitches
-|  !step|!problem ||!consequences | !protection |
-| (1)|out of time window ||interference with previous/later use of the buffer | prevent in scheduler! |
-|~|does not happen ||harmless as such | emit ignored |
-|~|buffer unavailable ||inhibits further operation | ↯ |
-| (2)|out of time window ||harmless as such | emit ignored |
-|~|out of order ||allowed, unless out of time | -- |
-|~|does not happen ||frame treated as glitch | -- |
-|~|buffer unallocated ||frame treated as glitch | emit ignored |
-| (3)|emit missing ||frame treated as glitch | -- |
-|~|fail to release buffer ||unable to use buffer further | mark unavailable |
-|~|buffer unavailable ||serious malfunction of playback | request playback stop |
-
-Thus there are two serious problem situations
-* allocating the buffer out of time window bears the danger of output data corruption; but the general assumption is for the scheduler to ensure each job start time remains within the defined window and all prerequisite jobs have terminated successfully. To handle clean-up, we additionally need special jobs running always, in order, and be notified of prerequisite failures.
-* failure to release a buffer in a timely fashion blocks any further use of that buffer, any further jobs in need of that buffer will die immediately. This situation can only be caused by a serious problem //within the slot, related to the output mechanism.// Thus there should be some kind of trigger (e.g. when this happens 2 times consecutively) to request aborting the playback or render as a whole.
-&rarr; SchedulerRequirements
-&rarr; OutputSlotImpl
+&rarr; OutputSlotImpl +
OutputSlot is an abstraction, allowing unified treatment of various physical output connections from within the render jobs. The actual output slot is a subclass object, created and managed from the "driver code" for a specific output connection. Moreover, each output slot will be outfitted with a concrete BufferProvider to reflect the actual buffer handling policy applicable for this specific output connection. Some output connections might e.g. require delivery of the media data into a buffer residing on external hardware, while others work just fine when pointed to some arbitrary memory block holding generated data.

From d27e3b15a95ce0204854935ae85b6e95261acab7 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 23 Dec 2011 02:22:38 +0100
Subject: [PATCH 23/87] clarify the handling of specific output operation modes
 (e.g. number of channels)

---
 doc/devel/uml/fig151685.png                   | Bin 26732 -> 26030 bytes
 src/proc/play/output-slot.cpp                 |  26 ++++----
 src/proc/play/output-slot.hpp                 |  62 +++++++++++++-----
 src/proc/play/play-service.cpp                |   2 +-
 src/proc/play/render-configurator.cpp         |   2 +-
 .../proc/play/diagnostic-output-slot.hpp      |  29 ++++++--
 uml/lumiera/151685.diagram                    |  38 +++++------
 uml/lumiera/5.session                         |   4 +-
 uml/lumiera/lumiera.prj                       |   2 +-
 wiki/renderengine.html                        |  22 +++++--
 10 files changed, 126 insertions(+), 61 deletions(-)

diff --git a/doc/devel/uml/fig151685.png b/doc/devel/uml/fig151685.png
index a84679ddfc3db15f873cd102bc00ff9f97c7f5a9..77b41e4461a4ee43906885387f508dac49cac77f 100644
GIT binary patch
literal 26030
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�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
KlP^S=`u_)cmFs~3

diff --git a/src/proc/play/output-slot.cpp b/src/proc/play/output-slot.cpp
index e93acb278..87eaf5051 100644
--- a/src/proc/play/output-slot.cpp
+++ b/src/proc/play/output-slot.cpp
@@ -38,14 +38,6 @@ namespace play {
   
   
   
-  namespace { // hidden local details of the service implementation....
-    
-  } // (End) hidden service impl details
-  
-  
-  
-  
-  
   
   OutputSlot::~OutputSlot() { }  // emit VTables here....
   
@@ -68,15 +60,26 @@ namespace play {
   }
   
   
-  /** */
+  /** claim this OutputSlot for active use as output sink(s).
+   *  At any point, a given slot can only be used for a single
+   *  ongoing output process (which may serve several channels though).
+   *  The assumption is for the OutputSlot to be picked through a query
+   *  to some OutputManater, so the parameters (resolution, sample rate...)
+   *  should be suited for the intended use. Thus no additional configuration
+   *  is necessary.
+   * @return Allocation representing the "connected state" from the client's POV.
+   *         The client may retrieve the effectively required Timings from there,
+   *         as well as the actual output sinks, ready for use.
+   * @remarks calls back into #buildState, where the concrete OutputSlot
+   *         is expected to provide a private Connection implementation,
+   *         subclassing OutputSlot::Allocation 
+   */
   OutputSlot::Allocation&
   OutputSlot::allocate()
   {
     if (!isFree())
       throw error::Logic ("Attempt to open/allocate an OutputSlot already in use.");
     
-    UNIMPLEMENTED ("internal interface to determine the number of channel-connections");
-    
     state_.reset (this->buildState());
     return *state_;
   }
@@ -110,7 +113,6 @@ namespace play {
       connection.discard(data2emit);
   }
   
-
   
   
   
diff --git a/src/proc/play/output-slot.hpp b/src/proc/play/output-slot.hpp
index 8c7dd9c86..860232b1f 100644
--- a/src/proc/play/output-slot.hpp
+++ b/src/proc/play/output-slot.hpp
@@ -26,9 +26,39 @@
  ** using this concept allows to separate and abstract the data calculation and the organisation
  ** of playback and rendering from the specifics of the actual output sink. Actual output
  ** possibilities can be added and removed dynamically from various components (backend, GUI),
- ** all using the same resolution and mapping mechanisms 
+ ** all using the same resolution and mapping mechanisms
  **
- ** @see diagnostic-output-slot.hpp  ////TODO
+ ** Each OutputSlot is an unique and distinguishable entity. It corresponds explicitly to an
+ ** external output, or a group of such outputs (e.g. left and right sound card output channels),
+ ** or an output file or similar capability accepting media content. Initially, an output slot
+ ** needs to be provided, configured and registered, using an implementation suitable for the
+ ** kind of media data to be output (sound, video) and also suitable for the special circumstances
+ ** of the output capability (render a file, display video in a GUI widget, send video to some
+ ** full screen display, establish a Jack port, just use some kind of "sound out"). An output
+ ** slot is always limited to a single kind of media, and to a single connection unit, but
+ ** this connection may still be comprised of multiple channels 
+ ** (e.g. stereoscopic video, multichannel sound).
+ ** 
+ ** In order to be usable as output sink, an output slot needs to be \em allocated: At any time,
+ ** there may be only a single client using a given output slot this way. To stress this point:
+ ** output slots don't provide any kind of inherent mixing capability; any adaptation, mixing,
+ ** overlaying and sharing needs to be done within the nodes network producing the output data
+ ** to be fed into the slot. (in special cases, some external output capabilities — e.g. the
+ ** Jack audio connection system — may still provide additional mixing capabilities,
+ ** but that's beyond the scope of the Lumiera application)
+ ** 
+ ** Once allocated, the output slot returns a set of concrete sink handles (one for each
+ ** physical channel expecting data). The calculating process feeds its results into those handles.
+ ** Size and other characteristics of the data frames are assumed to be suitable, which typically
+ ** won't be verified at that level anymore. Besides that, the allocation of an output slot reveals
+ ** detailed timing expectations. The client is required to comply to these timings when \em emitting
+ ** data — he's even required to provide a current time specification, alongside with the data.
+ ** Based on this information, the output slot has the ability to handle timing failures gracefully;
+ ** the concrete output slot implementation is expected to provide some kind of de-click or
+ ** de-flicker facility, which kicks in automatically when a timing failure is detected.
+ **
+ ** @see OutputSlotProtocol_test
+ ** @see diagnostic-output-slot.hpp
  */
 
 
@@ -42,25 +72,18 @@
 #include "proc/engine/buffer-provider.hpp"
 #include "proc/play/timings.hpp"
 #include "lib/iter-source.hpp"
-//#include "lib/sync.hpp"
 
 #include 
 #include 
-//#include 
-//#include 
-//#include 
 
 
 namespace proc {
 namespace play {
-
+  
   using proc::engine::BuffHandle;
   using proc::engine::BufferProvider;
   using lib::time::TimeValue;
-//using std::string;
-
-//using std::vector;
-//using std::tr1::shared_ptr;
+  
   using boost::scoped_ptr;
   
   
@@ -71,10 +94,16 @@ namespace play {
   
   
   
-  /********************************************************************
+  /********************************************************************************
    * Interface: Generic output sink.
-   * 
-   * @todo write type comment
+   * An OutputSlot represents the possibility to send data through multiple
+   * channels to some kind of external sink (video in GUI window, video full screen,
+   * sound, Jack, rendering to file). Clients are expected to retrieve a suitably
+   * preconfigured implementation from some OutputManager instance. An OutputSlot
+   * needs to be \em claimed for output by invoking #allocate, which returns a
+   * representation of the connection state. This operation is exclusive.
+   * The actual \link DataSink output sinks \endlink can be retrieved
+   * through the Allocation object returned from there.
    */
   class OutputSlot
     : boost::noncopyable
@@ -87,6 +116,9 @@ namespace play {
       
       scoped_ptr state_;
       
+      /** build the \em connected state,
+       *  based on the existing configuration
+       *  within this concrete OutputSlot */
       virtual ConnectionState* buildState() =0;
       
       
@@ -133,7 +165,7 @@ namespace play {
       
     public:
       BuffHandle lockBufferFor(FrameID);
-      void emit(FrameID, BuffHandle const&, TimeValue currentTime = Time::MAX);    ///////////////TICKET #855 
+      void emit(FrameID, BuffHandle const&, TimeValue currentTime = Time::ANYTIME); 
     };
   
   
diff --git a/src/proc/play/play-service.cpp b/src/proc/play/play-service.cpp
index 5ddb4fe3f..0674fd934 100644
--- a/src/proc/play/play-service.cpp
+++ b/src/proc/play/play-service.cpp
@@ -179,7 +179,7 @@ namespace play {
   Play::Controller
   PlayService::connect (ModelPorts dataGenerators, POutputManager outputPossibilities)
   {
-    Timings playbackTimings; /////////////////////////////////////////////////////////////TODO
+    Timings playbackTimings;       //////////////////////////////////////////////////////////////////////TICKET #875
     
     return pTable_->establishProcess(
             PlayProcess::initiate(dataGenerators, 
diff --git a/src/proc/play/render-configurator.cpp b/src/proc/play/render-configurator.cpp
index 42fc31a37..ee0552dfe 100644
--- a/src/proc/play/render-configurator.cpp
+++ b/src/proc/play/render-configurator.cpp
@@ -107,7 +107,7 @@ namespace play {
             Timings nominalTimings = activeOutputConnection.getTimingConstraints()
                                                            .constrainedBy(playbackTimings_);
             
-            return EngineService::instance().calculate(port, nominalTimings, activeOutputConnection, renderQuality_);
+            return EngineService::instance().calculate (port, nominalTimings, activeOutputConnection, renderQuality_);
           }
         
         
diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp
index 4a6f758d2..ff948d814 100644
--- a/tests/components/proc/play/diagnostic-output-slot.hpp
+++ b/tests/components/proc/play/diagnostic-output-slot.hpp
@@ -227,20 +227,39 @@ namespace play {
   
   /********************************************************************
    * Helper for unit tests: Mock output sink.
-   * 
-   * @todo write type comment
+   * Complete implementation of the OutputSlot interface, with some
+   * additional stipulations to support unit testing.
+   * - the implementation uses a special protocol output buffer,
+   *   which stores each "frame" in memory for later investigation
+   * - the output data in the buffers handed over from client
+   *   actually hold an TestFrame instance 
+   * - the maximum number of channels and the maximum number
+   *   of acceptable frames is limited to 5 and 100.
+   * @warning any Captured (test) data from all individual instances
+   *   remains in memory until shutdown of the current executable
    */
   class DiagnosticOutputSlot
     : public OutputSlot
     {
       
       static const uint MAX_CHANNELS = 5;
-        
+      
+      /** @note a real OutputSlot implementation
+       * would rely on some kind of embedded
+       * configuration here */
+      uint
+      getOutputChannelCount()
+        {
+          return MAX_CHANNELS;
+        }
+      
+      
       /** hook into the OutputSlot frontend */
       ConnectionState*
       buildState()
         {
-          return new SimulatedOutputSequences(MAX_CHANNELS);
+          return new SimulatedOutputSequences(
+                        getOutputChannelCount());
         }
         
       /** @internal is self-managed and non-copyable.
@@ -254,7 +273,7 @@ namespace play {
       accessSequence (uint channel)
         {
           REQUIRE (!isFree(), "diagnostic OutputSlot not (yet) connected");
-          REQUIRE (channel <= MAX_CHANNELS);
+          REQUIRE (channel <= getOutputChannelCount());
           return static_cast (*state_).at(channel);
         }
       
diff --git a/uml/lumiera/151685.diagram b/uml/lumiera/151685.diagram
index 359efa5c4..19335767f 100644
--- a/uml/lumiera/151685.diagram
+++ b/uml/lumiera/151685.diagram
@@ -2,64 +2,64 @@ format 74
 
 classcanvas 128005 class_ref 176133 // OutputSlot
   draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
-  xyz 157.7 37 2000
+  xyz 155.04 38.2 2000
 end
 fragment 128261 "output management"
-  xyzwh 123 14 1990 244 292
+  xyzwh 126.62 17.82 1990 240 288
 end
 classcanvas 129029 class_ref 185221 // Allocation
   draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
-  xyz 260 126 2005
+  xyz 247.02 129.02 2005
 end
 classcanvas 129541 class_ref 178565 // DataSink
   draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
-  xyz 14 191 2005
+  xyz 13.16 194.12 2005
 end
 classcanvas 129925 class_ref 185349 // Connection
   draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
-  xyz 443 184 2000
+  xyz 419.32 189.12 2000
 end
 classcanvas 130309 class_ref 185477 // OutputSlotImpl
   draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
   color green
-  xyz 149 422 2000
+  xyz 149.12 420.84 2000
 end
 classcanvas 130565 class_ref 185605 // ConnectionState
   draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
-  xyz 261 250 2000
+  xyz 249.88 248.84 2000
 end
 classcanvas 130949 class_ref 185733 // ConcreteConnection
   draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
   color lightgreen
-  xyz 432 357 2000
+  xyz 408.32 358 2000
 end
 classcanvas 131205 class_ref 185861 // ConnectionStateManager
   draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
-  xyz 240 351 2000
+  xyz 228.88 351 2000
 end
 classcanvas 132613 class_ref 178693 // BufferProvider
   draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers 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_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
-  xyz 534 456 2000
+  xyz 484.36 459.64 2000
 end
 fragment 132997 "concrete output driver"
-  xyzwh 123 309 1995 508 205
+  xyzwh 126.68 309.48 1995 464 204
 end
 note 133125 "Client
 front-end"
-  xyzwh 15 270 2000 75 43
+  xyzwh 15.36 270.88 2000 75 43
 note 133381 "Knowledge specific to this external output and driver"
-  xyzwh 564 338 2000 129 57
+  xyzwh 536.04 322.88 2000 138 58
 relationcanvas 129157 relation_ref 212485 // 
   decenter_begin 726
-  from ref 128005 z 2006 stereotype "<>" xyz 229 73 3000 to point 227 82
-  line 132485 z 2006 to point 295 82
+  from ref 128005 z 2006 stereotype "<>" xyz 230 72 3000 to point 227.72 82.12
+  line 132485 z 2006 to point 294.96 83.12
   line 132357 z 2006 to ref 129029
   no_role_a no_role_b
   no_multiplicity_a no_multiplicity_b
 end
 relationcanvas 129669 relation_ref 212613 // 
   geometry HV
-  from ref 129029 z 2006 stereotype "<>" xyz 70 155 3000 to point 52 153
+  from ref 129029 z 2006 stereotype "<>" xyz 65 158 3000 to point 51 155
   line 130821 z 2006 to ref 129541
   no_role_a no_role_b
   no_multiplicity_a no_multiplicity_b
@@ -67,7 +67,7 @@ end
 line 130053 ---+ decenter_end 876
   from ref 129029 z 2006 to ref 128005
 relationcanvas 130181 relation_ref 212741 // 
-  from ref 129541 z 2006 stereotype "<>" xyz 92 206 3000 to ref 129925
+  from ref 129541 z 2006 stereotype "<>" xyz 188 210 3000 to ref 129925
   no_role_a no_role_b
   no_multiplicity_a no_multiplicity_b
 end
@@ -99,13 +99,13 @@ end
 relationcanvas 131845 relation_ref 213637 // 
   geometry HV
   decenter_end 197
-  from ref 130309 z 2001 to point 264 438
+  from ref 130309 z 2001 to point 252 433
   line 132101 z 2001 to ref 131205
   no_role_a no_role_b
   no_multiplicity_a no_multiplicity_b
 end
 relationcanvas 132741 relation_ref 213765 // 
-  from ref 130949 z 2001 to point 574 423
+  from ref 130949 z 2001 to point 524.68 414
   line 133253 z 2001 to ref 132613
   no_role_a no_role_b
   no_multiplicity_a no_multiplicity_b
diff --git a/uml/lumiera/5.session b/uml/lumiera/5.session
index eff2c4d90..0d5cb5160 100644
--- a/uml/lumiera/5.session
+++ b/uml/lumiera/5.session
@@ -5,13 +5,13 @@ diagrams
   objectdiagram_ref 138885 // ModelAssetRelations
     730 488 100 4 0 0
   classdiagram_ref 143877 // Player Entities
-    663 648 100 4 0 0
+    663 654 100 4 0 0
   objectdiagram_ref 144005 // Play Process Structure
     562 424 100 4 0 0
   sequencediagram_ref 145157 // output data exchange
     586 416 100 4 0 0
   active  classdiagram_ref 151685 // Player Output
-    723 654 100 4 0 0
+    643 590 92 4 0 0
 end
 show_stereotypes
 selected 
diff --git a/uml/lumiera/lumiera.prj b/uml/lumiera/lumiera.prj
index b8b727236..341a05212 100644
--- a/uml/lumiera/lumiera.prj
+++ b/uml/lumiera/lumiera.prj
@@ -1,6 +1,6 @@
 format 74
 "lumiera"
-  revision 73
+  revision 74
   modified_by 5 "hiv"
   cpp_root_dir "../../src/"
 
diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index a3d7da184..9b27ae55f 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -3362,7 +3362,7 @@ While actually data frames are //pulled,// on a conceptual level data is assumed
 As both of these specifications are given by [[Pipe]]-~IDs, the actual designation information may be reduced. Much can be infered from the circumstances, because any pipe includes a StreamType, and an output designation for an incompatible stream type is irrelevant. (e.g. and audio output when the pipe currently in question deals with video)
 
-
+
//writing down some thoughts//
 
 * ruled out the system outputs as OutputDesignation.
@@ -3397,6 +3397,12 @@ The relation between the central OutputDirector and the peripheral OutputManager
 
 For a viewer widget in the GUI this yields exactly the expeted behaviour, but in other cases, e.g. for sound output, we need more general, more globally scoped output slots. In these cases, when a local mapping is absent, the query for output resolution is passed on up to the  OutputDirector, drawing on the collection of globally available output slots for that specific kind of media.
 {{red{open question 11/11: is it possible to retrieve a slot from another peripheral node?}}}
+
+!!!output modes
+Most output connections and drivers embody some kind of //operation mode:// Display is characterised by resolution and colour depth, sound by number of channels and sampling rate, amongst others. There might be a mismatch with the output expectations represented by [[output designations|OutputDesignation]] within the model. Nontheless we limit those actual operation modes strictly to the OutputManager realm. They should not leak out into the model within the session.
+In practice, this decision might turn out to be rather rigid, but some additional mechanisms allow for more flexibility
+* when [[connecting|ViewerPlayConnection]] timeline to viewer and output, stream type conversions may be added automatically or manually
+* since resolution of an output designation into an OutputSlot is initiated by querying an output manager, this query might include additional constraints, which //some// (not all) concrete output implementations might evaluate to provide an more suitably configured output slot variant.
 
@@ -3416,7 +3422,7 @@ Note that an OutputSlot acts as a unit for registration and also for allocating The //registration//&nbsp; of an output slot installs a functor or association rule, which later on allows to claim and connect up to a preconfigured number of channels. This allocation or usage of a slot is exclusive (i.e. only a single client at a time can allocate a slot, even if not using all the possible channels). Each output manager instance may or may not be configured with a //fall-back rule:// when no association or mapping can be established locally, the connection request might be passed down to the global OutputDirector. Again, we can expect this to be the standard behaviour for sound, while video likely will rather be handled locally, e.g. within a GUI widget (but we're not bound to configure it exactly this way)
-
+
An output mapping serves to //resolve//&nbsp; [[output designations|OutputDesignation]].
 
 !Mapping situations
@@ -3428,7 +3434,7 @@ The //registration//&nbsp; of an output slot installs a functor or associati
 :Thus, in this case we resolve similar to a bus connection, possibly overridden by already pre-existing or predefined connections.
 ;switch board
 :a viewer might receive multiple outputs and overlays, necessitating a user operated control to select what's actually to be displayed
-:Thus, in this case we need a backwards resolution at the lower end of the output network, to connect to the model port as defined by this viewer SwitchBoard
+:Thus, in this case we need a backwards resolution at the lower end of the output network, to connect to the model port as selected through the viewer's SwitchBoard
 ;global pipes or virtual media
 :when binding a Sequence as Timeline or VirtualClip, a mapping from output designations used within the Sequence to virtual channels or global pipes is required
 :Thus, in this case we need to associate output designations with ~Pipe-IDs encountered in the context according to some rules &mdash; again maybe overridden by pre-existing connections
@@ -3443,12 +3449,12 @@ All these mapping steps are listed here, because they exhibit a common pattern.
 * there is an //unconnected//&nbsp; state.
 
 !Implementation notes
-Thus the mapping is a copyable value object, based on a associative array. It may be attached to a model object and persisted alongside. The mapping is assumed to run a defaults query when necessary. To allow for that, it should be configured with a query template (string). Frequently, special //default pipe// markers will be used at places where no distinct pipe-ID is specified explicitly. Besides that, invocations might supply additional predicates (e.g. {{{ord(2)}}} to point at "the second stream of this kind") thereby hinting the defaults resolution. Moreover, the mapping needs a way to retrieve the set of possible results, allowing to filter the results of the rules based default. Mappings might be defined explicitly. Instead of storing a //bottom value,// an {{{isDefined()}}} predicate might be preferable.
+Thus the mapping is a copyable value object, using an associative array. It may be attached to a model object and persisted alongside. The mapping is assumed to run a defaults query when necessary. To allow for that, it should be configured with a query template (string). Frequently, special //default pipe// markers will be used at places where no distinct pipe-ID is specified explicitly. Besides that, invocations might supply additional predicates (e.g. {{{ord(2)}}} to point at "the second stream of this kind") thereby hinting the defaults resolution. Moreover, the mapping needs a way to retrieve the set of possible results, allowing to filter the results of the rules based default. Mappings might be defined explicitly. Instead of storing a //bottom value,// an {{{isDefined()}}} predicate might be preferable.
 
 First and foremost, mapping can be seen as a //functional abstraction.// As it's used at implementation level, encapsulation of detail types in't the primary concern, so it's a candidate for generic programming: For each of those use cases outlined above, a distinct mapping type is created by instantiating the {{{OutputMapping<DEF>}}} template with a specifically tailored definition context ({{{DEF}}}), which takes on the role of a strategy. Individual instances of this concrete mapping type may be default created and copied freely. This instantiation process includes picking up the concrete result type and building a functor object for resolving on the fly. Thus, in the way typical for generic programming, the more involved special details are moved out of sight, while being still in scope for the purpose of inlining. But there //is// a concern better to be encapsulated and concealed at the usage site, namely accessing the rules system. Thus mapping leads itself to the frequently used implementation pattern where there is a generic frontend as header, calling into opaque functions embedded within a separate compilation unit.
 
-
+
Within the Lumiera player and output subsystem, actually sending data to an external output requires to allocate an ''output slot''
 This is the central metaphor for the organisation of actual (system level) outputs; using this concept allows to separate and abstract the data calculation and the organisation of playback and rendering from the specifics of the actual output sink. Actual output possibilities (video in GUI window, video fullscreen, sound, Jack, rendering to file) can be added and removed dynamically from various components (backend, GUI), all using the same resolution and mapping mechanisms (&rarr; OutputManagement)
 
@@ -3468,6 +3474,9 @@ Besides the sink handles, allocation of an output slot defines some timing const
 
 The assumption is for the client to have elaborate timing capabilities at his disposal. More specifically, the client is assumed to be a job running within the engine scheduler and thus can be configured to run //after// another job has finished, and to run within certain time limits. Thus the client is able to provide a //current nominal time// -- which is suitably close to the actual wall clock time. The output slot implementation can be written such as to work out from this time specification if the call is timely or overdue -- and react accordingly.
 
+!!!output modes
+some concrete output connections and drivers embody a specific operation mode (e.g. sample rate or number of channels). The decision and setup of these operational configuration is initiated together with the [[resolution|OutputMapping]] of an OutputDesignation within the OutputManager, finally leading to an output slot (reference), which can be assumed to be suitably configured, before the client allocates this slot for active use. Moreover, an individual output sink (corresponding to a single channel) may just remain unused -- until there is an {{{emit()}}} call and successful data handover, this channel will just feature silence or remain black. (More flexible system, e.g. Jack, allow to generate an arbitrary number of output pins -- Lumiera will support this by allowing to set up additional output slots and attach this information to the current session &rarr; SessionConfigurationAttachment)
+
 !!!Lifecycle and storage
 The concrete OutputSlot implementation is owned and managed by the facility actually providing the output possibility in question. For example, the GUI provides viewer widgets, while some sound output backend provides sound ports. The associated OutputSlot implementation object is required to stay alive as long as it's registered with some OutputManager. It needs to be de-registered explicitly prior to destruction -- and this deregistration may block until all clients using this slot did terminate. Beyond that, an output slot implementation is expected to handle all kinds of failures gracefully -- preferably just emitting a signal (callback functor).
 {{red{TODO 7/11: Deregistration is an unsolved problem....}}}
@@ -5368,6 +5377,9 @@ The Session object is a singleton &mdash; actually it is a »~PImpl«-Facade
 &rarr; see [[relation of timeline, sequences and objects|TimelineSequences]]
 
+
+
While the core of the persistent session state corresponds just to the HighLevelModel, there is additionaly attached state, annotations and specific bindings, which allow to connect the session model to the local application configuration on each system. A typical example would be the actual output channels, connections and drivers to use on a specific system. In a Studio setup, these setup and wiring might be quite complex, it may be specific to just a single project, and the user might want to work on the same project on different systems. This explains why we can't just embody these configuration information right into the actual model.
+
Querying and retrieving objects within the session model is always bound to a [[scope|PlacementScope]]. When using the //dedicated API,// this scope is immediately defined by the object used to issue the query, like e.g. when searching the contents of a track. But when using the //generic API,// this scope is rather implicit, because in this case a (stateful) QueryFocus object is used to invoke the queries. Somewhat in-between, the top-level session API itself exposes dedicated query functions working on the whole-session scope (model root).
 Based on the PlacementIndex, the treelike scope structure can be explored efficiently; each Placement attached to the session knows its parent scope. But any additional filtering currently is implemented on top of this basic scope exploration, which obviously may degenerate when searching large scopes and models. Filtering may happen implicitly; all scope queries are parametrised to a specific kind of MObject, while the PlacementIndex deals with all kinds of {{{Placement<MObject>}}} uniformly. Thus, more specifically typed queries automatically have to apply a type filter based on the RTTI of the discovered placements. The plan is later to add specialised sub-indices and corresponding specific query functions to speed up the most frequently used kinds of queries.

From 451b0abec523e1f305531cee9917c2326026708b Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 23 Dec 2011 03:55:01 +0100
Subject: [PATCH 24/87] spelling and typos

---
 src/backend/media-access-facade.hpp           |  4 +-
 src/gui/notification-interface-proxy.hpp      |  2 +-
 src/gui/notification-service.cpp              |  2 +-
 src/gui/notification-service.hpp              |  2 +-
 .../widgets/timeline/timeline-view-window.hpp |  2 +-
 src/include/guinotification-facade.h          |  4 +-
 src/lib/diagnostic-context.hpp                | 20 ++---
 src/lib/meta/typelist-util.hpp                |  2 +-
 src/proc/asset/buildinstruct.hpp              |  2 +-
 src/proc/asset/struct-factory-impl.hpp        |  2 +-
 src/proc/control/command-def.hpp              |  2 +-
 src/proc/engine/nodewiring-def.hpp            |  6 +-
 .../components/backend/media-access-mock.cpp  |  2 +-
 wiki/renderengine.html                        | 78 +++++++++----------
 14 files changed, 66 insertions(+), 64 deletions(-)

diff --git a/src/backend/media-access-facade.hpp b/src/backend/media-access-facade.hpp
index 3e51d96fa..9604360af 100644
--- a/src/backend/media-access-facade.hpp
+++ b/src/backend/media-access-facade.hpp
@@ -83,8 +83,8 @@ namespace backend {
   
   
   /** 
-   * Descriptor holding the global informations,
-   * needed for further handling this media within Lumiera.
+   * Descriptor holding the global information record
+   * required for further handling this kind of media within Lumiera.
    */
   struct MediaDesc
     {
diff --git a/src/gui/notification-interface-proxy.hpp b/src/gui/notification-interface-proxy.hpp
index 79500e8df..2269513e5 100644
--- a/src/gui/notification-interface-proxy.hpp
+++ b/src/gui/notification-interface-proxy.hpp
@@ -1,5 +1,5 @@
 /*
-  Notification(Proxy)  -  public service allowing to push informations into the GUI
+  Notification(Proxy)  -  public service allowing to push information into the GUI
 
   Copyright (C)         Lumiera.org
     2008,               Hermann Vosseler 
diff --git a/src/gui/notification-service.cpp b/src/gui/notification-service.cpp
index 0cfd3c826..a27d5a641 100644
--- a/src/gui/notification-service.cpp
+++ b/src/gui/notification-service.cpp
@@ -1,5 +1,5 @@
 /*
-  NotificationService  -  public service allowing to push informations into the GUI
+  NotificationService  -  public service allowing to push information into the GUI
 
   Copyright (C)         Lumiera.org
     2008,               Hermann Vosseler 
diff --git a/src/gui/notification-service.hpp b/src/gui/notification-service.hpp
index d7e2e218b..427ec045d 100644
--- a/src/gui/notification-service.hpp
+++ b/src/gui/notification-service.hpp
@@ -1,5 +1,5 @@
 /*
-  NOTIFICATION-SERVICE.hpp  -  public service allowing to push informations into the GUI
+  NOTIFICATION-SERVICE.hpp  -  public service allowing to push information into the GUI
 
   Copyright (C)         Lumiera.org
     2008,               Hermann Vosseler 
diff --git a/src/gui/widgets/timeline/timeline-view-window.hpp b/src/gui/widgets/timeline/timeline-view-window.hpp
index f4c6fa558..1b4b19888 100644
--- a/src/gui/widgets/timeline/timeline-view-window.hpp
+++ b/src/gui/widgets/timeline/timeline-view-window.hpp
@@ -78,7 +78,7 @@ public:
    *       from the session / current timeline to be displayed. It doesn't
    *       make sense to display raw time values here, as each timeline might
    *       turn out to have a different origin; this is the result of resolving
-   *       a placement, and only the session has the necessary informations...
+   *       a placement, and only the session has the necessary information...
    */
   Offset get_time_offset() const;
 
diff --git a/src/include/guinotification-facade.h b/src/include/guinotification-facade.h
index 8c0834d2c..7e10bcbd0 100644
--- a/src/include/guinotification-facade.h
+++ b/src/include/guinotification-facade.h
@@ -1,5 +1,5 @@
 /*
-  GUINOTIFICATION-FACADE.h  -  access point for pushing informations into the GUI
+  GUINOTIFICATION-FACADE.h  -  access point for pushing information into the GUI
 
   Copyright (C)         Lumiera.org
     2008,               Hermann Vosseler 
@@ -24,7 +24,7 @@
  ** Major public Interface of the Lumiera GUI. While generally speaking, the GUI
  ** controls the application and thus acts on its own, it exposes some services
  ** usable by scripts or the two lower layers. The main purpose of these services
- ** is to push informations and status updates into the GUI.
+ ** is to push status updates and similar information up into the GUI.
  **
  ** @see notification-service.hpp implementation
  ** @see gui::GuiFacade
diff --git a/src/lib/diagnostic-context.hpp b/src/lib/diagnostic-context.hpp
index 28f97c5c1..1fc658e69 100644
--- a/src/lib/diagnostic-context.hpp
+++ b/src/lib/diagnostic-context.hpp
@@ -21,15 +21,15 @@
 */
 
 /** @file diagnostic-context.hpp
- ** Facility for collecting diagnostic informations explicitly.
+ ** Facility for collecting diagnostic context information explicitly.
  ** Unlike a trace logging run, this facility is intended to be fed explicitly with
  ** diagnostic information describing the currently ongoing operation in a semantic
- ** high-level manner. The rationale is to pinpoint \em those informations which aren't
- ** obvious when just looking at a callstack with the debugger. Instances of the class
- ** DiagnosticContext should be placed explicitly as automatic (stack) variable
- ** into selected relevant scopes; these "information frames" can be accessed
- ** from an enclosed scope  as a per-thread stack. DiagnosticContext provides
- ** an controlled environment for adding diagnostic code on demand; typically
+ ** high-level manner. The rationale is to pinpoint \em those pieces of information,
+ ** which aren't obvious when just looking at a callstack with the debugger.
+ ** Instances of the class DiagnosticContext should be placed explicitly as automatic
+ ** (stack) variable into selected relevant scopes; these "information frames" could
+ ** be accessed from an enclosed scope  as a per-thread stack. DiagnosticContext
+ ** provides an controlled environment for adding diagnostic code on demand; typically
  ** to be configured such as to resolve into an empty class for release builds.
  ** 
  ** As of 2/10, this is an experimental feature in evaluation. To start with,
@@ -60,15 +60,17 @@ namespace lib {
 #ifdef NOBUG_MODE_ALPHA      ////////////////////////TODO don't we need the handle in BETA builds for resource logging?
   
   /** 
-   * Diagnostic data frame to collect specific informations concerning a scope.
+   * Diagnostic data frame to collect specific information concerning a scope.
    * To be placed explicitly as an automatic (stack) variable. Provides a controlled
    * environment for hooking up diagnostic code. Within each thread, a stack of
    * such information frames concerning nested scopes is maintained automatically.
    * It can be accessed via static API.
-   * @warning never store this into global data structures.
+   * @warning relies on thread-local access; never use this within global data structures.
    * @note as of 2/10 used for housing the NoBug resource tracker handle
    *       in conjunction with object monitor based locking
    * @see sync.hpp
+   * @todo 12/2011 : not in use currently, but the concept seems useful
+   *       and should be generalised.                         //////////////////////////////////////TICKET #687 
    */
   class DiagnosticContext
     : boost::noncopyable
diff --git a/src/lib/meta/typelist-util.hpp b/src/lib/meta/typelist-util.hpp
index ff8086cb3..812aa2487 100644
--- a/src/lib/meta/typelist-util.hpp
+++ b/src/lib/meta/typelist-util.hpp
@@ -24,7 +24,7 @@
 /** @file typelist-util.hpp
  ** Metaprogramming: simple helpers for working with lists-of-types. 
  ** This header provides some very basic "meta functions" for extracting
- ** some informations from a list-of-types. In Lumiera, we use template
+ ** pieces of information from a list-of-types. In Lumiera, we use template
  ** metaprogramming and especially such lists-of-types, whenever we build
  ** some common implementation backbone, without being able to subsume all
  ** participating types (classes) into a single inheritance hierarchy.
diff --git a/src/proc/asset/buildinstruct.hpp b/src/proc/asset/buildinstruct.hpp
index 1408037c2..73ee094f2 100644
--- a/src/proc/asset/buildinstruct.hpp
+++ b/src/proc/asset/buildinstruct.hpp
@@ -22,7 +22,7 @@
 
 
 /** @file buildinstruct.hpp
- ** Helper classes used by asset::ProcPatt to represent the processing informations.
+ ** Helper classes used by asset::ProcPatt to represent the processing information.
  ** Consider these classes as owned by ProcPatt. Non-inline functions go to procpatt.cpp 
  **
  */
diff --git a/src/proc/asset/struct-factory-impl.hpp b/src/proc/asset/struct-factory-impl.hpp
index 392cbfed3..b25a94ef1 100644
--- a/src/proc/asset/struct-factory-impl.hpp
+++ b/src/proc/asset/struct-factory-impl.hpp
@@ -24,7 +24,7 @@
 /** @file struct-factory-impl.hpp
  ** Private implementation details of creating various structural assets.
  ** Details how to fabricate specific kinds of structural assets, based
- ** on capability informations encoded into a query (goal).
+ ** on capability information encoded into a query (goal).
  ** @internal to be used by struct.cpp
  **
  ** @see ConfigQuery
diff --git a/src/proc/control/command-def.hpp b/src/proc/control/command-def.hpp
index 292c8f27c..5f0ac67b4 100644
--- a/src/proc/control/command-def.hpp
+++ b/src/proc/control/command-def.hpp
@@ -31,7 +31,7 @@
  ** 
  ** For actually providing these operations, the client is expected to call the
  ** definition functions in a chained manner ("fluent interface"). When  finally all the
- ** required informations are available, a \em prototype object is  built and registered
+ ** required information is available, a \em prototype object is built and registered
  ** with the CommandRegistry. From this point on, the corresponding Command (frontend object)
  ** can be accessed directly by ID (and only relying on the header command.hpp).
  ** 
diff --git a/src/proc/engine/nodewiring-def.hpp b/src/proc/engine/nodewiring-def.hpp
index 20477aa00..d9827b72e 100644
--- a/src/proc/engine/nodewiring-def.hpp
+++ b/src/proc/engine/nodewiring-def.hpp
@@ -25,9 +25,9 @@
  ** During the Builder run, the render nodes network is wired up starting from the
  ** source (generating) nodes up to the exit nodes. As the wiring is implemented through
  ** a const engine::WiringDescriptor, when a new node gets fabricated, all of the connections
- ** to its predecessors need to be completely settled; similarly, any informations pertaining
+ ** to its predecessors need to be completely settled; similarly, any information pertaining
  ** the desired operation mode of this node need to be available. Thus we use this temporary
- ** information record to assemble all these informations.
+ ** information record to assemble all these pieces of information.
  ** 
  ** @see proc::engine::NodeFactory
  ** @see nodewiring.hpp
@@ -109,7 +109,7 @@ namespace engine {
       
       /** A default WiringSituation doesn't specify any connections.
        *  It can be used as-is for building a source node, or augmented
-       *  with connection informations later on.
+       *  with connection information later on.
        */
       WiringSituation()
         : flags_(0)
diff --git a/tests/components/backend/media-access-mock.cpp b/tests/components/backend/media-access-mock.cpp
index 837b27af4..4a50542b9 100644
--- a/tests/components/backend/media-access-mock.cpp
+++ b/tests/components/backend/media-access-mock.cpp
@@ -23,7 +23,7 @@
 
 /** @file mediaacessmock.cpp
  ** Mock implementation of the Interface normally used to query media file
- ** informations from the data backend. The Mock implementation instead holds
+ ** information from the data backend. The Mock implementation instead holds
  ** a map of fixed response which will be delivered when querying some magic
  ** filenames.
  ** 
diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index 848bfeafd..28a88c08a 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -747,10 +747,10 @@ Even if the low-level memory manager(s) may use raw storage, we require that the
 &rarr; see MemoryManagement
 
-
+
Asset management is a subsystem on its own. Assets are "things" that can be loaded into a session, like Media, Clips, Effects, Transitions. It is the "bookkeeping view", while the Objects in the Session relate to the "manipulation and process view". Some Assets can be //loaded// and a collection of Assets is saved with each Session. Besides, there is a collection of basic Assets always available by default.
 
-The Assets are important reference points holding the information needed to access external resources. For example, an Clip asset can reference a Media asset, which in turn holds the external filename from which to get the media stream. For Effects, the situation is similar. Assets thus serve two quite distinct purposes. One is to load, list, group search and browse them, and to provide an entry point to create new or get at existing MObject in the Session, while the other purpose is to provide attribute and property informations to the inner parts of the engine, while at the same time isolating and decoupling them from environmental details. 
+The Assets are important reference points holding the information needed to access external resources. For example, an Clip asset can reference a Media asset, which in turn holds the external filename from which to get the media stream. For Effects, the situation is similar. Assets thus serve two quite distinct purposes. One is to load, list, group search and browse them, and to provide an entry point to create new or get at existing MObject in the Session, while the other purpose is to provide attribute and property information to the inner parts of the engine, while at the same time isolating and decoupling them from environmental details. 
 
 We can distinguish several different Kinds of Assets, each one with specific properties. While all these Kinds of Assets implement the basic Asset interface, they in turn are the __key abstractions__ of the asset management view. Mostly, their interfaces will be used directly, because they are quite different in behaviour. Thus it is common to see asset related operations being templated on the Asset Kind. 
 &rarr; see also [[Creating and registering Assets|AssetCreation]]
@@ -759,7 +759,7 @@ We can distinguish several different Kinds of Assets, each one with specific pro
 !Media Asset
 Some piece of Media Data accessible at some external Location and able to be processed by Lumiera. A Media File on Harddisk can be considered as the most basic form of Media Asset, with some important derived flavours, like a Placeholder for a currently unavailable Source, or Media available in different Resolutions or Formats.
 * __outward interface operations__ include querying properties, creating an Clip MObject, controlling processing policy (low res proxy placeholders, interlacing and other generic pre- and postprocessing)
-* __inward interface operations__ include querying filename, codec, offset and any other informations necessary for creating a source render node, getting additional processing policy decisions (handling of interlacing, aspect ratio).
+* __inward interface operations__ include querying filename, codec, offset and any other information necessary for creating a source render node, getting additional processing policy decisions (handling of interlacing, aspect ratio).
 &rarr; MediaAsset
 
 !Processing Asset
@@ -1405,8 +1405,8 @@ Commands are //defined// using a [[fluent API|http://en.wikipedia.org/wiki/Fluen
 &rarr; see CommandUsage
 
-
-
Commands can be identified and accessed //by name// &mdash; consequently there needs to be an internal command registry, including a link to the actual implementing function, thus allowing to re-establish the connection between command and implementing functions when de-serialising a persisted command. To create a command, we need to provide the following informations
+
+
Commands can be identified and accessed //by name// &mdash; consequently there needs to be an internal command registry, including a link to the actual implementing function, thus allowing to re-establish the connection between command and implementing functions when de-serialising a persisted command. To create a command, we need to provide the following information
 * operation function actually implementing the command
 * function to [[undo|UndoManager]] the effect of the command
 * function to capture state to be used by UNDO.
@@ -1472,11 +1472,11 @@ To support this handling scheme, some infrastructure is in place:
 * performing the actual execution is delegated to a handling pattern object, accessed by name.
 
-
+
[<img[Structure of Commands|uml/fig135173.png]]
 While generally the command framework was designed to be flexible and allow a lot of different use cases, execution paths and to serve various goals, there is an ''intended lifecycle'' &mdash; commands are expected to go through several distinct states.
 
-The handling of a command starts out with a ''command ID'' provided by the client code. Command ~IDs are unique (human readable) identifiers and should be organised in a hierarchical fashion. When provided with an ID, the CommandRegistry tries to fetch an existing command definition. In case this fails, we enter the [[command definition stage|CommandDefinition]], which includes specifying functions to implement the operation, state capturing and UNDO. When all these informations are available, the entity is called a ''command definition''. Conceptually, it is comparable to a //class// or //meta object.//
+The handling of a command starts out with a ''command ID'' provided by the client code. Command ~IDs are unique (human readable) identifiers and should be organised in a hierarchical fashion. When provided with an ID, the CommandRegistry tries to fetch an existing command definition. In case this fails, we enter the [[command definition stage|CommandDefinition]], which includes specifying functions to implement the operation, state capturing and UNDO. When all of this information is available, the entity is called a ''command definition''. Conceptually, it is comparable to a //class// or //meta object.//
 
 By ''binding'' to specific operation arguments, the definition is //armed up//&nbsp; and becomes a real ''command''. This is similar to creating an instance from a class. Behind the scenes, storage is allocated to hold the argument values and any state captured to create the ability to UNDO the command's effect later on.
 
@@ -1782,7 +1782,7 @@ Cinelerra uses this term in a related manner but with a somewhat shifted focus:
 In this usage, the EDL in most cases will be almost synonymous to &raquo;the session&laquo;, just the latter emphasizes more the state aspect. While the Lumiera project started out using the same terminology, later on, when support for multiple "containers" within the session and for [[meta-clips|VirtualClip]] was determined to be of much importance, the new term &raquo;[[Sequence]]&laquo; was preferred.
 
-
+
These are the tools provided to any client of the Proc layer for handling and manipulating the entities in the Session. When defining such operations, //the goal should be to arrive at some uniformity in the way things are done.// Ideally, when writing client code, one should be able to guess how to achieve some desired result.
 
 !guiding principle
@@ -1806,7 +1806,7 @@ This has some obvious and some subtle consequences. Of course, manipulating //ta
 Consequently, sometimes there needs to be done sort of a ''read-copy-update'', i.e. self-replacement by copy followed by manipulation of the new copy, while ongoing processes use the unaltered original object until they receive some sort of reset.
 
 !!undo
-Basically, each elementary operation has to record the informations necessary to be undone. It does so by registering a Memento with some central UndoManager facility. This Memento object contains a functor pre-bound with the needed parameter values. (Besides, the UndoManager is free to implement a second level of security by taking independent state snapshots). 
+Basically, each elementary operation has to record the information necessary to be undone. It does so by registering a Memento with some central UndoManager facility. This Memento object contains a functor pre-bound with the needed parameter values. (Besides, the UndoManager is free to implement a second level of security by taking independent state snapshots). 
 {{red{to be defined in more detail later...}}}
 
@@ -2790,8 +2790,8 @@ The ''pull up'' sequence performs basic initialisation of the session facilities The ''shut down'' sequence does exactly that: halt processing and rendering, disconnect an existing session, if any, get back into initial state. It doesn't care for unwinding session contents, which is assumed to happen automatically when references to previous session contents go out of scope.
-
-
Opening and accessing media files on disk poses several problems, most of which belong to the domain of Lumiera's data backend. Here, we focus on the questions related to making media data available to the session and the render engine. Each media will be represented by an MediaAsset object, which indeed could be a compound object (in case of MultichannelMedia). Building this asset object thus includes getting informations from the real file on disk. For delegating this to the backend, we use the following query interface:
+
+
Opening and accessing media files on disk poses several problems, most of which belong to the domain of Lumiera's data backend. Here, we focus on the questions related to making media data available to the session and the render engine. Each media will be represented by an MediaAsset object, which indeed could be a compound object (in case of MultichannelMedia). Building this asset object thus includes getting information from the real file on disk. For delegating this to the backend, we use the following query interface:
 * {{{queryFile(char* name)}}} requests accessing the file and yields some (opaque) handle when successful.
 * {{{queryChannel(fHandle, int)}}} will then be issued in sequence with ascending index numbers, until it returns {{{NULL}}}.
 * the returned struct (pointer) will provide the following information:
@@ -3271,15 +3271,15 @@ But because I know the opinions on this topc are varying (users tend to be delig
 My proposed aproach is to treat OpenGL as a separate video raw data type, requiring separete and specialized [[Processing Nodes|ProcNode]] for all calculations. Thus the Builder could connect OpenGL nodes if it is possible to cover the render path in whole or partially or maybe even just for preview.
 
-
+
A low-level abstraction within the [[Builder]] &mdash; it serves to encapsulate the details of making multi-channel connections between the render nodes: In some cases, a node can handle N channels internally, while in other cases we need to replicate the node N times and wire each channel individually. As it stands, the OperationPoint marks the ''borderline between high-level and low-level model'': it is invoked in terms of ~MObjects and other entities of the high-level view, but internally it manages to create ProcNode and similar entities of the low-level model.
 
 The operation point is provided by the current BuilderMould and used by the [[processing pattern|ProcPatt]] executing within this mould and conducting the current build step. The operation point's interface allows //to abstract//&nbsp; these details, as well as to //gain additional control//&nbsp; if necessary (e.g. addressing only one of the channels). The most prominent build instruction used within the processing patterns (which is the instruction {{{"attach"}}}) relies on the aforementioned //approach of abstracted handling,// letting the operation point determine automatically how to make the connection.
 
-This is possible because the operation point has been provided (by the mould) with informations about the media stream type to be wired, which, together with information accessible at the [[render node interface|ProcNode]] and from the [[referred processing assets|ProcAsset]], with the help of the [[connection manager|ConManager]] allows to figure out what's possible and how to do the desired connections. Additionally, in the course of deciding about possible connections, the PathManager is consulted to guide strategic decisions regarding the [[render node configuration|NodeConfiguration]], possible type conversions and the rendering technology to employ.
+This is possible because the operation point has been provided (by the mould) with information about the media stream type to be wired, which, together with information accessible at the [[render node interface|ProcNode]] and from the [[referred processing assets|ProcAsset]], with the help of the [[connection manager|ConManager]] allows to figure out what's possible and how to do the desired connections. Additionally, in the course of deciding about possible connections, the PathManager is consulted to guide strategic decisions regarding the [[render node configuration|NodeConfiguration]], possible type conversions and the rendering technology to employ.
 
-
+
An ever recurring problem in the design of Luimiera's ~Proc-Layer is how to refer to output destinations, and how to organise them.
 Wiring the flexible interconnections between the [[pipes|Pipe]] should take into account both the StreamType and the specific usage context ([[scope|PlacementScope]]) -- and the challenge is to avoid hard-linking of connections and tangling with the specifics of the target to be addressed and connected. This page, started __6/2010__ by collecting observations to work out the relations, arrives at defining a //key abstraction// of output management.
 
@@ -3291,7 +3291,7 @@ Wiring the flexible interconnections between the [[pipes|Pipe]] should take into
 ** as Timeline is just a façade, BindingMO has to expose something which can be referred for attaching effects (to global pipes)
 ** when used as VirtualClip, there is somehow a channel configuration, either as asset, or exposed by the BindingMO
 * Placements always resolve at least two dimensions: time and output. The latter means that a [[Placement]] can figure out to where to connect
-* the resolution ability of Placements could help to overcome the problems in conjunction with a VirtualClip: missing output destination informations could be inherited down....
+* the resolution ability of Placements could help to overcome the problems in conjunction with a VirtualClip: missing output destination information could be inherited down....
 * expanding on the basic concept of a Placement in N-dimensional configuration space, this //figuring out// would denote the ability to resolve the final output destination
 * this resolution to a final destination is explicitly context dependent. We engage into quite some complexities to make this happen (&rarr; BindingScopeProblem)
 * [[processing patterns|ProcPatt]] are used for creating nodes on the source network of a clip, and similarly for fader, overlay and mixing into a summation pipe
@@ -4185,7 +4185,7 @@ Placements have //value semantics,// i.e. we don't stress the identity of a plac
 
 
-
+
An implementation facility used to keep track of individual Placements and their relations.
 Especially, the [[Session]] maintains such an index, allowing to use the (opaque) PlacementRef tags for referring to a specific "instance" of an MObject, //placed// in a unique way into the current session. And, moreover, this index allows for one placement referring to another placement, so to implement a //relative// placement mode. Because there is an index behind the scenes, it is possible to actually access such a referral in the reverse direction, which is necessary for implementing the desired placement behaviour (if an object instance used as anchor is moved, all objects placed relatively to it have to move accordingly, which necessitates finding those other objects).
 
@@ -4199,13 +4199,13 @@ Using a ''flat hashtable'' allows to access a Placement denoted by ID in O(1). T
 * allowing to create a path "up" from this scope, which is used for resolving any queries
 * (maybe/planned) relations to other placements
 
-Alternatively, we could try to use a ''structure based index'', thereby avoiding the mentioned description record by folding any of the contained informations into the surrounding data structure:
+Alternatively, we could try to use a ''structure based index'', thereby avoiding the mentioned description record by folding any of the contained information into the surrounding data structure:
 * the scope would be obvious from the index, resp. from the path used to resolve this index
-* any other informations, especially the relations, would be folded into the placement
+* any other information, especially the relations, would be folded into the placement
 * this way, the "index" could be reduced to being the session data structure itself.
 
 //does a placement need to know it's own ID?//&nbsp; Obviously, there needs to be a way to find out the ID for a given placement, especially in the following situations:
-* for most of the operations above, when querying additional informations from index for a given placement
+* for most of the operations above, when querying additional information from index for a given placement
 * to create a PlacementRef (this is a variant of the "shared ptr from this"-problem)
 On second sight, this problem turns out to be more involved, because either we have to keep a second index table for the reverse lookup (memory address -> ID), or have to tie the placement by a back-link when adding it to the index/session data structure, or (alternatively) it forces us to store a copy of the ID //within// the placement itself. The last possibility seems to create the least impact; but implementing it this way effectively gears the implementation towards a hashtable based approach.
 
@@ -4425,7 +4425,7 @@ This is the core service provided by the player subsystem. The purpose is to cre
 :any details of this processing remain opaque for the clients; even the player subsystem just accesses the EngineFaçade
 
-
+
Within Lumiera, &raquo;Player&laquo; is the name for a [[Subsystem]] responsible for organising and tracking //ongoing playback and render processes.// &rarr; [[PlayProcess]]
 The player subsystem does not perform or even manage any render operations, nor does it handle the outputs directly.
 Yet it adresses some central concerns:
@@ -4434,7 +4434,7 @@ Yet it adresses some central concerns:
 :all playback and render processes are on equal footing, handled in a similar way.
 ;integration
 :the player cares for the necessary integration with the other subsystems
-:it consults the OutputManagement, retrieves the necessary informations from the [[Session]] and coordinates [[Backend]] calls.
+:it consults the OutputManagement, retrieves the necessary information from the [[Session]] and coordinates the forwarding of [[Backend]] calls.
 ;time quantisation
 :the player translates continuous time values into discrete frame counts.
 :to perform this [[quantisation|TimeQuant]], the help of the session for building a TimeGrid for each output channel is required.
@@ -4574,7 +4574,7 @@ The system is ''open'' inasmuch every part mirrors the structure of correspondin
 &rarr; see RenderProcess
 
-
+
This special type of [[structural Asset|StructAsset]] represents information how to build some part of the render engine's processing nodes network. Processing patterns can be thought of as a blueprint or micro program for construction. Most notably, they are used for creating nodes reading, decoding and delivering source media material to the render network, and they are used for building the output connection via faders, summation or overlay nodes to the global pipes (busses). Each [[media Asset|MediaAsset]] has associated processing patterns describing the codecs and other transformations needed to get at the media data of this asset. (and because media assets are typically compound objects, the referred ~ProcPatt will be compound too). Similarily, for each stream kind, we can retrieve a processing pattern for making output connections. Obviously, the possibilities opened by using processing patterns go far beyond.
 
 Technically, a processing pattern is a list of building instructions, which will be //executed// by the [[Builder]] on the render node network under construction. This implies the possibility to define further instruction kinds when needed in future; at the moment the relevant sorts of instructions are
@@ -4588,7 +4588,7 @@ Like all [[structural assets|StructAsset]], ~ProcPatt employs a special naming s
 The basic working set of processing patterns can be expected to be just there (hard wired or default configuration, mechanism for creating an sensible fallback). Besides, the idea is that new processing patterns can be added via rules in the session and then referred to by other rules controlling the build process. Any processing pattern is assembled by adding individual build instructions, or by including another (nested) processing pattern.
 
 !!retrieving a suitable Processing Pattern
-For a given situation, the necessary ProcPatt can be retrieved by issuing a [[configuration query|ConfigQuery]]. This query should include the needed capabilities in predicate form (technically this query is a Prolog goal), but it can leave out informations by just requesting "the default" &rarr; see DefaultsManagement
+For a given situation, the necessary ProcPatt can be retrieved by issuing a [[configuration query|ConfigQuery]]. This query should include the needed capabilities in predicate form (technically this query is a Prolog goal), but it can leave out some pieces of information by just requesting "the default" &rarr; see DefaultsManagement
 
 !!how does this actually work?
 Any processing pattern needs the help of a passive holder tool suited for a specific [[building situation|BuilderPrimitives]]; we call these holder tools [[building moulds|BuilderMould]]. Depending on the situation, the mould has been armed up by the builder with the involved objects to be connected and extended. So, just by issuing the //location ID// defined within the individual build instruction (in most cases simply {{{"current"}}}), the processing pattern can retrieve the actual render object to use for building from the mould it is executed in.
@@ -5004,10 +5004,10 @@ config.macros.rssFeedUpdate = {
 //}}}
 
-
+
What is the Role of the asset::Clip and how exactly are Assets and (Clip)-MObjects related?
 
-First of all: ~MObjects are the dynamic/editing/manipulation view, while Assets are the static/bookkeeping/searching/information view of the same entities. Thus, the asset::Clip contains the general configuration, the ref to the media and descriptive properties, while all parameters being "manipulated" belong to the session::Clip (MObject). Besides that, the practical purpose of asset::Clip is that you can save and remember some selection as a Clip (Asset), maybe even attach some informations or markup to it, and later be able to (re)create a editable representation in the Session (the GUI could implement this by allowing to drag from the asset::Clip GUI representation to the timeline window)
+First of all: ~MObjects are the dynamic/editing/manipulation view, while Assets are the static/bookkeeping/searching/information view of the same entities. Thus, the asset::Clip contains the general configuration, the ref to the media and descriptive properties, while all parameters being "manipulated" belong to the session::Clip (MObject). Besides that, the practical purpose of asset::Clip is that you can save and remember some selection as a Clip (Asset), maybe even attach some information or markup to it, and later be able to (re)create a editable representation in the Session (the GUI could implement this by allowing to drag from the asset::Clip GUI representation to the timeline window)
 
 !!dependencies
 The session::Clip (frequently called "clip-MO", i.e. the MObject) //depends on the Asset.// It can't exist without the Asset, because the Asset is needed for rendering. The other direction is different: the asset::Clip knows that there is a dependant clip-MO, there could be //at most one// such clip-MO depending on the Asset, but the Asset can exist without the clip-MO (it gives the possibility to re-create the clip-MO).
@@ -5283,8 +5283,8 @@ A sequence is always tied to a root-placed track, it can't exist without such. W
 &rarr; see detailed [[discussion of dependent objects' behaviour|ModelDependencies]]
 
-
-
The Session contains all informations, state and objects to be edited by the User. From a users view, the Session is synonymous to the //current Project//. It can be [[saved and loaded|SessionLifecycle]]. The individual Objects within the Session, i.e. Clips, Media, Effects, are contained in one (or several) collections within the Session, which we call [[Sequence]].
+
+
The Session contains all information, state and objects to be edited by the User. From a users view, the Session is synonymous to the //current Project//. It can be [[saved and loaded|SessionLifecycle]]. The individual Objects within the Session, i.e. Clips, Media, Effects, are contained in one (or several) collections within the Session, which we call [[Sequence]].
 &rarr; [[Session design overview|SessionOverview]]
 
 !Session structure
@@ -5413,7 +5413,7 @@ Currently, I'm planning to modify MObjectRef to return only a const ref to the u
 <<<
 
-
+
The current [[Session]] is the root of any state found within Proc-Layer. Thus, events defining the session's lifecycle influence and synchronise the cooperative behaviour of the entities within the model, the ProcDispatcher, [[Fixture]] and any facility below.
 * when ''starting'', on first access an empty session is created, which puts any related facility into a defined initial state.
 * when ''closing'' the session, any dependent facilities are disabled, disconnected, halted or closed
@@ -5426,7 +5426,7 @@ The SessionManager is responsible for conducting the session lifecycle. Accessib
 Beyond that, client code usually doesn't interact much with the lifecycle, which mostly is a pattern of events to happen in a well-defined sequence. So the //implementation// of the session management operations has to comply to this lifecycle, and does so by relying on a self-contained implementation service, the LifecycleAdvisor. But (contrary to an application framework) the lifecycle of the Lumiera session is rather fixed, the only possibility for configuration or extension being the [[lifecycle hooks|LifecycleEvent]], where other parts of the system (and even plug-ins) may install some callback methods.
 
 !Synchronising access to session's implementation facilities
-Some other parts and subsystems within the ~Proc-Layer need specialised access to implementation facilities within the session. Informations about some conditions and configurations might be retrieved through [[querrying the session|Query]], and especially default configurations for many objects are [[bound to the session|DefaultsImplementation]]. The [[discovery of session contents|SessionStructureQuery]] relies on an [[index facility|PlacementIndex]] embedded within the session implementation. Moreover, some "properties" of the [[media objects|MObject]] are actually due to the respective object being [[placed|Placement]] in some way into the session; consequently, there might be an dependency on the actual [[location as visible to the placement|PlacementScope]], which in turn is constituted by [[querying the index|QueryFocus]].
+Some other parts and subsystems within the ~Proc-Layer need specialised access to implementation facilities within the session. Information about some conditions and configurations might be retrieved through [[querrying the session|Query]], and especially default configurations for many objects are [[bound to the session|DefaultsImplementation]]. The [[discovery of session contents|SessionStructureQuery]] relies on an [[index facility|PlacementIndex]] embedded within the session implementation. Moreover, some "properties" of the [[media objects|MObject]] are actually due to the respective object being [[placed|Placement]] in some way into the session; consequently, there might be an dependency on the actual [[location as visible to the placement|PlacementScope]], which in turn is constituted by [[querying the index|QueryFocus]].
 
 Each of these facilities relies on a separate access point to session services, corresponding to distinct service interfaces. But &mdash; on the implementation side &mdash; all these services are provided by a (compound) SessionServices implementation object. This approach allows to switch the actual implementation of all these services simply by swapping the ~PImpl maintained by the session manager. A new implementation level service can thus be added to the ~SessionImpl just by hooking it into the ~SessionServices compound object. But note, this mechanism as such is ''not thread safe'', unless the //implementation// of the invoked functions is synchronised in some way to prevent switching to a new session implementation while another thread is still executing session implementation code.
 
@@ -5458,8 +5458,8 @@ As detailed above, {{{Session::current}}} exposes the management / lifecycle API
 {{red{none of the above is implemented as of 11/09}}}
 
-
-
The Session contains all informations, state and objects to be edited by the User (&rarr;[[def|Session]]).
+
+
The Session contains all information, state and objects to be edited by the User (&rarr;[[def|Session]]).
 As such, the SessionInterface is the main entrance point to Proc-Layer functionality, both for the primary EditingOperations and for playback/rendering processes. Proc-Layer state is rooted within the session and guided by the [[session's lifecycle events|SessionLifecycle]].
 Implementation facilities within the Proc-Layer may access a somewhat richer [[session service API|SessionServices]].
 
@@ -5494,14 +5494,14 @@ The answer is simple: the one who needs to know about their existence. Because b
 Interestingly, there seems to be an alternative answer to this question. We could locate the setup and definition of all commands into a central administrative facility. Everyone in need of a command then ought to know the name and retrieve this command. Sounds like bureaucracy.
 
-
+
<<<
 {{red{WARNING: Naming was discussed (11/08) and decided to be changed....}}}
 * the term [[EDL]] was phased out in favour of ''Sequence''
 * [[Session]] is largely synonymous to ''Project''
 * there seems to be a new entity called [[Timeline]] which holds the global Pipes
 <<<
-The [[Session]] (sometimes also called //Project// ) contains all informations and objects to be edited by the User. Any state within the Proc-Layer is directly or indirectly rooted in the session. It can be saved and loaded. The individual Objects within the Session, i.e. Clips, Media, Effects, are contained in one or multiple collections within the Session, which we call [[sequence(s)|Sequence]]. Moreover, the sesion contains references to all the Media files used, and it contains various default or user defined configuration, all being represented as [[Asset]]. At any given time, there is //only one current session// opened within the application. The [[lifecycle events|SessionLifecycle]] of the session define the lifecycle of ~Proc-Layer as a whole.
+The [[Session]] (sometimes also called //Project// ) contains all information and objects to be edited by the User. Any state within the Proc-Layer is directly or indirectly rooted in the session. It can be saved and loaded. The individual Objects within the Session, i.e. Clips, Media, Effects, are contained in one or multiple collections within the Session, which we call [[sequence(s)|Sequence]]. Moreover, the sesion contains references to all the Media files used, and it contains various default or user defined configuration, all being represented as [[Asset]]. At any given time, there is //only one current session// opened within the application. The [[lifecycle events|SessionLifecycle]] of the session define the lifecycle of ~Proc-Layer as a whole.
 
 The Session is close to what is visible in the GUI. From a user's perspective, you'll find a [[Timeline]]-like structure, containing an [[Sequence]], where various Media Objects are arranged and placed. The available building blocks and the rules how they can be combined together form Lumiera's [[high-level data model|HighLevelModel]]. Basically, besides the [[media objects|MObjects]] there are data connections and all processing is organized around processing chains or [[pipes|Pipe]], which can be either global (in the Session) or local (in real or virtual clips).
 
@@ -7144,7 +7144,7 @@ Thus the possibly mutalble time entities get an {{{accept(time::Mutation&)}}
 Based on this time::Mutation design, we provide a specialised element for dealing with //running time values:// When attached to a target time entity, a "life" connection is established. From then on, continuous changes and mutations can be fed to the target by invoking a functor interface. Besides, a change notification signal (callback) can be installed, which will be invoked on each change. This {{{time::Control}}} element is the foundation for implementing all kinds of running time display widgets, spin buttons, timeline selections, playheads, loop playback and similar.
 
-
+
The term &raquo;Time&laquo; spans a variety of vastly different entities. Within a NLE we get to deal with various //flavours of time values.//
 ;continuous time
 :without any additional assumptions, ''points in time'' can be specified with arbitrary precision.
@@ -7174,7 +7174,7 @@ Based on this time::Mutation design, we provide a specialised element for dealin
 :This implies the presence of a //running synchronisation process,// with the authority to adjust the time base;
 :contrast this to the internal time, which is static and unconnected -- 
 ;quantised time
-:The ''act of quantisation'' transforms a continuous property into a ''discrete'' structure. Prominent examples can be found in the domain of micro physics and with digital information processing. In a broader sense, any measurement or //quantification// also encompasses a quantisation. Regarding time and time measurement, quantisation means alignment to a predefined ''time grid''. Quantisation necessarily is an //irreversible process// -- possible additional informations get discarded.
+:The ''act of quantisation'' transforms a continuous property into a ''discrete'' structure. Prominent examples can be found in the domain of micro physics and with digital information processing. In a broader sense, any measurement or //quantification// also encompasses a quantisation. Regarding time and time measurement, quantisation means alignment to a predefined ''time grid''. Quantisation necessarily is an //irreversible process// -- possible additional information is discarded.
 :Note that quantisation introduces an ''time origin'' and a ''reference scale''
 ;frame count
 :within the context of film and media editing, the specification of a ''frame number'' is an especially important instance of quantisation.
@@ -7445,7 +7445,7 @@ Using transitions is a very basic task and thus needs viable support by the GUI.
 Because of this experience, ichthyo wants to support a more general case of transitions, which have N output connections, behave similar to their "simple" counterpart, but leave out the mixing step. As a plus, such transitions can be inserted at the source ports of N clips or between any intermediary or final output pipes as well. Any transition processor capable of handling this situation should provide some flag, in order to decide if he can be placed in such a manner. (wichin the builder, encountering a  inconsistently placed transition is just an [[building error|BuildingError]])
 
-
+
//drafted service as of 4/10 &mdash; &rarr;[[implementation plans|TypedLookup]]//
 A registration service to associate object identities, symbolic identifiers and types.
 
@@ -7471,7 +7471,7 @@ A registration service backed by an index table can be used to //translate//&
 
 !!!{{red{WIP}}}Analysis and discussion
 Still some contradictions &mdash; and rather seems helpful, not so much necessary.
-We //already have an registration service,// both for Assets (AssetManager) and for Placements (PlacementIndex). These facilities maintain not only a raw ID &harr; object association, but also structuring informations, albeit bound to more specific circumstances (the system of placement scopes, and the asset category). The lookup uniqueID &rArr; object could be implemented by sequentially querying this small number of central registration facilities. Thus, still lacking is a ''system of sub index tables''.
+We //already have an registration service,// both for Assets (AssetManager) and for Placements (PlacementIndex). These facilities maintain not only a raw ID &harr; object association, but also structuring information, albeit bound to more specific circumstances (the system of placement scopes, and the asset category). The lookup uniqueID &rArr; object could be implemented by sequentially querying this small number of central registration facilities. Thus, still lacking is a ''system of sub index tables''.
 
 As mentioned above, an ID &harr; type association plays a crucial role when it comes to implementing any kind of rules based configuration. It would allow to bridge from our session objects to rules and resolution working entirely symbolic. (&rarr; [[more|ConfigQueryIntegration]]). But, as of 3/2010 this is a //planned feature and not required to get the initial pipeline working.// Thus, according to the YAGNI principle, we shouldn't engage into any implementation details right now and just create the extension points.
 
@@ -7492,7 +7492,7 @@ Just an ''registration scheme'' should be implemented right now, working complet
 see [[implementation planning|TypedLookup]]
 
-
+
TypedID is a registration service to associate object identities, symbolic identifiers and types. It acts as frontend to the TypedLookup service within Proc-Layer, at the implementation level. While TypedID works within a strictly typed context, this type information is translated into an internal index on passing over to the implementation, which manages a set of tables containing base entries with an combined symbolic+hash ID, plus an opaque buffer. Thus, the strictly typed context is required to re-access the stored data. But the type information wasn't erased entirely, so this typed context can be re-gained with the help of an internal type index. All of this is considered implementation detail and may be subject to change without further notice; any access is assumed to happen through the TypedID frontend. Besides, there are two more specialised frontends.
 
 !Front-ends
@@ -7503,7 +7503,7 @@ see [[implementation planning|TypedLookup]]
 !Tables and index
 The Table consists of several registration groups, each of which contains a hashtable and deals with one specific type. Groups are created on demand, but there is initially one group holding the internal type index (translation table). There may be even sub-groups, usable to create clusterings within one group.
 
-__Individual entries__ are comprised of a EntryID as key (actually a ~BareEntryID, without the typing) and a payload, which //doesn't store data,// but informations necessary to ''lookup and access'' the registered object. Obviously, this information is type specific, and thus the ~TypedLookup implementation can't know how to deal with it directly. Rather, we store a ''functor'' in the payload of the type index group. This functor is directly linked to the TypeHandler, i.e. any type wanting to be a primary type within Lumiera, so as to be directly usable within the ConfigRules, needs to provide a suitable functor implementation through its ~TypeHandler. These functors are then invoked by the ~TypedID frontend, when it comes to re-accessing a registered entity by ID
+__Individual entries__ are comprised of a EntryID as key (actually a ~BareEntryID, without the typing) and a payload, which //doesn't store data,// but information necessary to ''lookup and access'' the registered object. Obviously, this information is type specific, and thus the ~TypedLookup implementation can't know how to deal with it directly. Rather, we store a ''functor'' in the payload of the type index group. This functor is directly linked to the TypeHandler, i.e. any type wanting to be a primary type within Lumiera, so as to be directly usable within the ConfigRules, needs to provide a suitable functor implementation through its ~TypeHandler. These functors are then invoked by the ~TypedID frontend, when it comes to re-accessing a registered entity by ID
 
 !link for automatic registration
 An entity can be linked with the TypedLookup system to be registered and deregistered automatically. This is achieved by mixing in the {{{TypedID::Link}}}. On creation, this will set up an EntryID for this individual instance and cause creation of an empty entry within the suitable registration group. As a side-effect, uniqueness of any symbolic-ID within one group (type) is enforced. Obviously, the dtor of this registration Link cares for de-registration automatically. Be forwarned though, by creating an unique identity, this mechanism will interfere with copying and cloning of the registered entity.

From 2bdf06829acbb732f3dee953a29cdfadc798ccd0 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 24 Dec 2011 05:33:56 +0100
Subject: [PATCH 25/87] make thread(pool) less chatty

---
 src/backend/threads.c | 12 ++++++------
 src/backend/threads.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/backend/threads.c b/src/backend/threads.c
index 3ed36be84..7f580f712 100644
--- a/src/backend/threads.c
+++ b/src/backend/threads.c
@@ -37,7 +37,7 @@
 #include 
 
 /**
- * @file
+ * @file threads.c
  *
  */
 
@@ -93,17 +93,17 @@ thread_loop (void* thread)
       do {
         lumiera_threadpool_release_thread(t);
         LUMIERA_CONDITION_WAIT (t->state != LUMIERA_THREADSTATE_IDLE);
-        INFO (threads, "Thread awaken with state %s", lumiera_threadstate_names[t->state]);
+        TRACE (threads, "Thread awaken with state %s", lumiera_threadstate_names[t->state]);
 
         // NULL function means: no work to do
-        INFO (threads, "function %p", t->function);
+        TRACE (threads, "function %p", t->function);
         if (t->function)
           t->function (t->arguments);
         TRACE (threads, "function done");
 
         if (t->kind & LUMIERA_THREAD_JOINABLE)
           {
-            INFO (threads, "Thread zombified");
+            TRACE (threads, "Thread zombified");
             /* move error state to data the other thread will it pick up from there */
             t->arguments = (void*)lumiera_error ();
             t->state = LUMIERA_THREADSTATE_ZOMBIE;
@@ -111,14 +111,14 @@ thread_loop (void* thread)
 
             LUMIERA_CONDITION_SIGNAL;
             LUMIERA_CONDITION_WAIT (t->state == LUMIERA_THREADSTATE_JOINED);
-            INFO (threads, "Thread joined");
+            TRACE (threads, "Thread joined");
         }
 
       } while (t->state != LUMIERA_THREADSTATE_SHUTDOWN);
       // SHUTDOWN state
 
 
-      INFO (threads, "Thread Shutdown");
+      TRACE (threads, "Thread done.");
     }
   //////////////////////////////////////////////////////////////////////TICKET #844 no error must be pending here, else do app shutdown
   return 0;
diff --git a/src/backend/threads.h b/src/backend/threads.h
index 6e755be48..d539a3944 100644
--- a/src/backend/threads.h
+++ b/src/backend/threads.h
@@ -37,7 +37,7 @@
 
 
 /**
- * @file
+ * @file threads.h
  *
  */
 

From 87f7a8f6e8f4bb10c13a5a2366a66b3bfdeef01d Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 23 Dec 2011 05:00:27 +0100
Subject: [PATCH 26/87] unit test to cover thread-local helper

---
 src/backend/thread-wrapper.hpp  |   2 +-
 src/lib/thread-local.hpp        |   2 +-
 tests/40components.tests        |   5 ++
 tests/lib/thread-local-test.cpp | 112 ++++++++++++++++++++++++++++++++
 wiki/renderengine.html          |   5 +-
 5 files changed, 122 insertions(+), 4 deletions(-)
 create mode 100644 tests/lib/thread-local-test.cpp

diff --git a/src/backend/thread-wrapper.hpp b/src/backend/thread-wrapper.hpp
index 699bfd11d..6ce1aaa02 100644
--- a/src/backend/thread-wrapper.hpp
+++ b/src/backend/thread-wrapper.hpp
@@ -188,7 +188,7 @@ namespace backend {
     
     
     /** @note by design there is no possibility to find out
-     *  just based on the thread handle, if the thread is alive.
+     *  just based on the thread handle if some thread is alive.
      *  We define our own accounting here based on the internals
      *  of the thread wrapper. This will break down, if you mix
      *  uses of the C++ wrapper with the raw C functions. */
diff --git a/src/lib/thread-local.hpp b/src/lib/thread-local.hpp
index cfb854ae8..613807278 100644
--- a/src/lib/thread-local.hpp
+++ b/src/lib/thread-local.hpp
@@ -95,7 +95,7 @@ namespace lib {
       
     private:
       TAR*
-      accessChecked()
+      accessChecked()  const
         {
           TAR *p(get());
           if (!p)
diff --git a/tests/40components.tests b/tests/40components.tests
index 9baa7e6b5..fc23dc900 100644
--- a/tests/40components.tests
+++ b/tests/40components.tests
@@ -648,6 +648,11 @@ return: 0
 END
 
 
+TEST "Wrapper thread-local pointers" ThreadLocal_test  <
+
+  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 "backend/thread-wrapper.hpp"
+#include "lib/thread-local.hpp"
+
+#include 
+
+using test::Test;
+using backend::ThreadJoinable;
+using std::rand;
+
+
+namespace lib {
+namespace test{
+
+  namespace { // private test data...
+    
+    const uint NUM_THREADS = 100;
+    const uint MAX_RAND    = 5*1000*1000;
+    
+    
+    ThreadLocalPtr privateValue;
+    
+    
+    
+    
+    struct TestThread
+      : ThreadJoinable
+      {
+        TestThread()
+          : ThreadJoinable("test Thread-local storage"
+                          ,verifyThreadLocal)
+          { }
+        
+        
+        /** the actual test operation running in a separate thread */
+        static void
+        verifyThreadLocal()
+          {
+            uint secret (1 + rand() % MAX_RAND);
+            privateValue.set (&secret);
+            
+            usleep (secret); // sleep for a random period
+            
+            if (secret != *privateValue)
+              throw error::Fatal ("thread-local value access broken");
+          }
+      };
+    
+  } // (End) test data....
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  /**************************************************************************
+   * @test use a wrapper to simplify handling of thread-local data.
+   *       Create some threads, each referring to another piece of data
+   *       through the "same" wrapper instance.
+   * 
+   * @see backend::Thread
+   * @see lib::ThreadLocal
+   */
+  class ThreadLocal_test : public Test
+    {
+      
+      virtual void
+      run (Arg)
+        {
+          TestThread testcase[NUM_THREADS]    SIDEEFFECT;
+          
+          for (uint i=0; i < NUM_THREADS; ++i)
+            CHECK (testcase[i].join().isValid() );
+        }
+    };
+  
+  
+  
+  /** Register this test class... */
+  LAUNCHER (ThreadLocal_test, "function common");
+  
+  
+  
+}} // namespace backend::test
diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index 28a88c08a..aeefa01c1 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -3425,7 +3425,7 @@ Thus the mapping is a copyable value object, based on a associative array. It ma
 First and foremost, mapping can be seen as a //functional abstraction.// As it's used at implementation level, encapsulation of detail types in't the primary concern, so it's a candidate for generic programming: For each of those use cases outlined above, a distinct mapping type is created by instantiating the {{{OutputMapping<DEF>}}} template with a specifically tailored definition context ({{{DEF}}}), which takes on the role of a strategy. Individual instances of this concrete mapping type may be default created and copied freely. This instantiation process includes picking up the concrete result type and building a functor object for resolving on the fly. Thus, in the way typical for generic programming, the more involved special details are moved out of sight, while being still in scope for the purpose of inlining. But there //is// a concern better to be encapsulated and concealed at the usage site, namely accessing the rules system. Thus mapping leads itself to the frequently used implementation pattern where there is a generic frontend as header, calling into opaque functions embedded within a separate compilation unit.
 
-
+
Within the Lumiera player and output subsystem, actually sending data to an external output requires to allocate an ''output slot''
 This is the central metaphor for the organisation of actual (system level) outputs; using this concept allows to separate and abstract the data calculation and the organisation of playback and rendering from the specifics of the actual output sink. Actual output possibilities (video in GUI window, video fullscreen, sound, Jack, rendering to file) can be added and removed dynamically from various components (backend, GUI), all using the same resolution and mapping mechanisms (&rarr; OutputManagement)
 
@@ -3434,7 +3434,8 @@ Each OutputSlot is an unique and distinguishable entity. It corresponds explicit
 
 In order to be usable as //output sink,// an output slot needs to be //allocated,// i.e. tied to and locked for a specific client. At any time, there may be only a single client using a given output slot this way. To stress this point: output slots don't provide any kind of inherent mixing capability; any adaptation, mixing, overlaying and sharing needs to be done within the nodes network producing the output data fed to the slot. (in special cases, some external output capabilities -- e.g. the Jack audio connection system -- may still provide additional mixing capabilities, but that's beyond the scope of the Lumiera application)
 
-Once allocated, the output slot returns a set of concrete ''sink handles'' (one for each physical channel expecting data). The calculating process feeds its results into those handles. Size and other characteristics of the data frames are assumed to be suitable, which typically won't be verified at that level anymore (but the sink handle provides a hook for assertions). Besides that, the allocation of an output slot reveals detailed ''timing expectations''. The client is required to comply to these timings when ''emitting'' data -- he's even required to provide a //current time specification,// alongside with the data. Yet the output slot has the ability to handle timing failures gracefully; the concrete output slot implementation is expected to provide some kind of de-click or de-flicker facility, which kicks in automatically when a timing failure is detected.
+[>img[Outputslot implementation structures|uml/fig151685.png]]
+Once allocated, the output slot returns a set of concrete ''sink handles'' (one for each physical channel expecting data). The calculating process feeds its results into those handles. Size and other characteristics of the data frames are assumed to be suitable, which typically won't be verified at that level anymore (but the sink handle provides a hook for assertions). Besides that, the allocation of an output slot reveals detailed ''timing expectations''. The client is required to comply to these timings when ''emitting'' data -- he's even required to provide a //current time specification,// alongside with the data. Based on this information, the output slot has the ability to handle timing failures gracefully; the concrete output slot implementation is expected to provide some kind of de-click or de-flicker facility, which kicks in automatically when a timing failure is detected.
 
 !!!data exchange models
 Data is handed over by the client invoking an {{{emit(time,...)}}} function on the sink handle. Theoretically there are two different models how this data hand-over might be performed. This corresponds to the fact, that in some cases our own code manages the output and the buffers, while in other situations we intend to use existing library solutions or even external server applications to handle output

From 5498ace9fc6024fed011408b5b9f3772e9f9f43d Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 24 Dec 2011 03:47:50 +0100
Subject: [PATCH 27/87] WIP define a unit-test for diagnostic context stack

---
 src/lib/nobug-resource-handle-context.hpp | 158 +++++++++++++++++
 tests/lib/diagnostic-context-test.cpp     | 199 ++++++++++++++++++++++
 tests/lib/thread-local-test.cpp           |   5 +-
 3 files changed, 360 insertions(+), 2 deletions(-)
 create mode 100644 src/lib/nobug-resource-handle-context.hpp
 create mode 100644 tests/lib/diagnostic-context-test.cpp

diff --git a/src/lib/nobug-resource-handle-context.hpp b/src/lib/nobug-resource-handle-context.hpp
new file mode 100644
index 000000000..1fc658e69
--- /dev/null
+++ b/src/lib/nobug-resource-handle-context.hpp
@@ -0,0 +1,158 @@
+/*
+  DIAGNOSTIC-CONTEXT.hpp  -  thread local stack for explicitly collecting diagnostic context info
+
+  Copyright (C)         Lumiera.org
+    2010,               Hermann Vosseler 
+
+  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.
+
+*/
+
+/** @file diagnostic-context.hpp
+ ** Facility for collecting diagnostic context information explicitly.
+ ** Unlike a trace logging run, this facility is intended to be fed explicitly with
+ ** diagnostic information describing the currently ongoing operation in a semantic
+ ** high-level manner. The rationale is to pinpoint \em those pieces of information,
+ ** which aren't obvious when just looking at a callstack with the debugger.
+ ** Instances of the class DiagnosticContext should be placed explicitly as automatic
+ ** (stack) variable into selected relevant scopes; these "information frames" could
+ ** be accessed from an enclosed scope  as a per-thread stack. DiagnosticContext
+ ** provides an controlled environment for adding diagnostic code on demand; typically
+ ** to be configured such as to resolve into an empty class for release builds.
+ ** 
+ ** As of 2/10, this is an experimental feature in evaluation. To start with,
+ ** I'll use it to solve the problem of providing a NoBug resource tracker handle
+ ** without tangling the object monitor code (sync.hpp) with low level, NoBug related
+ ** implementation details.
+ ** 
+ ** @todo add the actual diagnostic content
+ **/
+
+
+#ifndef LIB_DIAGNOSTIC_CONTEXT_H
+#define LIB_DIAGNOSTIC_CONTEXT_H
+
+
+#include "lib/error.hpp"
+#include "lib/thread-local.hpp"
+
+#include 
+#include 
+
+
+
+namespace lib {
+  
+  
+  
+#ifdef NOBUG_MODE_ALPHA      ////////////////////////TODO don't we need the handle in BETA builds for resource logging?
+  
+  /** 
+   * Diagnostic data frame to collect specific information concerning a scope.
+   * To be placed explicitly as an automatic (stack) variable. Provides a controlled
+   * environment for hooking up diagnostic code. Within each thread, a stack of
+   * such information frames concerning nested scopes is maintained automatically.
+   * It can be accessed via static API.
+   * @warning relies on thread-local access; never use this within global data structures.
+   * @note as of 2/10 used for housing the NoBug resource tracker handle
+   *       in conjunction with object monitor based locking
+   * @see sync.hpp
+   * @todo 12/2011 : not in use currently, but the concept seems useful
+   *       and should be generalised.                         //////////////////////////////////////TICKET #687 
+   */
+  class DiagnosticContext
+    : boost::noncopyable
+    {
+      typedef nobug_resource_user* Handle;
+      typedef ThreadLocalPtr ThreadLocalAccess;
+      
+      Handle handle_;
+      DiagnosticContext * const prev_;
+      
+      /** embedded thread local pointer
+       *  to the innermost context encountered */
+      static ThreadLocalAccess&
+      current()
+        {
+          static ThreadLocalAccess accessPoint;
+          return accessPoint;
+        }
+      
+      
+    public:
+      DiagnosticContext()
+        : handle_(0)
+        , prev_(current().get())
+        {
+          current().set (this);
+        }
+      
+     ~DiagnosticContext()
+        {
+          ASSERT (this == current().get());
+          current().set (prev_);
+        }
+      
+      
+      operator Handle* () ///< payload: NoBug resource tracker user handle
+        {
+          return &handle_;
+        }
+      
+      /** accessing the innermost diagnostic context created */
+      static DiagnosticContext&
+      access ()
+        {
+          DiagnosticContext* innermost = current().get();
+          if (!innermost)
+            throw lumiera::error::Logic ("Accessing Diagnostic context out of order; "
+                                         "an instance should have been created in "
+                                         "an enclosing scope");
+          return *innermost;
+        }
+    };
+  
+  
+#else  /* not NOBUG_ALPHA */
+  
+  
+  /** 
+   * Disabled placeholder for the Diagnostic context, not used in release builds.
+   */
+  class DiagnosticContext
+    : boost::noncopyable
+    {
+      
+      
+    public:
+      
+      operator Handle* () ///< payload: NoBug resource tracker user handle
+        {
+          return 0;
+        }
+      
+      /** accessing the innermost diagnostic context created */
+      static DiagnosticContext&
+      access ()
+        {
+          UNIMPLEMENTED ("how to disable DiagnosticContext with minimum overhead");
+        }
+    };
+#endif /* NOBUG_ALPHA? */
+  
+  
+  
+} // namespace lib
+#endif
diff --git a/tests/lib/diagnostic-context-test.cpp b/tests/lib/diagnostic-context-test.cpp
new file mode 100644
index 000000000..a4784319d
--- /dev/null
+++ b/tests/lib/diagnostic-context-test.cpp
@@ -0,0 +1,199 @@
+/*
+  DiagrnsticContext(Test)  -  verify thread local stack for collecting diagnostics 
+
+  Copyright (C)         Lumiera.org
+    2011,               Hermann Vosseler 
+
+  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/test/test-helper.hpp"
+
+#include "backend/thread-wrapper.hpp"
+#include "lib/diagnostic-context.hpp"
+
+#include 
+#include 
+
+
+
+namespace lib {
+namespace test{
+  
+  namespace error = lumiera::error;
+  
+  namespace { // private test setup...
+    
+    const uint NUM_THREADS = 100;
+    const uint MAX_RAND    = 1000*1000;
+    
+  } // (End) test setup....
+  
+  using test::Test;
+  using backend::ThreadJoinable;
+  using error::LUMIERA_ERROR_LOGIC;
+  using std::rand;
+  
+  
+  /** 
+   * Subject of this test:
+   * a thread-local stack of int values
+   */
+  typedef DiagnosticContext Marker;
+  
+  
+  
+  
+  
+  
+  /**********************************************************************************
+   * @test verify a diagnostic facility to collect and access contextual information.
+   *       DiagnosticContext frames are placed into automatic storage (as local
+   *       variable within some function scope). Based on thread-local storage,
+   *       the next reachable frame can be accessed from anywhere within
+   *       the callstack. This feature is useful for collecting 
+   *       information regarding features cross-cutting
+   *       the usual dependency hierarchy.
+   * 
+   * @see lib::DiagnosticContext
+   * @see lib::ThreadLocal
+   * @see backend::Thread
+   */
+  class DiagrnsticContext_test : public Test
+    {
+      
+      virtual void
+      run (Arg)
+        {
+          verify_simpleProperties();
+          verify_heavilyParallelUsage();
+        }
+      
+      
+      
+      /** @test create nested scopes and place a
+       *  DiagnosticContext frame into each.
+       *  Access the next reachable frame.
+       */
+      void
+      verify_simpleAccess()
+        {
+          VERIFY_ERROR (LOGIC, Marker.access());
+          
+          Marker zero(0);
+          CHECK (0 == zero);
+          CHECK (0 == Marker.access());
+          
+          { // nested scope 
+            CHECK (0 == Marker.access());
+            
+            Marker one(1);
+            CHECK (1 == Marker.access());
+            CHECK (1 == one);
+            CHECK (0 == zero);
+            
+            { // nested scope
+              CHECK (1 == Marker.access());
+              
+              Marker two(2);
+              CHECK (2 == Marker.access());
+              CHECK (2 == two);
+              CHECK (1 == one);
+              CHECK (0 == zero);
+            }
+            CHECK (1 == Marker.access());
+          }
+          CHECK (0 == Marker.access());
+        }
+      
+      
+      
+      
+      /** @test verify the thread local property of ContextStack.
+       * Create several threads, each of which processes a sequence
+       * of numbers starting from a random initial value down to one.
+       * Whenever a simple division by two leads to an odd value, this
+       * value is placed onto the ContextStack. At recursion end, we
+       * take a snapshot of the full ContextStack and then unwind.
+       * Thus the captured numbers must from a decreasing sequence
+       * of odd values.
+       */
+      void
+      verify_heavilyParallelUsage()
+        {
+          TestThread testcase[NUM_THREADS]    SIDEEFFECT;
+          
+          for (uint i=0; i < NUM_THREADS; ++i)
+            CHECK (testcase[i].join().isValid() );
+        }
+      
+      
+      struct TestThread
+        : ThreadJoinable
+        {
+          TestThread()
+            : ThreadJoinable("test diagnostic context stack"
+                            ,verifyDiagnosticStack)
+            { }
+        };
+      
+      
+      typedef std::vector VecI;
+        
+      /** the actual test operation running in a separate thread */
+      static void
+      verifyDiagnosticStack()
+        {
+          uint seed (1 + rand() % MAX_RAND);
+          
+          VecI sequence = descend (seed);
+          
+          uint prev = seed;
+          for (uint i=0; i < sequence.size(); ++i)
+            {
+              uint val = sequence[i];
+              if (! (isOdd(val) && val < prev))
+                throw error::Fatal ("thread-local diagnostic stack");
+              prev = val;
+            }
+        }
+      
+      static VecI
+      descend (uint current)
+        {
+          if (current < 2)
+            return Marker.extractStack();
+            
+          if (isOdd(current))
+            {
+              Marker remember(current);
+              return descend (current+1);
+            }
+          else
+            return descend (current/2);
+        }
+    };
+  
+  
+  
+  /** Register this test class... */
+  LAUNCHER (DiagrnsticContext_test, "function common");
+  
+  
+  
+}} // namespace backend::test
diff --git a/tests/lib/thread-local-test.cpp b/tests/lib/thread-local-test.cpp
index 562ec64e1..45465045d 100644
--- a/tests/lib/thread-local-test.cpp
+++ b/tests/lib/thread-local-test.cpp
@@ -36,12 +36,13 @@ using std::rand;
 namespace lib {
 namespace test{
 
-  namespace { // private test data...
+  namespace { // private test setup...
     
     const uint NUM_THREADS = 100;
     const uint MAX_RAND    = 5*1000*1000;
     
     
+    /** Subject of the test */
     ThreadLocalPtr privateValue;
     
     
@@ -70,7 +71,7 @@ namespace test{
           }
       };
     
-  } // (End) test data....
+  } // (End) test setup....
   
   
   

From 24a8d6a926b89935a455c0a75c2167ca300abd7b Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 24 Dec 2011 05:38:54 +0100
Subject: [PATCH 28/87] generalised diagnostic context passes unit test

---
 src/lib/diagnostic-context.hpp            |  63 ++++++-------
 src/lib/nobug-resource-handle-context.hpp | 106 ++++++----------------
 src/proc/control/command-closure.hpp      |  12 +--
 tests/40components.tests                  |   5 +
 tests/lib/diagnostic-context-test.cpp     |  46 ++++++----
 5 files changed, 93 insertions(+), 139 deletions(-)

diff --git a/src/lib/diagnostic-context.hpp b/src/lib/diagnostic-context.hpp
index 1fc658e69..221f59fad 100644
--- a/src/lib/diagnostic-context.hpp
+++ b/src/lib/diagnostic-context.hpp
@@ -57,7 +57,6 @@ namespace lib {
   
   
   
-#ifdef NOBUG_MODE_ALPHA      ////////////////////////TODO don't we need the handle in BETA builds for resource logging?
   
   /** 
    * Diagnostic data frame to collect specific information concerning a scope.
@@ -66,19 +65,15 @@ namespace lib {
    * such information frames concerning nested scopes is maintained automatically.
    * It can be accessed via static API.
    * @warning relies on thread-local access; never use this within global data structures.
-   * @note as of 2/10 used for housing the NoBug resource tracker handle
-   *       in conjunction with object monitor based locking
-   * @see sync.hpp
-   * @todo 12/2011 : not in use currently, but the concept seems useful
-   *       and should be generalised.                         //////////////////////////////////////TICKET #687 
    */
+  template
   class DiagnosticContext
     : boost::noncopyable
     {
-      typedef nobug_resource_user* Handle;
       typedef ThreadLocalPtr ThreadLocalAccess;
+      typedef std::vector                  ValSequence;
       
-      Handle handle_;
+      const VAL value_;
       DiagnosticContext * const prev_;
       
       /** embedded thread local pointer
@@ -92,8 +87,8 @@ namespace lib {
       
       
     public:
-      DiagnosticContext()
-        : handle_(0)
+      DiagnosticContext(VAL const& value_to_log = VAL())
+        : value_(value_to_log)
         , prev_(current().get())
         {
           current().set (this);
@@ -106,9 +101,9 @@ namespace lib {
         }
       
       
-      operator Handle* () ///< payload: NoBug resource tracker user handle
+      operator VAL const&()  ///< access the payload by conversion
         {
-          return &handle_;
+          return value_;
         }
       
       /** accessing the innermost diagnostic context created */
@@ -118,39 +113,33 @@ namespace lib {
           DiagnosticContext* innermost = current().get();
           if (!innermost)
             throw lumiera::error::Logic ("Accessing Diagnostic context out of order; "
-                                         "an instance should have been created in "
+                                         "an instance should have been created within "
                                          "an enclosing scope");
           return *innermost;
         }
-    };
-  
-  
-#else  /* not NOBUG_ALPHA */
-  
-  
-  /** 
-   * Disabled placeholder for the Diagnostic context, not used in release builds.
-   */
-  class DiagnosticContext
-    : boost::noncopyable
-    {
       
       
-    public:
-      
-      operator Handle* () ///< payload: NoBug resource tracker user handle
+      /** snapshot of the current stack of diagnostic frames
+       * @return vector with all the payload values currently
+       *         on the thread-local diagnostic stack. Might
+       *         be empty. Values start with frame next to
+       *         the current scope and end with outermost.
+       */
+      static ValSequence
+      extractStack()
         {
-          return 0;
-        }
-      
-      /** accessing the innermost diagnostic context created */
-      static DiagnosticContext&
-      access ()
-        {
-          UNIMPLEMENTED ("how to disable DiagnosticContext with minimum overhead");
+          ValSequence loggedValues;
+          DiagnosticContext* next = current().get();
+          while (next)
+            {
+              loggedValues.push_back (*next);
+              next = next->prev_;
+            }
+          return loggedValues;
         }
     };
-#endif /* NOBUG_ALPHA? */
+  
+  
   
   
   
diff --git a/src/lib/nobug-resource-handle-context.hpp b/src/lib/nobug-resource-handle-context.hpp
index 1fc658e69..ac4ccca52 100644
--- a/src/lib/nobug-resource-handle-context.hpp
+++ b/src/lib/nobug-resource-handle-context.hpp
@@ -1,5 +1,5 @@
 /*
-  DIAGNOSTIC-CONTEXT.hpp  -  thread local stack for explicitly collecting diagnostic context info
+  NOBUG-RESOURCE-HANDLE-CONTEXT.hpp  -  thread local stack to manage NoBug resource handles
 
   Copyright (C)         Lumiera.org
     2010,               Hermann Vosseler 
@@ -20,29 +20,28 @@
 
 */
 
-/** @file diagnostic-context.hpp
- ** Facility for collecting diagnostic context information explicitly.
- ** Unlike a trace logging run, this facility is intended to be fed explicitly with
- ** diagnostic information describing the currently ongoing operation in a semantic
- ** high-level manner. The rationale is to pinpoint \em those pieces of information,
- ** which aren't obvious when just looking at a callstack with the debugger.
- ** Instances of the class DiagnosticContext should be placed explicitly as automatic
- ** (stack) variable into selected relevant scopes; these "information frames" could
- ** be accessed from an enclosed scope  as a per-thread stack. DiagnosticContext
- ** provides an controlled environment for adding diagnostic code on demand; typically
- ** to be configured such as to resolve into an empty class for release builds.
+/** @file nobug-resource-handle-context.hpp
+ ** Thread-local stack of NoBug resource handles.
+ ** This helper allows to access the resource handle in the nearest enclosing scope.
+ ** The motivation for this approach was to avoid passing the resource handle over
+ ** several intermediary function calls when using a scoped variable to control
+ ** object monitor locking. Within this usage context, the necessity of passing
+ ** a NoBug resource handle seems to be a cross-cutting concern, and not directly
+ ** related to the core concern (controlling a mutex).
  ** 
- ** As of 2/10, this is an experimental feature in evaluation. To start with,
- ** I'll use it to solve the problem of providing a NoBug resource tracker handle
- ** without tangling the object monitor code (sync.hpp) with low level, NoBug related
- ** implementation details.
+ ** @remarks as of 8/2011, this feature is not used anymore. In 12/2011, the concept
+ ** of a diagnostic context stack was generalised. At that point, this header was
+ ** created as an off-spin, now based on the generalised feature, to document this
+ ** usage possibility, which might be required again at some point in the future.
+ ** 
+ ** @see lib::DiagnosticContext
+ ** @see diagnostic-context-test.hpp
  ** 
- ** @todo add the actual diagnostic content
  **/
 
 
-#ifndef LIB_DIAGNOSTIC_CONTEXT_H
-#define LIB_DIAGNOSTIC_CONTEXT_H
+#ifndef LIB_NOBUG_RESOURCE_HANDLE_CONTEXT_H
+#define LIB_NOBUG_RESOURCE_HANDLE_CONTEXT_H
 
 
 #include "lib/error.hpp"
@@ -60,68 +59,14 @@ namespace lib {
 #ifdef NOBUG_MODE_ALPHA      ////////////////////////TODO don't we need the handle in BETA builds for resource logging?
   
   /** 
-   * Diagnostic data frame to collect specific information concerning a scope.
-   * To be placed explicitly as an automatic (stack) variable. Provides a controlled
-   * environment for hooking up diagnostic code. Within each thread, a stack of
-   * such information frames concerning nested scopes is maintained automatically.
-   * It can be accessed via static API.
+   * Diagnostic data frame to hold a NoBug resource handle.
+   * This way, code in nested function calls may pick up the nearest available handle.
    * @warning relies on thread-local access; never use this within global data structures.
-   * @note as of 2/10 used for housing the NoBug resource tracker handle
-   *       in conjunction with object monitor based locking
-   * @see sync.hpp
-   * @todo 12/2011 : not in use currently, but the concept seems useful
-   *       and should be generalised.                         //////////////////////////////////////TICKET #687 
    */
-  class DiagnosticContext
-    : boost::noncopyable
+  class NobugResourceHandleContext
+    : DiagnosticContext
     {
-      typedef nobug_resource_user* Handle;
-      typedef ThreadLocalPtr ThreadLocalAccess;
-      
-      Handle handle_;
-      DiagnosticContext * const prev_;
-      
-      /** embedded thread local pointer
-       *  to the innermost context encountered */
-      static ThreadLocalAccess&
-      current()
-        {
-          static ThreadLocalAccess accessPoint;
-          return accessPoint;
-        }
-      
-      
     public:
-      DiagnosticContext()
-        : handle_(0)
-        , prev_(current().get())
-        {
-          current().set (this);
-        }
-      
-     ~DiagnosticContext()
-        {
-          ASSERT (this == current().get());
-          current().set (prev_);
-        }
-      
-      
-      operator Handle* () ///< payload: NoBug resource tracker user handle
-        {
-          return &handle_;
-        }
-      
-      /** accessing the innermost diagnostic context created */
-      static DiagnosticContext&
-      access ()
-        {
-          DiagnosticContext* innermost = current().get();
-          if (!innermost)
-            throw lumiera::error::Logic ("Accessing Diagnostic context out of order; "
-                                         "an instance should have been created in "
-                                         "an enclosing scope");
-          return *innermost;
-        }
     };
   
   
@@ -131,20 +76,21 @@ namespace lib {
   /** 
    * Disabled placeholder for the Diagnostic context, not used in release builds.
    */
-  class DiagnosticContext
+  class NobugResourceHandleContext
     : boost::noncopyable
     {
       
+      typedef nobug_resource_user* Handle;
       
     public:
       
-      operator Handle* () ///< payload: NoBug resource tracker user handle
+      operator Handle () ///< payload: NoBug resource tracker user handle
         {
           return 0;
         }
       
       /** accessing the innermost diagnostic context created */
-      static DiagnosticContext&
+      static NobugResourceHandleContext&
       access ()
         {
           UNIMPLEMENTED ("how to disable DiagnosticContext with minimum overhead");
diff --git a/src/proc/control/command-closure.hpp b/src/proc/control/command-closure.hpp
index a2246125c..b03f88405 100644
--- a/src/proc/control/command-closure.hpp
+++ b/src/proc/control/command-closure.hpp
@@ -25,10 +25,10 @@
  ** A closure enabling self-contained execution of commands within the ProcDispatcher.
  ** After defining a proc-layer command, at some point the function arguments
  ** of the contained operation are "closed" by storing concrete argument values.
- ** These values will later on be fed to the operation when the command is invoked.
+ ** These values will be fed later on to the operation when the command is invoked.
  ** 
- ** Most of the command machinery accesses this function closure through the interface
- ** CmdClosure, while, when defining a command, subclasses typed to the specific
+ ** Most of the command machinery accesses this function closure through the generic
+ ** interface CmdClosure, while, when defining a command, subclasses typed to the specific
  ** function arguments are created. Especially, there is an ArgumentHolder template,
  ** which is used to define the storage for the concrete arguments. This ArgumentHolder
  ** internally contains an Closure instance (where SIG is the signature of the
@@ -43,10 +43,10 @@
  ** 
  ** Later on, any command needs to be made ready for execution by binding it to a specific
  ** execution environment, which especially includes the target objects to be mutated by the
- ** command. Effectively, this means "closing" the Mutation (and UNDO) functor(s) with the
+ ** command. Effectively, this means "closing" the Mutation (and UNDO) functor(s)) with the
  ** actual function arguments. These arguments are stored embedded within an ArgumentHolder,
  ** which thereby acts as closure. Besides, the ArgumentHolder also has to accommodate for
- ** storage holding the captured UNDO state (memento). Thus, internally the ArgumentHolder
+ ** storage holding the captured UNDO state (memento). Internally the ArgumentHolder
  ** has to keep track of the actual types, thus allowing to re-construct the concrete
  ** function signature when closing the Mutation.
  ** 
@@ -214,7 +214,7 @@ namespace control {
       friend bool
       compare (ParamAccessor const&, ParamAccessor const&)
         {
-          return true;;
+          return true;
         }
     };
   
diff --git a/tests/40components.tests b/tests/40components.tests
index fc23dc900..54862528f 100644
--- a/tests/40components.tests
+++ b/tests/40components.tests
@@ -653,6 +653,11 @@ return: 0
 END
 
 
+TEST "Thread-local diagnostic context" DiagrnsticContext_test  < Marker;
   
+  typedef std::vector VecI;
   
   
   
@@ -80,7 +86,7 @@ namespace test{
       virtual void
       run (Arg)
         {
-          verify_simpleProperties();
+          verify_simpleAccess();
           verify_heavilyParallelUsage();
         }
       
@@ -93,32 +99,41 @@ namespace test{
       void
       verify_simpleAccess()
         {
-          VERIFY_ERROR (LOGIC, Marker.access());
+          VERIFY_ERROR (LOGIC, Marker::access());
+          
+          VecI loggedValues;
           
           Marker zero(0);
           CHECK (0 == zero);
-          CHECK (0 == Marker.access());
+          CHECK (0 == Marker::access());
           
           { // nested scope 
-            CHECK (0 == Marker.access());
+            CHECK (0 == Marker::access());
             
             Marker one(1);
-            CHECK (1 == Marker.access());
+            CHECK (1 == Marker::access());
             CHECK (1 == one);
             CHECK (0 == zero);
             
             { // nested scope
-              CHECK (1 == Marker.access());
+              CHECK (1 == Marker::access());
               
               Marker two(2);
-              CHECK (2 == Marker.access());
+              CHECK (2 == Marker::access());
               CHECK (2 == two);
               CHECK (1 == one);
               CHECK (0 == zero);
+              
+              loggedValues = Marker::extractStack();
             }
-            CHECK (1 == Marker.access());
+            CHECK (1 == Marker::access());
           }
-          CHECK (0 == Marker.access());
+          CHECK (0 == Marker::access());
+          
+          CHECK (3 == loggedValues.size());
+          CHECK (2 == loggedValues[0]);
+          CHECK (1 == loggedValues[1]);
+          CHECK (0 == loggedValues[2]);
         }
       
       
@@ -152,8 +167,6 @@ namespace test{
             { }
         };
       
-      
-      typedef std::vector VecI;
         
       /** the actual test operation running in a separate thread */
       static void
@@ -163,11 +176,11 @@ namespace test{
           
           VecI sequence = descend (seed);
           
-          uint prev = seed;
+          uint prev = 0;
           for (uint i=0; i < sequence.size(); ++i)
             {
               uint val = sequence[i];
-              if (! (isOdd(val) && val < prev))
+              if (! (isOdd(val) && seed >= val && val > prev ))
                 throw error::Fatal ("thread-local diagnostic stack");
               prev = val;
             }
@@ -177,8 +190,9 @@ namespace test{
       descend (uint current)
         {
           if (current < 2)
-            return Marker.extractStack();
-            
+            return Marker::extractStack();
+          
+          usleep (500);
           if (isOdd(current))
             {
               Marker remember(current);

From a3b7305b2bb3a3e73ecbf4fd999444651367a3e5 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 27 Dec 2011 01:27:46 +0100
Subject: [PATCH 29/87] reduce number of threads for some tests

they tend to fail when running under builddrone
---
 tests/lib/diagnostic-context-test.cpp | 2 +-
 tests/lib/thread-local-test.cpp       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/lib/diagnostic-context-test.cpp b/tests/lib/diagnostic-context-test.cpp
index 07f3f43ed..001c92cef 100644
--- a/tests/lib/diagnostic-context-test.cpp
+++ b/tests/lib/diagnostic-context-test.cpp
@@ -39,7 +39,7 @@ namespace test{
   
   namespace { // private test setup...
     
-    const uint NUM_THREADS = 100;
+    const uint NUM_THREADS = 50;
     const uint MAX_RAND    = 1000*1000;
     
     inline bool
diff --git a/tests/lib/thread-local-test.cpp b/tests/lib/thread-local-test.cpp
index 45465045d..114ba4c05 100644
--- a/tests/lib/thread-local-test.cpp
+++ b/tests/lib/thread-local-test.cpp
@@ -38,7 +38,7 @@ namespace test{
 
   namespace { // private test setup...
     
-    const uint NUM_THREADS = 100;
+    const uint NUM_THREADS = 50;
     const uint MAX_RAND    = 5*1000*1000;
     
     

From 50885a065bddea25cf0847f77fa021db5c0b97cb Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 27 Dec 2011 00:51:20 +0100
Subject: [PATCH 30/87] move asside lib/format.hpp

...to make room for a new more specialised header
---
 src/lib/{format.hpp => format-util.hpp}             | 0
 src/lib/meta/duck-detector.hpp                      | 2 +-
 src/lib/simple-allocator.hpp                        | 2 +-
 src/lib/sub-id.hpp                                  | 2 +-
 src/lib/typed-allocation-manager.hpp                | 2 +-
 src/proc/control/command-closure.hpp                | 2 +-
 src/proc/control/command-registry.hpp               | 1 -
 src/proc/control/memento-tie.hpp                    | 2 +-
 tests/components/proc/control/command-use1-test.cpp | 2 +-
 tests/lib/format-helper-test.cpp                    | 2 +-
 10 files changed, 8 insertions(+), 9 deletions(-)
 rename src/lib/{format.hpp => format-util.hpp} (100%)

diff --git a/src/lib/format.hpp b/src/lib/format-util.hpp
similarity index 100%
rename from src/lib/format.hpp
rename to src/lib/format-util.hpp
diff --git a/src/lib/meta/duck-detector.hpp b/src/lib/meta/duck-detector.hpp
index bed83ce63..a559ed27a 100644
--- a/src/lib/meta/duck-detector.hpp
+++ b/src/lib/meta/duck-detector.hpp
@@ -30,7 +30,7 @@
  ** Because, if we can get a \c bool answer to such a question at compile time, we can use
  ** \c boost::enable_if to pick a special implementation based on the test result. Together, these
  ** techniques allow to adopt a duck-typed programming style, where an arbitrary object is allowed
- ** to enter a given API function, provided this object supports some special operations.
+ ** to enter a given API function, provided this object supports some specific operations.
  ** 
  ** While C++ certainly isn't a dynamic language and doesn't provide any kind of run time introspection,
  ** doing such check-and branch at compile time allows even to combine such a flexible approach with
diff --git a/src/lib/simple-allocator.hpp b/src/lib/simple-allocator.hpp
index 8dd5cea25..c6af61723 100644
--- a/src/lib/simple-allocator.hpp
+++ b/src/lib/simple-allocator.hpp
@@ -49,7 +49,7 @@
 #include "lib/error.hpp"
 #include "lib/meta/generator.hpp"
 #include "lib/meta/typelist-util.hpp"
-#include "lib/format.hpp"
+#include "lib/format-util.hpp"
 #include "lib/typed-counter.hpp"
 #include "include/logging.h"
 
diff --git a/src/lib/sub-id.hpp b/src/lib/sub-id.hpp
index fa47f42f5..7442fadf5 100644
--- a/src/lib/sub-id.hpp
+++ b/src/lib/sub-id.hpp
@@ -46,7 +46,7 @@
 #ifndef LIB_SUB_ID_H
 #define LIB_SUB_ID_H
 
-#include "lib/format.hpp"
+#include "lib/format-util.hpp"
 
 //#include 
 #include       /////TODO better push the hash implementation into a cpp file (and btw, do it more seriously!)
diff --git a/src/lib/typed-allocation-manager.hpp b/src/lib/typed-allocation-manager.hpp
index a4d8810fc..e44eb01bb 100644
--- a/src/lib/typed-allocation-manager.hpp
+++ b/src/lib/typed-allocation-manager.hpp
@@ -67,7 +67,7 @@
 #define LIB_TYPED_ALLOCATION_MANAGER_H
 
 #include "lib/error.hpp"
-#include "lib/format.hpp"
+#include "lib/format-util.hpp"
 #include "lib/typed-counter.hpp"
 #include "include/logging.h"
 
diff --git a/src/proc/control/command-closure.hpp b/src/proc/control/command-closure.hpp
index b03f88405..118beb68a 100644
--- a/src/proc/control/command-closure.hpp
+++ b/src/proc/control/command-closure.hpp
@@ -74,7 +74,7 @@
 #include "lib/meta/function-erasure.hpp"
 #include "lib/meta/tuple.hpp"
 #include "lib/meta/maybe-compare.hpp"
-#include "lib/format.hpp"
+#include "lib/format-util.hpp"
 #include "lib/util.hpp"
 #include "proc/control/argument-erasure.hpp"
 #include "lib/typed-allocation-manager.hpp"
diff --git a/src/proc/control/command-registry.hpp b/src/proc/control/command-registry.hpp
index c2231bd6e..c749a2dbc 100644
--- a/src/proc/control/command-registry.hpp
+++ b/src/proc/control/command-registry.hpp
@@ -60,7 +60,6 @@
 #include "lib/error.hpp"
 #include "lib/singleton.hpp"
 #include "lib/sync.hpp"
-#include "lib/format.hpp"
 #include "include/logging.h"
 #include "lib/util.hpp"
 
diff --git a/src/proc/control/memento-tie.hpp b/src/proc/control/memento-tie.hpp
index 0e89f9b21..21881da6e 100644
--- a/src/proc/control/memento-tie.hpp
+++ b/src/proc/control/memento-tie.hpp
@@ -45,7 +45,7 @@
 #include "lib/meta/function-closure.hpp"
 #include "proc/control/command-signature.hpp"
 #include "lib/functor-util.hpp"
-#include "lib/format.hpp"
+#include "lib/format-util.hpp"
 #include "lib/util.hpp"
 
 #include 
diff --git a/tests/components/proc/control/command-use1-test.cpp b/tests/components/proc/control/command-use1-test.cpp
index eaa00b2a5..d854d7f0d 100644
--- a/tests/components/proc/control/command-use1-test.cpp
+++ b/tests/components/proc/control/command-use1-test.cpp
@@ -25,7 +25,7 @@
 #include "lib/test/test-helper.hpp"
 #include "proc/control/command-invocation.hpp"
 #include "proc/control/command-def.hpp"
-#include "lib/format.hpp"
+#include "lib/format-util.hpp"
 #include "lib/util.hpp"
 
 #include "proc/control/test-dummy-commands.hpp"
diff --git a/tests/lib/format-helper-test.cpp b/tests/lib/format-helper-test.cpp
index 4c246ff3d..9ca85d3ee 100644
--- a/tests/lib/format-helper-test.cpp
+++ b/tests/lib/format-helper-test.cpp
@@ -22,7 +22,7 @@
 
 
 #include "lib/test/run.hpp"
-#include "lib/format.hpp"
+#include "lib/format-util.hpp"
 #include "lib/error.hpp"
 
 #include 

From 89928bc447fef19c66ceb8f45fbf2e5ca09ab6a0 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 27 Dec 2011 01:25:09 +0100
Subject: [PATCH 31/87] refactor format-util: simplify picking the right
 specialisation

---
 src/lib/format-util.hpp          | 105 ++++++++++++++++---------------
 src/lib/meta/trait.hpp           |   8 +--
 tests/lib/format-helper-test.cpp |  14 ++---
 3 files changed, 64 insertions(+), 63 deletions(-)

diff --git a/src/lib/format-util.hpp b/src/lib/format-util.hpp
index 4aa0a1743..d1ef9d021 100644
--- a/src/lib/format-util.hpp
+++ b/src/lib/format-util.hpp
@@ -1,5 +1,5 @@
 /*
-  FORMAT.hpp  -  helpers for formatting and diagnostics
+  FORMAT-UTIL.hpp  -  helpers for formatting and diagnostics
 
   Copyright (C)         Lumiera.org
     2009,               Hermann Vosseler 
@@ -23,18 +23,23 @@
 
 /** @file format.hpp
  ** Collection of small helpers and convenience shortcuts for diagnostics & formatting.
+ ** - util::str() performs a failsafe to-String conversion, thereby preferring a
+ **         built-in conversion operator, falling back to just a mangled type string.
+ ** - util::tyStr() generates a string corresponding to the type of the given object.
+ **         Currently just implemented through the mangled RTTI type string  
  ** 
- ** @todo we could add a facade to boost::format here, see Ticket #166
+ ** @see FormatHelper_test
+ ** @see format-string.hpp frontend for boost::format, printf-style
  ** 
  */
 
 
-#ifndef UTIL_FORMAT_H
-#define UTIL_FORMAT_H
+#ifndef LIB_FORMAT_UTIL_H
+#define LIB_FORMAT_UTIL_H
 
-//#include "lib/util.hpp"
 #include "lib/meta/trait.hpp"
 #include "lib/symbol.hpp"
+#include "lib/util.hpp"
 
 #include 
 #include 
@@ -46,61 +51,65 @@
 
 namespace util {
   
+  using boost::enable_if;
   using lib::meta::can_ToString;
   using lib::meta::can_lexical2string;
   using lib::Symbol;
-  using boost::enable_if;
-  using boost::disable_if;
+  using util::isnil;
   using std::string;
   
   
   namespace { // we need to guard the string conversion
              //  to avoid a compiler error in case the type isn't convertible....
     
-    template
-    inline string
-    invoke_2string (     typename enable_if< can_ToString,
-                    X >::type const& val)
-    {
-      return string(val);
-    }
     
     template
-    inline string
-    invoke_2string (     typename disable_if< can_ToString,
-                    X >::type const&)
-    {
-      return "";
-    }
-    
-    
+    struct use_StringConversion : can_ToString { };
     
     template
-    inline string
-    invoke_indirect2string (     typename enable_if< can_lexical2string,
-                            X >::type const& val)
-    {
-      try        { return boost::lexical_cast (val); }
-      catch(...) { return ""; }
-    }
+    struct use_LexicalConversion
+      {
+        enum { value = can_lexical2string::value
+                  &&  !can_ToString::value
+             };
+      };
+    
+    
+    /** helper: reliably get some string representation for type X */
+    template
+    struct _InvokeFailsafe
+      {
+        static string toString (X const&) { return ""; }
+      };
     
     template
-    inline string
-    invoke_indirect2string (     typename disable_if< can_lexical2string,
-                            X >::type const&)
-    {
-      return "";
-    }
-  }
+    struct _InvokeFailsafe >::type>
+      {
+        static string
+        toString (X const& val)
+          try        { return string(val); }
+          catch(...) { return ""; }
+      };
+    
+    template
+    struct _InvokeFailsafe >::type>
+      {
+        static string
+        toString (X const& val)
+          try        { return boost::lexical_cast (val); }
+          catch(...) { return ""; }
+      };
+  }//(End) guards/helpers
+  
   
   
   
   /** try to get an object converted to string.
-   *  An custom/standard conversion to string is used,
+   *  A custom/standard conversion to string is used,
    *  if applicable; otherwise, some standard types can be
    *  converted by a lexical_cast (based on operator<< ).
    *  Otherwise, either the fallback string is used, or just
-   *  a string denoting the (mangled) type.
+   *  a string based on the (mangled) type.
    */
   template
   inline string
@@ -109,24 +118,16 @@ namespace util {
       , Symbol fallback =0   /// < replacement text to show if string conversion fails
       )
   {
-    if (can_ToString::value)
-      return string(prefix) + invoke_2string(val);
-    
+    string res = _InvokeFailsafe::toString(val);
+    if (!isnil (res))
+      return string(prefix) + res;
     else
-      {
-        if (can_lexical2string::value)
-          {
-            string res (invoke_indirect2string (val));
-            if ("" != res)
-              return string(prefix) + res;
-          }
-      
-        return fallback? string(fallback)
-                       : tyStr(val);
-      }
+      return fallback? string(fallback)
+                     : tyStr(val);
   }
   
   
+  
   /** @return a string denoting the type. */
   template
   inline string
diff --git a/src/lib/meta/trait.hpp b/src/lib/meta/trait.hpp
index 0f25822fb..3c5ecbe0d 100644
--- a/src/lib/meta/trait.hpp
+++ b/src/lib/meta/trait.hpp
@@ -33,7 +33,7 @@
 #include 
 #include 
 #include 
-#include 
+
 #include 
 
 //Forward declarations for the Unwrap helper....
@@ -42,14 +42,14 @@ namespace boost{
 }
 namespace std {
 namespace tr1 {
-  template class reference_wrapper; 
+  template class reference_wrapper;
   template class shared_ptr; 
 }}
 namespace lib{
-  template  class P; 
+  template  class P;
 }
 namespace mobject{
-  template  class Placement; 
+  template  class Placement;
 }
 
 
diff --git a/tests/lib/format-helper-test.cpp b/tests/lib/format-helper-test.cpp
index 9ca85d3ee..f223510af 100644
--- a/tests/lib/format-helper-test.cpp
+++ b/tests/lib/format-helper-test.cpp
@@ -35,8 +35,7 @@ namespace util {
 namespace test {
   
   class Reticent 
-    {
-    };
+    { };
   
   class UnReticent
     : public Reticent 
@@ -47,10 +46,11 @@ namespace test {
   
   
   
-  /*************************************************
-   * verifies the proper working of helper functions
-   * frequently used within the Lumiera testsuite.
-   * @see test-helper.hpp
+  /*******************************************************************************
+   * @test verifies the proper working of some string-formatting helper functions.
+   *       - util::str() provides a failsafe to-String conversion, preferring
+   *         an built-in conversion, falling back to just a mangled type string.
+   * @see format-util.hpp
    */
   class FormatHelper_test : public Test
     {
@@ -61,7 +61,7 @@ namespace test {
         }
       
       
-      /** @test verify the maybe-to-string conversion. */
+      /** @test verify a failasfe to-string conversion. */
       void
       check2String ()
         {

From 545d9ea82b072741f21a8e18e0c903c48c8c6a9a Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 27 Dec 2011 05:22:02 +0100
Subject: [PATCH 32/87] WIP draft frontend for diagnostic output (#166)

---
 src/lib/format-string.hpp        | 126 +++++++++++++
 src/lib/format-util.hpp          |   5 +-
 tests/40components.tests         |   5 +
 tests/lib/format-string-test.cpp | 307 +++++++++++++++++++++++++++++++
 4 files changed, 440 insertions(+), 3 deletions(-)
 create mode 100644 src/lib/format-string.hpp
 create mode 100644 tests/lib/format-string-test.cpp

diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
new file mode 100644
index 000000000..bf98fa14f
--- /dev/null
+++ b/src/lib/format-string.hpp
@@ -0,0 +1,126 @@
+/*
+  FORMAT-STRING.hpp  -  string template formatting based on boost::format
+
+  Copyright (C)         Lumiera.org
+    2011,               Hermann Vosseler 
+
+  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.
+
+*/
+
+
+/** @file format-string.hpp
+ ** Front-end for printf-style string template interpolation.
+ ** While the actual implementation just delegates to boost::format, this front-end
+ ** hides the direct dependency, additionally invokes a custom toSting conversion
+ ** whenever possible, provides a direct conversion to string and catches any exceptions.
+ ** This front-end is used pervasively for diagnostics and logging, so keeping down the
+ ** compilation and object size cost and reliably handling any error is more important
+ ** than the (small) performance gain of directly invoking boost::format (which is
+ ** known to be 10 times slower than printf anyway).
+ ** 
+ ** @remarks The implementation is invoked through a set of explicit specialisations.
+ **          For custom types, we prefer to invoke operator string(), which is determined
+ **          by a directly coded metaprogramming test. The compile time and object size
+ **          overhead incurred by using this header was verified to be negligible. 
+ ** 
+ ** @see FormatString_test
+ ** @see format-helper
+ ** 
+ */
+
+
+#ifndef UTIL_FORMAT_STRING_H
+#define UTIL_FORMAT_STRING_H
+
+//#include "lib/meta/trait.hpp"
+//#include "lib/symbol.hpp"
+//#include "lib/util.hpp"
+
+#include 
+//#include 
+#include 
+//#include 
+#include 
+#include 
+
+
+
+namespace std { // forward declaration to avoid including 
+  
+  template
+  class char_traits;
+  
+  template
+  class basic_ostream;
+  
+  typedef basic_ostream > ostream;
+}
+
+
+namespace util {
+  
+  using boost::enable_if;
+//using util::isnil;
+  using std::string;
+  
+  
+  namespace { // helpers to pick a suitable specialisation....
+    
+    const size_t FORMATTER_SIZE = 100;
+    
+  }//(End) guards/helpers
+  
+  
+  
+  
+  /** 
+   * @todo write type comment
+   */
+  class _Fmt
+    : boost::noncopyable
+    {
+      char formatter_[FORMATTER_SIZE];
+      
+    public:
+      _Fmt (string formatString);
+      
+      operator string()  const;
+      
+      template
+      _Fmt&
+      operator% (TY const&);
+      
+      
+      friend std::ostream&
+      operator<< (std::ostream& os, _Fmt const&);
+      
+      friend bool operator== (_Fmt const&, _Fmt const&);
+      friend bool operator== (_Fmt const&, string const&);
+      friend bool operator== (_Fmt const&, const char * const);
+      friend bool operator== (string const&     , _Fmt const&);
+      friend bool operator== (const char * const, _Fmt const&);
+      
+      template
+      friend bool operator != (_Fmt const& fmt, X const& x) { return !(fmt == x); }
+      template
+      friend bool operator != (X const& x, _Fmt const& fmt) { return !(x == fmt); }
+    };
+  
+  
+  
+} // namespace util
+
+#endif /*UTIL_FORMAT_STRING_H*/
diff --git a/src/lib/format-util.hpp b/src/lib/format-util.hpp
index d1ef9d021..c5f1b76e8 100644
--- a/src/lib/format-util.hpp
+++ b/src/lib/format-util.hpp
@@ -21,7 +21,7 @@
 */
 
 
-/** @file format.hpp
+/** @file format-util.hpp
  ** Collection of small helpers and convenience shortcuts for diagnostics & formatting.
  ** - util::str() performs a failsafe to-String conversion, thereby preferring a
  **         built-in conversion operator, falling back to just a mangled type string.
@@ -143,5 +143,4 @@ namespace util {
   
   
 } // namespace util
-
-#endif /*UTIL_FORMAT_H*/
+#endif
diff --git a/tests/40components.tests b/tests/40components.tests
index 54862528f..3ad2bc07d 100644
--- a/tests/40components.tests
+++ b/tests/40components.tests
@@ -329,6 +329,11 @@ return: 0
 END
 
 
+PLANNED "formatting by string template" FormatString_test <-<2>-<3>-
 out: List2	:-<5>-<6>-<7>-
diff --git a/tests/lib/format-string-test.cpp b/tests/lib/format-string-test.cpp
new file mode 100644
index 000000000..79bce5f1b
--- /dev/null
+++ b/tests/lib/format-string-test.cpp
@@ -0,0 +1,307 @@
+/*
+  FormatString(Test)  -  validate string template formatting (printf style)
+
+  Copyright (C)         Lumiera.org
+    2011,               Hermann Vosseler 
+
+  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/format-string.hpp"
+#include "lib/error.hpp"
+#include "lib/util.hpp"
+
+#include 
+#include 
+#include 
+
+using boost::lexical_cast;
+using std::cout;
+using std::endl;
+
+
+namespace util {
+namespace test {
+  
+  namespace error = lumiera::error;
+  
+  
+  
+  /*******************************************************************************
+   * @test verifies our front-end for printf-style format string based formatting.
+   *       - the implementation is based on boost::format
+   *       - we create a wrapper-object on-the fly, which is able to hold
+   *         the result of a partial invocation
+   *       - explicit specialisations feed all primitive types directly
+   *         down into the implementation level. If possible, a custom operator string()
+   *         will be used for formatting.
+   *       - any kind of exception will be logged, but handled gracefully
+   * 
+   * @see format-string.hpp
+   * @see boost::format
+   */
+  class FormatString_test : public Test
+    {
+      void
+      run (Arg)
+        {
+          check_simpleInvocation();
+          check_delayedInvocation();
+          verify_typeHandling();
+          verify_customType();
+          verify_errorHandling();
+          verify_pointerHandling();
+        }
+      
+      
+      
+      void
+      check_simpleInvocation ()
+        {
+          string formatted = _Fmt("--format-template--int=%+04d--double=%5.2f--string=%-10s--")
+                                 % 12
+                                 % 1.228
+                                 % "Lumiera";
+          cout << formatted << endl;
+          CHECK (formatted == "--format-template--int=0012--double= 1.23--string=Lumiera   --");
+        }
+      
+      
+      void
+      check_delayedInvocation ()
+        {
+          string formatString = "%p %|20T_| %u";
+          _Fmt formatter (formatString);
+          
+          uint val = rand() % 100;
+          
+          formatter % &val;
+          formatter % val;
+          
+          cout << formatter << endl;
+        }
+      
+      
+      void
+      verify_typeHandling ()
+        {
+          int i(-12);
+          CHECK (_Fmt("%d") % i     == "-12"    );
+          CHECK (_Fmt("%6d") % i    == "-   12" );
+          CHECK (_Fmt("%-6d") % i   == "-12   " );
+          CHECK (_Fmt("%+-6d") % -i == "+12   " );
+          CHECK (_Fmt("%+06d") % -i == "+00012" );
+          CHECK (_Fmt("%+06X") % -i == "+0000D" );
+          CHECK (_Fmt("%+#X") % -i  == "+Dh"    );
+          
+          uint u(12);
+          CHECK (_Fmt("%d") % u     == "12"     );
+          CHECK (_Fmt("%6d") % u    == "    12" );
+          CHECK (_Fmt("%-6d") % u   == "12    " );
+          CHECK (_Fmt("%+-6d") % u  == "+12   " );
+          CHECK (_Fmt("%+06d") % u  == "+00012" );
+          
+          short sh(-123);
+          CHECK (_Fmt("%6d") % sh   == "-  123" );
+          
+          ushort ush(123);
+          CHECK (_Fmt("%6d") % ush  == "   123" );
+          
+          long l(-123);
+          CHECK (_Fmt("%6d") % l    == "-  123" );
+          
+          ulong ul(123);
+          CHECK (_Fmt("%6d") % ul   == "   123" );
+          
+          int64_t ll(5e+9);
+          CHECK (_Fmt("%d") % ll    == "5000000000" );
+          CHECK (_Fmt("%10.3d") %ll == "       500" );
+          CHECK (_Fmt("%10.3E") %ll == "   5.000E9" );
+          
+          uint64_t ull(ll);
+          CHECK (_Fmt("%d") % ull   == "5000000000" );
+          
+          float f(12.34);
+          CHECK (_Fmt("%g") % f     == "12.34"  );
+          CHECK (_Fmt("%d") % f     == "12"     );
+          CHECK (_Fmt("%e") % f     == "12.34e0");
+          
+          double d(-12.34);
+          CHECK (_Fmt("%g") % d     == "-12.34" );
+          
+          char c(0x40);
+          CHECK (_Fmt("%d") % c     == "64"     );
+          CHECK (_Fmt("%x") % c     == "40"     );
+          CHECK (_Fmt("%o") % c     == "100"    );
+          CHECK (_Fmt("%c") % c     == "@"      );
+          CHECK (_Fmt("%s") % c     == "@"      );
+          
+          unsigned char uc(0xff);
+          CHECK (_Fmt("%d") % uc    == "255"    );
+          CHECK (_Fmt("%x") % uc    == "ff"     );
+          CHECK (_Fmt("%X") % uc    == "FF"     );
+          CHECK (_Fmt("%c") % uc    == "\xFF"   );
+          CHECK (_Fmt("%s") % uc    == "\xFF"   );
+          
+          c = char(uc);
+          CHECK (_Fmt("%d") % uc    == "-1"     );
+          CHECK (_Fmt("%c") % uc    == "\xFF"   );
+          
+          string str("Lumiera");
+          CHECK (_Fmt("%s") % str   == "Lumiera"    );
+          CHECK (_Fmt("%10s") % str == "   Lumiera" );
+          CHECK (_Fmt("%8.4s") %str == "   Lumi"    );
+          CHECK (_Fmt("%10c") % str == "         L" );
+        }
+      
+      
+      /* == some custom types to test with == */
+      
+      struct Silent
+        {
+          int i_;
+          
+          Silent(int i) : i_(i) { }
+        };
+      
+      struct Verbose
+        : Silent
+        {
+          Verbose(int i) : Silent(i) { }
+          
+          virtual
+          operator string()  const
+            {
+              return _Fmt("Number-%03d") % i_; 
+            }
+        };
+      
+      struct Explosive
+        : Verbose
+        {
+          Explosive(int i) : Verbose(i) { }
+          
+          operator string()  const
+            {
+              if (23 == i_)
+                throw error::State("encountered Fantomas");
+              else
+                return Verbose::operator string();
+            }
+        };
+      
+      
+      void
+      verify_customType ()
+        {
+          Silent s(12);
+          Verbose v(13);
+          Explosive x(23);
+          
+          Silent& rs1 = v;
+          Silent& rs2 = x;
+          
+          Verbose& rv = x;
+          
+          string mangledType = _Fmt("%s") % s;
+          cout << mangledType << endl;
+          CHECK (contains (mangledType, "util"));
+          CHECK (contains (mangledType, "test"));
+          CHECK (contains (mangledType, "Silent"));
+          
+          CHECK (_Fmt("!!%s!!") % v  == "!!Number-013!!");
+          CHECK (_Fmt("!!%s!!") % x  == "!!unforeseen internal state (encountered Fantomas).!!");
+          
+          CHECK (contains (_Fmt("%s") % rs1, "Silent"));
+          CHECK (contains (_Fmt("%s") % rs2, "Silent"));
+          
+          CHECK (_Fmt("!!%s!!") % rv  == "!!unforeseen internal state (encountered Fantomas).!!");
+          
+          x.i_ = 42;
+          CHECK (_Fmt("!!%s!!") % rv  == "!!Number-042!!");
+          CHECK (_Fmt("!!%s!!") % x   == "!!Number-042!!");
+        }
+      
+      
+      void
+      verify_errorHandling ()
+        {
+          cout << _Fmt("__nix_") % 1 % 2 << endl;
+          cout << _Fmt("__%d__") << endl;
+          cout << _Fmt("__%d__") % 1 << endl;
+          cout << _Fmt("__%d__") % 1 % 2 << endl;
+          
+          cout << _Fmt("__%d__") % "dirt" << endl;
+          cout << _Fmt("__%d__") % "1234" << endl;
+          cout << _Fmt("__%d__") % "0xff" << endl;
+        }
+      
+      
+      void
+      verify_pointerHandling ()
+        {
+          int             i(-12);   int           *  pi = &  i;
+          uint             u(12);   uint          *  pu = &  u;
+          short         sh(-123);   short         * psh = & sh;
+          ushort        ush(123);   ushort        *push = &ush;
+          long           l(-123);   long          *  pl = &  l;
+          ulong          ul(123);   ulong         * pul = & ul;
+          int64_t       ll(5e+9);   int64_t       * pll = & ll;
+          uint64_t       ull(ll);   uint64_t      *pull = &ull;
+          float         f(12.34);   float         *  pf = &  f;
+          double       d(-12.34);   double        *  pd = &  d;
+          char           c(0x40);   char          *  pc = &  c;
+          unsigned char uc(0xff);   unsigned char * puc = & uc;
+          string  str("Lumiera");   string        *pstr = &str;
+          
+          CHECK (_Fmt("%d") %   i == _Fmt("%d") %   pi);
+          CHECK (_Fmt("%d") %   u == _Fmt("%d") %   pu);
+          CHECK (_Fmt("%d") %  sh == _Fmt("%d") %  psh);
+          CHECK (_Fmt("%d") % ush == _Fmt("%d") % push);
+          CHECK (_Fmt("%d") %   l == _Fmt("%d") %   pl);
+          CHECK (_Fmt("%d") %  ul == _Fmt("%d") %  pul);
+          CHECK (_Fmt("%d") %  ll == _Fmt("%d") %  pll);
+          CHECK (_Fmt("%d") % ull == _Fmt("%d") % pull);
+          CHECK (_Fmt("%e") %   f == _Fmt("%e") %   pf);
+          CHECK (_Fmt("%e") %   d == _Fmt("%e") %   pd);
+          CHECK (_Fmt("%g") %   c == _Fmt("%g") %   pc);
+          CHECK (_Fmt("%g") %  uc == _Fmt("%g") %  puc);
+          CHECK (_Fmt("%s") % str == _Fmt("%s") % pstr);
+          
+          Verbose v(42);
+          Verbose *pv = &v;
+          void    *vv = pv;
+          CHECK (_Fmt("__%s__") % v  == "__Number-042__");
+          CHECK (_Fmt("__%s__") % pv == "__Number-042__");
+          CHECK (_Fmt("__%s__") % vv != "__Number-042__");
+          
+          string address = lexical_cast(pv);
+          CHECK (_Fmt("__%s__") % vv == "__"+address+"__");
+          
+          pv = NULL;
+          vv = NULL;
+          CHECK (_Fmt("__%s__") % pv == "__(null)__");
+          CHECK (_Fmt("__%s__") % pv == "__0__");
+        }
+    };
+  
+  LAUNCHER (FormatString_test, "unit common");
+  
+  
+}} // namespace util::test
+

From 6e4883bcf1bea9bf29a02b1e84ca0cc760c8a565 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 27 Dec 2011 06:14:46 +0100
Subject: [PATCH 33/87] add stub definitions to pass compilation

---
 src/lib/format-string.cpp | 88 +++++++++++++++++++++++++++++++++++++++
 src/lib/format-string.hpp | 74 +++++++++++++++++++++++++++++---
 2 files changed, 157 insertions(+), 5 deletions(-)
 create mode 100644 src/lib/format-string.cpp

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
new file mode 100644
index 000000000..30d3a7774
--- /dev/null
+++ b/src/lib/format-string.cpp
@@ -0,0 +1,88 @@
+/*
+  FormatString  -  string template formatting based on boost::format 
+
+  Copyright (C)         Lumiera.org
+    2011,               Hermann Vosseler 
+
+  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.
+
+* *****************************************************/
+
+/** @file format-string.cpp
+ ** Implementation for printf-style formatting, based on boost::format.
+ ** This file holds the generic implementation of our format frontend,
+ ** which actually just invokes boost::format. The corresponding header
+ ** format-string.hpp contains some template functions and classes,
+ ** which select an appropriate wrapper to pass the calls down.
+ ** Here, we define explicit specialisations for the frontend to invoke,
+ ** which in turn just pass on the given argument value to the embedded
+ ** boost::format object, which in turn integrates the formatted result
+ ** into an embedded string stream.
+ ** 
+ ** To avoid exposing boost::format in the frontend header, we use an
+ ** opaque buffer of appropriate size to piggyback the formatter object.
+ ** @warning unfortunately this requires a hard coded buffer size constant
+ **          in the front-end, which we define there manually, based on
+ **          the current implementation layout found in the boost libraries.
+ **          If Boost eventually changes the implementation, the assertion
+ **          in our constructor will trigger.
+ ** 
+ ** @see FormatString_test
+ ** 
+ */
+
+
+
+#include "lib/error.hpp"
+#include "lib/format-string.hpp"
+
+#include 
+#include 
+
+
+
+
+
+namespace util {
+  
+  namespace { // implementation details...
+    
+    
+  }//(End) implementation details
+  
+  
+  /** */
+  _Fmt::_Fmt (string formatString)
+  {
+    UNIMPLEMENTED ("create the embedded boost::format object");
+  }
+  
+  
+  /** */
+  _Fmt::operator string()  const
+  {
+    UNIMPLEMENTED ("forward to the embedded boost::format object");
+  }
+  
+  
+  std::ostream&
+  operator<< (std::ostream& os, _Fmt const& fmt)
+  {
+    return os << string(fmt);
+  }
+  
+  
+  
+} // namespace util
diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index bf98fa14f..5efbe2f6f 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -79,7 +79,7 @@ namespace util {
   
   namespace { // helpers to pick a suitable specialisation....
     
-    const size_t FORMATTER_SIZE = 100;
+    enum{ FORMATTER_SIZE = 100 };
     
   }//(End) guards/helpers
   
@@ -94,21 +94,28 @@ namespace util {
     {
       char formatter_[FORMATTER_SIZE];
       
+      template
+      struct Param;
+      
+      template
+      friend struct Param;
+      
+      
     public:
       _Fmt (string formatString);
       
       operator string()  const;
       
-      template
+      template
       _Fmt&
-      operator% (TY const&);
+      operator% (VAL const&);
       
       
       friend std::ostream&
       operator<< (std::ostream& os, _Fmt const&);
       
-      friend bool operator== (_Fmt const&, _Fmt const&);
-      friend bool operator== (_Fmt const&, string const&);
+      friend bool operator== (_Fmt const&,        _Fmt const&);
+      friend bool operator== (_Fmt const&,      string const&);
       friend bool operator== (_Fmt const&, const char * const);
       friend bool operator== (string const&     , _Fmt const&);
       friend bool operator== (const char * const, _Fmt const&);
@@ -121,6 +128,63 @@ namespace util {
   
   
   
+  
+  
+  /* == forwarding into the implementation == */
+  
+  template
+  inline _Fmt&
+  _Fmt::operator% (VAL const& val)
+  {
+    Param::push (val);
+    return *this;
+  }
+  
+  
+  template
+  struct _Fmt::Param
+    {
+      static void
+      push (VAL const&)
+        {
+          UNIMPLEMENTED ("get type string");
+        }
+    };
+  
+  
+  
+  inline bool
+  operator== (_Fmt const& left, _Fmt const& right)
+  {
+    return string(left) == string(right);
+  }
+  
+  inline bool
+  operator== (_Fmt const& fmt, string const& str)
+  {
+    return string(fmt) == str;
+  }
+  
+  inline bool
+  operator== (_Fmt const& fmt, const char * const cString)
+  {
+    return string(fmt) == string(cString);
+  }
+  
+  inline bool
+  operator== (string const& str, _Fmt const& fmt)
+  {
+    return fmt == str;
+  }
+  
+  inline bool
+  operator== (const char * const cString, _Fmt const& fmt)
+  {
+    return fmt == cString;
+  }
+  
+  
+  
 } // namespace util
 
 #endif /*UTIL_FORMAT_STRING_H*/

From ce6fbe5f0f7320e5fcbbc28114a99b99d1059f89 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 27 Dec 2011 07:43:39 +0100
Subject: [PATCH 34/87] define how to pick the correct specialisation

some basic types are passed on directly;
for those, we use explicit specialisations
in the implementation file, and a traits template
to mark those cases in the header.

custom types with custom string conversion will
be converted to string; everything else
just becomes a type id
---
 src/lib/format-string.cpp |  32 +++++++++
 src/lib/format-string.hpp | 141 ++++++++++++++++++++++++++++++++++----
 2 files changed, 159 insertions(+), 14 deletions(-)

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
index 30d3a7774..c0e84fad1 100644
--- a/src/lib/format-string.cpp
+++ b/src/lib/format-string.cpp
@@ -70,6 +70,38 @@ namespace util {
   }
   
   
+  /** */
+  template
+  void
+  _Fmt::pushParameter (VAL const& val)
+  {
+    UNIMPLEMENTED ("feed the parameter to the embedded formatter");
+  }
+  
+  template
+  void
+  _Fmt::pushParameter (const VAL * const pVal)
+  {
+    if (pVal)
+      pushParameter(*pVal);
+    else
+      pushParameter(string("(null)"));
+  }
+  
+  
+  /* ===== explicitly supported =================== */
+  
+  template void _Fmt::pushParameter(string const&);
+  template void _Fmt::pushParameter(int const&);
+  template void _Fmt::pushParameter(uint const&);
+  
+  template void _Fmt::pushParameter(const string * const);
+  template void _Fmt::pushParameter(const int * const);
+  template void _Fmt::pushParameter(const uint * const);
+  
+  
+  
+  
   /** */
   _Fmt::operator string()  const
   {
diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index 5efbe2f6f..53d3d278e 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -48,6 +48,7 @@
 //#include "lib/meta/trait.hpp"
 //#include "lib/symbol.hpp"
 //#include "lib/util.hpp"
+#include "lib/error.hpp"
 
 #include 
 //#include 
@@ -70,6 +71,7 @@ namespace std { // forward declaration to avoid including 
 }
 
 
+
 namespace util {
   
   using boost::enable_if;
@@ -77,11 +79,6 @@ namespace util {
   using std::string;
   
   
-  namespace { // helpers to pick a suitable specialisation....
-    
-    enum{ FORMATTER_SIZE = 100 };
-    
-  }//(End) guards/helpers
   
   
   
@@ -92,13 +89,19 @@ namespace util {
   class _Fmt
     : boost::noncopyable
     {
+      enum{ FORMATTER_SIZE = 100 };
+
+      
+      
       char formatter_[FORMATTER_SIZE];
       
       template
-      struct Param;
+      struct Converter;
       
-      template
-      friend struct Param;
+      template
+      void pushParameter (VAL const&);
+      template
+      void pushParameter (const VAL * const);
       
       
     public:
@@ -130,28 +133,138 @@ namespace util {
   
   
   
-  /* == forwarding into the implementation == */
+  /* ===== forwarding into the implementation ====== */
   
+  /** The percent operator (\c '%' ) is used do feed 
+   *  additional parameter values to be included into 
+   *  the formatted result, at the positions marked 
+   *  within the format string.   
+   * 
+   * \par type specific treatment
+   * Basic types (numbers, chars, strings) are passed to the implementation
+   * (= boost::format) literally. For custom types, we try to use an custom
+   * string conversion, if applicable. Any other type gets just translated
+   * into a type-ID (using the mangled RTTI info). In case of errors during
+   * the conversion, a string representation of the error is returned
+   * @param val arbitrary value or pointer to be included into the result
+   * @warning you need to provide exactly the right number of parameters,
+   *          i.e. matching the number of fields in the format string.
+   */
   template
   inline _Fmt&
   _Fmt::operator% (VAL const& val)
   {
-    Param::push (val);
+    pushParameter (Converter::prepare (val));
     return *this;
   }
   
   
-  template
-  struct _Fmt::Param
+  
+  namespace { // helpers to pick a suitable specialisation....
+    
+    template
+    struct _can_convertToString
+      {
+        enum{ value = false };
+      };
+    
+    
+    /** 
+     * by default we don't allow to 
+     * treat any types directly by boost::format.
+     * As fallback we rather just produce a type-ID
+     */
+    template
+    struct _can_forward                     { enum{ value = false };};
+    
+    /* the following definitions enable some basic types
+     * to be forwarded to boost::format literally */
+    template<> struct _can_forward  { enum{ value = true }; };
+    template<> struct _can_forward     { enum{ value = true }; };
+    template<> struct _can_forward    { enum{ value = true }; };
+    
+    
+    
+    inline string
+    _log_and_stringify (std::exception const& ex)
     {
-      static void
-      push (VAL const&)
+      WARN (progress, "Error while invoking custom string conversion: %s", ex.what());
+      return ex.what();
+    }
+    
+    inline string
+    _log_unknown_exception()
+    {
+      const char* errID = lumiera_error();
+      if (errID)
+        {
+          ERROR (progress, "Unknown error while invoking custom string conversion. Lumiera error flag = %s", errID);
+          return string("Unknown error in string conversion. FLAG=")+errID;
+        }
+      else
+        {
+          ERROR (progress, "Unknown error while invoking custom string conversion. No Lumiera error flag set.");
+          return "Unknown error in string conversion";
+        }
+    }
+    
+  }//(End) guards/helpers
+  
+  
+  
+  /* === explicit specialisations to control the kind of conversion === */
+  
+  template
+  struct _Fmt::Converter
+    {
+      static string
+      prepare (VAL const&)
         {
           UNIMPLEMENTED ("get type string");
         }
     };
   
+  template
+  struct _Fmt::Converter >::type>
+    {
+      static string
+      prepare (VAL const& val)
+        try {
+            return string(val); 
+          }
+        catch(std::exception const& ex)
+          {
+            return _log_and_stringify(ex);
+          }
+        catch(...)
+          {
+            return _log_unknown_exception();
+          }
+    };
   
+  template
+  struct _Fmt::Converter >::type>
+    {
+      static VAL const&
+      prepare (VAL const& val)
+        {
+          return val;
+        }
+    };
+  
+  template
+  struct _Fmt::Converter >::type>
+    {
+      static const VAL *
+      prepare (const VAL * const pVal)
+        {
+          return pVal;
+        }
+    };
+  
+  
+  
+  /* === comparison of formatter objects === */
   
   inline bool
   operator== (_Fmt const& left, _Fmt const& right)

From 962c789a056b77d9c7c756fe321bfca98e7d3f00 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 28 Dec 2011 03:19:46 +0100
Subject: [PATCH 35/87] a horrible hack to guess the size of boost::format

...without actually including the boost/format.hpp
This saves us a lot of compilation time and debug code size
---
 src/lib/format-string.hpp   |   8 +-
 src/lib/meta/size-trait.hpp | 144 ++++++++++++++++++++++++++++++++++++
 2 files changed, 149 insertions(+), 3 deletions(-)
 create mode 100644 src/lib/meta/size-trait.hpp

diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index 53d3d278e..c164aa400 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -45,10 +45,10 @@
 #ifndef UTIL_FORMAT_STRING_H
 #define UTIL_FORMAT_STRING_H
 
-//#include "lib/meta/trait.hpp"
 //#include "lib/symbol.hpp"
 //#include "lib/util.hpp"
 #include "lib/error.hpp"
+#include "lib/meta/size-trait.hpp"
 
 #include 
 //#include 
@@ -89,12 +89,14 @@ namespace util {
   class _Fmt
     : boost::noncopyable
     {
-      enum{ FORMATTER_SIZE = 100 };
-
+      /** size of an internal implementation Buffer */
+      enum{ FORMATTER_SIZE = lib::meta::SizeTrait::BOOST_FORMAT };
       
       
+      /** @internal buffer to hold a boost::format */
       char formatter_[FORMATTER_SIZE];
       
+      
       template
       struct Converter;
       
diff --git a/src/lib/meta/size-trait.hpp b/src/lib/meta/size-trait.hpp
new file mode 100644
index 000000000..7d615d55a
--- /dev/null
+++ b/src/lib/meta/size-trait.hpp
@@ -0,0 +1,144 @@
+/*
+  SIZE-TRAIT.hpp  -  helpers and definitions to deal with the size of some known types
+
+  Copyright (C)         Lumiera.org
+    2011,               Hermann Vosseler 
+
+  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.
+
+*/
+
+
+#ifndef LIB_META_SIZE_TRAIT_H
+#define LIB_META_SIZE_TRAIT_H
+
+
+
+#include 
+#include 
+
+
+namespace lib {
+namespace meta {
+  
+  
+  /** 
+   * A collection of constants to describe the expected size
+   * of some known classes, without needing to include the
+   * respective headers. This is an optimisation to improve
+   * compilation times and/or reduce size of the generated
+   * object files in debug mode. To get those sizes computed
+   * in a fairly portable way, but without much overhead,
+   * we mimic the memory layout of "the real thing"
+   * with some reasonable simplifications:
+   * - the size of vectors doesn't really depend on the elements
+   * - our strings, streams and buffers use just simple chars
+   * 
+   * \par Interface
+   * The purpose of this whole construction is to pull off
+   * some constants based on sizeof expressions:
+   * - the size of a string
+   * - the size of a vector
+   * - the size of a boost::format
+   * 
+   * @warning this setup is quite fragile and directly relies
+   *          on the implementation layout of the GNU STL and Boost.
+   *          Whenever using this stuff, make sure to place an assertion
+   *          somewhere down in the implementation level to check against
+   *          the size of the real thing.
+   */
+  class SizeTrait
+    { 
+      //-------------------------------------mimicked-definitions--
+      
+      typedef std::vector Vector;
+      
+      struct CompatAllocator
+        : std::allocator
+        { };
+      
+      struct Locale
+        {
+          void* _M_impl;
+        };
+      
+      template
+      struct Optional
+        {
+          bool m_initialized_;
+          T    m_storage_;
+        };
+      
+      enum IOS_Openmode 
+        { 
+          _S_app        = 1L << 0,
+          _S_ate        = 1L << 1,
+          _S_bin        = 1L << 2,
+          _S_in         = 1L << 3,
+          _S_out        = 1L << 4,
+          _S_trunc      = 1L << 5,
+          _S_ios_openmode_end = 1L << 16 
+        };      
+      
+      struct BasicStringbuf
+        {
+          char * _M_in_beg;
+          char * _M_in_cur;
+          char * _M_in_end;
+          char * _M_out_beg;
+          char * _M_out_cur;
+          char * _M_out_end;
+          
+          Locale _M_buf_locale;
+        };
+      
+      struct BasicAltstringbuf
+        : BasicStringbuf
+        {
+          char *         putend_;
+          bool     is_allocated_;
+          IOS_Openmode     mode_;
+          CompatAllocator alloc_;
+        };
+      
+      struct BoostFormat
+        {
+          Vector items_;
+          Vector bound_;
+          int    style_;
+          int    cur_arg_;
+          int    num_args_;
+          bool   dumped_;
+          std::string   prefix_;
+          unsigned char exceptions;
+          BasicAltstringbuf buf_;
+          Optional loc_;
+        };
+      //-------------------------------------mimicked-definitions--
+      
+      
+    public:/* ===== Interface: size constants ===== */ 
+      
+      enum {
+             STRING          = sizeof(std::string)
+           , VECTOR          = sizeof(std::vector)
+           
+           , BOOST_FORMAT    = sizeof(BoostFormat)
+           };
+    };
+  
+  
+}} // namespace lib::meta
+#endif

From cd3c633fc064afd2736b4e65214a94307007abab Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 28 Dec 2011 05:44:57 +0100
Subject: [PATCH 36/87] STATIC_ASSERT to verify guessed size

... and we indeed had an error: vector
is way larger than normal vectors!
---
 src/lib/format-string.cpp   |  3 +++
 src/lib/meta/size-trait.hpp | 23 ++++++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
index c0e84fad1..56fab4a96 100644
--- a/src/lib/format-string.cpp
+++ b/src/lib/format-string.cpp
@@ -48,6 +48,7 @@
 #include "lib/error.hpp"
 #include "lib/format-string.hpp"
 
+#include 
 #include 
 #include 
 
@@ -66,6 +67,8 @@ namespace util {
   /** */
   _Fmt::_Fmt (string formatString)
   {
+    BOOST_STATIC_ASSERT (sizeof(boost::format) <= FORMATTER_SIZE);
+      
     UNIMPLEMENTED ("create the embedded boost::format object");
   }
   
diff --git a/src/lib/meta/size-trait.hpp b/src/lib/meta/size-trait.hpp
index 7d615d55a..1abbb046b 100644
--- a/src/lib/meta/size-trait.hpp
+++ b/src/lib/meta/size-trait.hpp
@@ -64,6 +64,7 @@ namespace meta {
       //-------------------------------------mimicked-definitions--
       
       typedef std::vector Vector;
+      typedef std::vector   BVector;
       
       struct CompatAllocator
         : std::allocator
@@ -102,6 +103,8 @@ namespace meta {
           char * _M_out_end;
           
           Locale _M_buf_locale;
+          
+          virtual ~BasicStringbuf() { }
         };
       
       struct BasicAltstringbuf
@@ -115,12 +118,12 @@ namespace meta {
       
       struct BoostFormat
         {
-          Vector items_;
-          Vector bound_;
-          int    style_;
-          int    cur_arg_;
-          int    num_args_;
-          bool   dumped_;
+          Vector  items_;
+          BVector bound_;       // note: differs in size
+          int     style_;
+          int     cur_arg_;
+          int     num_args_;
+          mutable bool   dumped_;
           std::string   prefix_;
           unsigned char exceptions;
           BasicAltstringbuf buf_;
@@ -131,9 +134,11 @@ namespace meta {
       
     public:/* ===== Interface: size constants ===== */ 
       
-      enum {
-             STRING          = sizeof(std::string)
-           , VECTOR          = sizeof(std::vector)
+      enum { ALIGNMENT       = sizeof(size_t)
+           
+           , STRING          = sizeof(std::string)
+           , VECTOR          = sizeof(Vector)
+           , BVECTOR         = sizeof(BVector)
            
            , BOOST_FORMAT    = sizeof(BoostFormat)
            };

From dbb63ffc081c20ac42a48238434d2c824da51ffb Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 28 Dec 2011 06:17:26 +0100
Subject: [PATCH 37/87] perfer STATIC_ASSERT to check for suitable
 placement-New buffer size

Still incomplete, but already this small change
detected an error in the output-designation. Cough.
---
 src/lib/opaque-holder.hpp               | 21 +++++++++++++--------
 src/lib/polymorphic-value.hpp           |  4 +++-
 src/proc/mobject/output-designation.hpp |  8 +++++---
 3 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/src/lib/opaque-holder.hpp b/src/lib/opaque-holder.hpp
index 646c24b45..d19ecfcc8 100644
--- a/src/lib/opaque-holder.hpp
+++ b/src/lib/opaque-holder.hpp
@@ -73,6 +73,7 @@
 #include "lib/util.hpp"
 
 #include 
+#include 
 
 
 namespace lib {
@@ -266,7 +267,8 @@ namespace lib {
           explicit
           Buff (SUB const& obj)
             {
-              REQUIRE (siz >= sizeof(SUB));
+              BOOST_STATIC_ASSERT (siz >= sizeof(SUB));
+              
               new(Buffer::ptr()) SUB (obj);
             }
           
@@ -613,6 +615,8 @@ namespace lib {
       void
       placeDefault()
         {
+          BOOST_STATIC_ASSERT (siz >= sizeof(DEFAULT));
+          
           new(&buf_) DEFAULT();
         }
       
@@ -640,13 +644,14 @@ namespace lib {
           destroy();                         \
           try                                 \
             {                                  \
-              REQUIRE (siz >= sizeof(TY));      \
-              return *new(&buf_) _CTOR_CALL_;    \
-            }                                     \
-          catch (...)                              \
-            {                                       \
-              placeDefault();                        \
-              throw;                                  \
+              BOOST_STATIC_ASSERT (siz >= sizeof(TY));\
+                                                 \
+              return *new(&buf_) _CTOR_CALL_;     \
+            }                                      \
+          catch (...)                               \
+            {                                        \
+              placeDefault();                         \
+              throw;                                   \
             }
       
       
diff --git a/src/lib/polymorphic-value.hpp b/src/lib/polymorphic-value.hpp
index a9b92bc5e..2213a67a3 100644
--- a/src/lib/polymorphic-value.hpp
+++ b/src/lib/polymorphic-value.hpp
@@ -146,6 +146,7 @@
 #include "lib/meta/duck-detector.hpp"
 
 #include 
+#include 
 
 
 namespace lib {
@@ -384,7 +385,8 @@ namespace lib {
       template
       PolymorphicValue (IMP*)
         {
-          REQUIRE (siz >= sizeof(IMP));
+          BOOST_STATIC_ASSERT (siz >= sizeof(IMP));
+          
           new(&buf_) IMP();
         }
       
diff --git a/src/proc/mobject/output-designation.hpp b/src/proc/mobject/output-designation.hpp
index d9b24dc6e..ab5c3ca55 100644
--- a/src/proc/mobject/output-designation.hpp
+++ b/src/proc/mobject/output-designation.hpp
@@ -103,10 +103,12 @@ namespace mobject {
         };
       
     private:
-      enum {
-        SPEC_SIZ = mp::maxSize<
+      enum
+        { VTABLE   = sizeof(size_t)
+        , SPEC_SIZ = VTABLE
+                   + mp::maxSize<
                        mp::Types< PID, lumiera_uid, uint>::List>::value 
-      };
+        };
       typedef lib::OpaqueHolder SpecBuff;
       
       

From 6c95c1b0e48e87df10f38b7ca811b3d41bde6988 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 28 Dec 2011 06:40:51 +0100
Subject: [PATCH 38/87] format-frontend: fill in missing bits of the
 implementation

---
 src/lib/format-string.cpp        | 24 ++++++++++++++++++++----
 src/lib/format-string.hpp        |  9 +++++----
 tests/lib/format-string-test.cpp |  4 ++--
 3 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
index 56fab4a96..4db936d6e 100644
--- a/src/lib/format-string.cpp
+++ b/src/lib/format-string.cpp
@@ -58,8 +58,15 @@
 
 namespace util {
   
+  using boost::format;
+  
   namespace { // implementation details...
     
+    inline boost::format&
+    accessImpl (char* buffer)
+    {
+      return reinterpret_cast (*buffer);
+    }
     
   }//(End) implementation details
   
@@ -68,8 +75,13 @@ namespace util {
   _Fmt::_Fmt (string formatString)
   {
     BOOST_STATIC_ASSERT (sizeof(boost::format) <= FORMATTER_SIZE);
-      
-    UNIMPLEMENTED ("create the embedded boost::format object");
+    
+    new(formatter_) boost::format(formatString);
+  }
+  
+  _Fmt::~_Fmt ()
+  {
+    accessImpl(formatter_).~format();
   }
   
   
@@ -78,7 +90,7 @@ namespace util {
   void
   _Fmt::pushParameter (VAL const& val)
   {
-    UNIMPLEMENTED ("feed the parameter to the embedded formatter");
+    accessImpl(formatter_) % val;
   }
   
   template
@@ -97,10 +109,14 @@ namespace util {
   template void _Fmt::pushParameter(string const&);
   template void _Fmt::pushParameter(int const&);
   template void _Fmt::pushParameter(uint const&);
+  template void _Fmt::pushParameter(float const&);
+  template void _Fmt::pushParameter(double const&);
   
   template void _Fmt::pushParameter(const string * const);
   template void _Fmt::pushParameter(const int * const);
   template void _Fmt::pushParameter(const uint * const);
+  template void _Fmt::pushParameter(const float * const);
+  template void _Fmt::pushParameter(const double * const);
   
   
   
@@ -108,7 +124,7 @@ namespace util {
   /** */
   _Fmt::operator string()  const
   {
-    UNIMPLEMENTED ("forward to the embedded boost::format object");
+    return accessImpl(formatter_).str();
   }
   
   
diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index c164aa400..78c51aa9b 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -51,9 +51,7 @@
 #include "lib/meta/size-trait.hpp"
 
 #include 
-//#include 
 #include 
-//#include 
 #include 
 #include 
 
@@ -94,7 +92,7 @@ namespace util {
       
       
       /** @internal buffer to hold a boost::format */
-      char formatter_[FORMATTER_SIZE];
+      mutable char formatter_[FORMATTER_SIZE];
       
       
       template
@@ -107,6 +105,7 @@ namespace util {
       
       
     public:
+     ~_Fmt ();
       _Fmt (string formatString);
       
       operator string()  const;
@@ -184,6 +183,8 @@ namespace util {
     template<> struct _can_forward  { enum{ value = true }; };
     template<> struct _can_forward     { enum{ value = true }; };
     template<> struct _can_forward    { enum{ value = true }; };
+    template<> struct _can_forward   { enum{ value = true }; };
+    template<> struct _can_forward  { enum{ value = true }; };
     
     
     
@@ -222,7 +223,7 @@ namespace util {
       static string
       prepare (VAL const&)
         {
-          UNIMPLEMENTED ("get type string");
+          return string("«")+typeid(VAL).name()+"»";
         }
     };
   
diff --git a/tests/lib/format-string-test.cpp b/tests/lib/format-string-test.cpp
index 79bce5f1b..b304c81ed 100644
--- a/tests/lib/format-string-test.cpp
+++ b/tests/lib/format-string-test.cpp
@@ -73,12 +73,12 @@ namespace test {
       void
       check_simpleInvocation ()
         {
-          string formatted = _Fmt("--format-template--int=%+04d--double=%5.2f--string=%-10s--")
+          string formatted = _Fmt("--format-template--int=%04d--double=%+5.2f--string=%-10s--")
                                  % 12
                                  % 1.228
                                  % "Lumiera";
           cout << formatted << endl;
-          CHECK (formatted == "--format-template--int=0012--double= 1.23--string=Lumiera   --");
+          CHECK (formatted == "--format-template--int=0012--double=+1.23--string=Lumiera   --");
         }
       
       

From 7efff377d00f3e23b2c611f0f6d216a275f05ff5 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 30 Dec 2011 03:45:51 +0100
Subject: [PATCH 39/87] use separate test group for metaprogramming tests

---
 tests/lib/format-string-test.cpp      | 2 +-
 tests/lib/meta/duck-detector-test.cpp | 2 +-
 tests/lib/meta/type-tuple-test.cpp    | 2 +-
 tests/lib/meta/typelist-util-test.cpp | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/lib/format-string-test.cpp b/tests/lib/format-string-test.cpp
index b304c81ed..e87fe8739 100644
--- a/tests/lib/format-string-test.cpp
+++ b/tests/lib/format-string-test.cpp
@@ -300,7 +300,7 @@ namespace test {
         }
     };
   
-  LAUNCHER (FormatString_test, "unit common");
+  LAUNCHER (FormatString_test, "unit meta");
   
   
 }} // namespace util::test
diff --git a/tests/lib/meta/duck-detector-test.cpp b/tests/lib/meta/duck-detector-test.cpp
index 064ed9041..7eade48ed 100644
--- a/tests/lib/meta/duck-detector-test.cpp
+++ b/tests/lib/meta/duck-detector-test.cpp
@@ -90,7 +90,7 @@ namespace test{
   
   
   /** Register this test class... */
-  LAUNCHER (DuckDetector_test, "unit common");
+  LAUNCHER (DuckDetector_test, "unit meta");
   
   
   
diff --git a/tests/lib/meta/type-tuple-test.cpp b/tests/lib/meta/type-tuple-test.cpp
index 8589b322a..0bfa8e3a9 100644
--- a/tests/lib/meta/type-tuple-test.cpp
+++ b/tests/lib/meta/type-tuple-test.cpp
@@ -451,7 +451,7 @@ namespace test {
   
   
   /** Register this test class... */
-  LAUNCHER (TypeTuple_test, "unit common");
+  LAUNCHER (TypeTuple_test, "unit meta");
   
   
   
diff --git a/tests/lib/meta/typelist-util-test.cpp b/tests/lib/meta/typelist-util-test.cpp
index 66a2112c0..576167a40 100644
--- a/tests/lib/meta/typelist-util-test.cpp
+++ b/tests/lib/meta/typelist-util-test.cpp
@@ -76,7 +76,7 @@ namespace test {
   
   
   /** Register this test class... */
-  LAUNCHER (TypeListUtil_test, "unit common");
+  LAUNCHER (TypeListUtil_test, "unit meta");
   
   
   

From e054c272b6c1d484146b6affb309615da8b8a928 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 30 Dec 2011 03:45:10 +0100
Subject: [PATCH 40/87] research: detecting the possibility of a string
 conversion

find out about the corner cases of this
simplistic implementation
---
 research/try.cpp                   |  91 +++++++++++++--
 src/lib/format-string.hpp          |  58 +++++-----
 src/lib/meta/util.hpp              |  35 +++++-
 tests/40components.tests           |   5 +
 tests/lib/meta/meta-utils-test.cpp | 171 +++++++++++++++++++++++++++++
 5 files changed, 321 insertions(+), 39 deletions(-)
 create mode 100644 tests/lib/meta/meta-utils-test.cpp

diff --git a/research/try.cpp b/research/try.cpp
index 7b73f4c1f..763f90caa 100644
--- a/research/try.cpp
+++ b/research/try.cpp
@@ -21,30 +21,101 @@
 // 1/11  - how to fetch the path of the own executable -- at least under Linux?
 // 10/11 - simple demo using a pointer and a struct
 // 11/11 - using the boost random number generator(s)
+// 12/11 - how to detect if string conversion is possible?
 
 
+#include "lib/util.hpp"
+
 #include 
-#include 
-#include 
-
-using boost::lexical_cast;
+#include 
 
+using std::string;
 using std::cout;
 using std::endl;
 
 
+typedef char Yes_t;
+struct No_t { char more_than_one[4]; };
+
+
+template
+struct _can_convertToString
+  {
+    static TY & probe();
+    
+    static Yes_t check(string);
+    static No_t  check(...);
+    
+  public:
+    static const bool value = (sizeof(Yes_t)==sizeof(check(probe())));
+  };
+
+
+class SubString
+  : public string
+  { 
+  public:
+      SubString() : string("sublunar") { }
+  };
+
+class Something { };
+
+struct SomehowStringy
+  {
+    operator string() { return "No such thing"; }
+  };
+
+struct SomehowSub
+  {
+    operator SubString() { return SubString(); }
+  };
+
+class SomehowSubSub
+  : public SomehowSub
+  { 
+  };
+
+
+
+
+template
+bool
+investigate (TY const&)
+  {
+    return _can_convertToString::value;
+  }
+
+#define SHOW_CHECK(_EXPR_) cout << STRINGIFY(_EXPR_) << "\t : " << (investigate(_EXPR_)? "Yes":"No") << endl;
 
 int 
-main (int cnt, char* argv[])
+main (int, char**)
   {
     
-    int32_t seed = (2 == cnt)? lexical_cast (argv[1]) : 42;
+    SHOW_CHECK (string("nebbich"));
+    SHOW_CHECK ("gurks");
+    SHOW_CHECK (23.34);
+    SHOW_CHECK (23);
     
-    boost::rand48 ranGen(seed);
+    string urgs("urgs");
+    string & urgs_ref (urgs);
+    string const& urgs_const_ref (urgs);
+    string * urgs_ptr = &urgs;
     
-    cout << "seed = "<< seed << endl;
-    for (uint i=0; i< 100; ++i)
-      cout << ranGen() % CHAR_MAX <<"__";
+    SHOW_CHECK (urgs_ref);
+    SHOW_CHECK (urgs_const_ref);
+    SHOW_CHECK (*urgs_ptr);
+    
+    SubString sub;
+    Something thing;
+    const SomehowStringy stringy = SomehowStringy();
+    SomehowSubSub subsub;
+    SubString const& subRef(subsub);
+    
+    SHOW_CHECK (sub);
+    SHOW_CHECK (thing);
+    SHOW_CHECK (stringy);
+    SHOW_CHECK (subsub);
+    SHOW_CHECK (subRef);
     
     cout <<  "\n.gulp.\n";
     
diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index 78c51aa9b..b1a8ce44b 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -45,9 +45,8 @@
 #ifndef UTIL_FORMAT_STRING_H
 #define UTIL_FORMAT_STRING_H
 
-//#include "lib/symbol.hpp"
-//#include "lib/util.hpp"
 #include "lib/error.hpp"
+#include "lib/meta/util.hpp"
 #include "lib/meta/size-trait.hpp"
 
 #include 
@@ -73,7 +72,6 @@ namespace std { // forward declaration to avoid including 
 namespace util {
   
   using boost::enable_if;
-//using util::isnil;
   using std::string;
   
   
@@ -95,11 +93,13 @@ namespace util {
       mutable char formatter_[FORMATTER_SIZE];
       
       
+      /** helper to prepare parameters for inclusion */
       template
       struct Converter;
       
       template
       void pushParameter (VAL const&);
+      
       template
       void pushParameter (const VAL * const);
       
@@ -108,7 +108,7 @@ namespace util {
      ~_Fmt ();
       _Fmt (string formatString);
       
-      operator string()  const;
+      operator string()  const;  ///< get the formatted result 
       
       template
       _Fmt&
@@ -136,14 +136,13 @@ namespace util {
   
   /* ===== forwarding into the implementation ====== */
   
-  /** The percent operator (\c '%' ) is used do feed 
-   *  additional parameter values to be included into 
-   *  the formatted result, at the positions marked 
-   *  within the format string.   
+  /** The percent operator (\c '%' ) is used do feed parameter values
+   *  to be included into the formatted result, at the positions marked 
+   *  by printf-style placeholders within the format string.   
    * 
    * \par type specific treatment
    * Basic types (numbers, chars, strings) are passed to the implementation
-   * (= boost::format) literally. For custom types, we try to use an custom
+   * (= boost::format) literally. For custom types, we try to use a custom
    * string conversion, if applicable. Any other type gets just translated
    * into a type-ID (using the mangled RTTI info). In case of errors during
    * the conversion, a string representation of the error is returned
@@ -163,30 +162,31 @@ namespace util {
   
   namespace { // helpers to pick a suitable specialisation....
     
-    template
-    struct _can_convertToString
-      {
-        enum{ value = false };
-      };
-    
-    
     /** 
      * by default we don't allow to 
      * treat any types directly by boost::format.
      * As fallback we rather just produce a type-ID
      */
     template
-    struct _can_forward                     { enum{ value = false };};
+    struct _shall_forward                     { enum{ value = false };};
     
     /* the following definitions enable some basic types
      * to be forwarded to boost::format literally */
-    template<> struct _can_forward  { enum{ value = true }; };
-    template<> struct _can_forward     { enum{ value = true }; };
-    template<> struct _can_forward    { enum{ value = true }; };
-    template<> struct _can_forward   { enum{ value = true }; };
-    template<> struct _can_forward  { enum{ value = true }; };
+    template<> struct _shall_forward  { enum{ value = true }; };
+    template<> struct _shall_forward     { enum{ value = true }; };
+    template<> struct _shall_forward    { enum{ value = true }; };
+    template<> struct _shall_forward   { enum{ value = true }; };
+    template<> struct _shall_forward  { enum{ value = true }; };
     
     
+    template
+    struct _shall_convert_toString
+      {
+        enum{ value = ! _shall_forward::value
+                 && lib::meta::_can_convertToString::value
+        };
+      };
+    
     
     inline string
     _log_and_stringify (std::exception const& ex)
@@ -215,8 +215,10 @@ namespace util {
   
   
   
+  
   /* === explicit specialisations to control the kind of conversion === */
   
+  /** default/fallback: just indicate the (static) type */
   template
   struct _Fmt::Converter
     {
@@ -227,8 +229,9 @@ namespace util {
         }
     };
   
+  /** some custom types explicitly provide string representation */
   template
-  struct _Fmt::Converter >::type>
+  struct _Fmt::Converter >::type>
     {
       static string
       prepare (VAL const& val)
@@ -245,8 +248,10 @@ namespace util {
           }
     };
   
+  /** some basic types are directly forwarded down to the implementation;
+   * @note this requires explicit specialisations in format-string.cpp */
   template
-  struct _Fmt::Converter >::type>
+  struct _Fmt::Converter >::type>
     {
       static VAL const&
       prepare (VAL const& val)
@@ -256,7 +261,7 @@ namespace util {
     };
   
   template
-  struct _Fmt::Converter >::type>
+  struct _Fmt::Converter >::type>
     {
       static const VAL *
       prepare (const VAL * const pVal)
@@ -302,5 +307,4 @@ namespace util {
   
   
 } // namespace util
-
-#endif /*UTIL_FORMAT_STRING_H*/
+#endif
diff --git a/src/lib/meta/util.hpp b/src/lib/meta/util.hpp
index f32cbb1ed..f305c46bb 100644
--- a/src/lib/meta/util.hpp
+++ b/src/lib/meta/util.hpp
@@ -21,10 +21,22 @@
 */
 
 
+/** @file util.hpp
+ ** Simple and lightweight helpers for metaprogramming and type detection.
+ ** This header is a collection of very basic type detection and metaprogramming utilities.
+ ** @warning indirectly, this header gets included into the majority of compilation units.
+ **          Avoid anything here which increases compilation times or adds much debugging info. 
+ ** 
+ ** @see MetaUtils_test
+ ** @see trait.hpp
+ ** @see typelist.hpp
+ ** 
+ */
+
+
 #ifndef LIB_META_UTIL_H
 #define LIB_META_UTIL_H
 
-
   
 namespace lib {
 namespace meta {
@@ -33,7 +45,7 @@ namespace meta {
   /* types for figuring out the overload resolution chosen by the compiler */
 
   typedef char Yes_t;
-  struct No_t { char padding[8]; };
+  struct No_t { char more_than_one[4]; };
     
     
     
@@ -56,6 +68,25 @@ namespace meta {
     };
   
   
+  /** detect possibility of a conversion to string.
+   *  Naive implementation just trying a the direct conversion.
+   *  The embedded constant #value will be true in case this succeeds.
+   *  Might fail in more tricky situations (references, const, volatile)
+   * @see string-util.hpp more elaborate solution including lexical_cast
+   */
+  template
+  struct _can_convertToString
+    {
+      static T & probe();
+      
+      static Yes_t check(std::string);
+      static No_t  check(...);
+      
+    public:
+      static const bool value = (sizeof(Yes_t)==sizeof(check(probe())));
+    };
+  
+  
   /** semi-automatic detection if an instantiation is possible.
    *  Requires help by the template to be tested, which needs to define
    *  a typedef member \c is_defined. The embedded metafunction Test can be used
diff --git a/tests/40components.tests b/tests/40components.tests
index 3ad2bc07d..62827efac 100644
--- a/tests/40components.tests
+++ b/tests/40components.tests
@@ -394,6 +394,11 @@ return: 0
 END
 
 
+TEST "metaprogramming helpers" Metautils_test  <
+
+  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/meta/util.hpp"
+#include "lib/meta/typelist.hpp"
+
+#include 
+
+
+namespace lib  {
+namespace meta {
+namespace test {
+  
+  using std::string;
+  
+  
+  
+  
+  
+  
+  /*************************************************************************
+   * @test verify basic type trait and metaprogramming helpers.
+   *       - marker types to tell which overload the compiler picks
+   *       - simple trait to detect the possibility of a string conversion
+   *       - trait to detect a typelist type
+   */
+  class MetaUtils_test : public Test
+    {
+      void
+      run (Arg) 
+        {
+          verify_basicAssumptions();
+          
+          detect_stringConversion();
+          detect_typeList();
+        }
+      
+      
+      /** @test demonstrate / verify the
+       * basic type trait detection technique:
+       * By investigating the return type, we can
+       * figure out which overload the compiler picks..
+       */
+      void
+      verify_basicAssumptions()
+        {
+          CHECK (sizeof(Yes_t) != sizeof (No_t));
+          
+          CHECK (sizeof(Yes_t) == sizeof (probe (1)));
+          CHECK (sizeof(Yes_t) == sizeof (probe (1L)));         // conversion long -> int
+          CHECK (sizeof(Yes_t) == sizeof (probe ('a')));        // conversion char -> int
+          CHECK (sizeof(No_t)  == sizeof (probe ("a")));        // char * can't be converted
+        }
+      
+      static Yes_t probe (int);
+      static No_t  probe (...);
+      
+      
+      
+      //-------------------------------------------------TEST-types--
+      class SubString : public string
+        { 
+        public:
+            SubString() : string("sublunar") { }
+        };
+      
+      class Something { };
+      
+      struct SomehowStringy
+        {
+          operator string() { return "No such thing"; }
+        };
+      
+      struct SomehowSubtle
+        {
+          operator SubString() { return SubString(); }
+        };
+      
+      class SomehowSubSub : public SomehowSubtle { };
+      //-------------------------------------------------TEST-types--
+      
+      template
+      static bool
+      can_convert (TY const&)
+        {
+          return _can_convertToString::value;
+        }
+      
+      void
+      detect_stringConversion()
+        {
+          CHECK ( can_convert (string("inline string")));
+          CHECK ( can_convert ("char literal"));
+          CHECK (!can_convert (23.34));
+          CHECK (!can_convert (23));
+          CHECK (!can_convert (1L));
+          
+          string str("mhm");
+          string & str_ref (str);
+          string const& str_const_ref (str);
+          string * str_ptr = &str;
+          
+          CHECK ( can_convert (str));
+          CHECK ( can_convert (str_ref));
+          CHECK ( can_convert (str_const_ref));
+          CHECK ( can_convert (*str_ptr));
+          CHECK (!can_convert (str_ptr));
+          
+          SubString sub;
+          Something thing;
+          const SomehowStringy stringy = SomehowStringy();
+          SomehowSubSub subsub;
+          SubString const& subRef(subsub);
+          
+          CHECK ( can_convert (sub));
+          CHECK (!can_convert (thing));
+          CHECK ( can_convert (stringy));
+          CHECK ( can_convert (subsub));
+          CHECK ( can_convert (subRef));
+        }
+      
+      
+      
+      //-------------------------------------------------TEST-types--
+      typedef Types< int
+                   , uint
+                   , int64_t
+                   , uint64_t
+                   >::List     TheList;
+      
+      typedef Types<  >::List  EmptyList;
+      //-------------------------------------------------TEST-types--
+      
+      
+      void
+      detect_typeList()
+        {
+          CHECK ( is_Typelist::value);
+          CHECK ( is_Typelist::value);
+          CHECK (!is_Typelist::value);
+        }
+    };
+  
+  
+  /** Register this test class... */
+  LAUNCHER (MetaUtils_test, "unit meta");
+  
+  
+  
+}}} // namespace lib::meta::test

From 0d136e2703f69bc21822c98bb9a3055de3c50ef1 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 30 Dec 2011 05:13:27 +0100
Subject: [PATCH 41/87] define explicit specialisations for primitive types

---
 src/lib/format-string.cpp        | 20 ++++++++++++++++++
 src/lib/format-string.hpp        | 15 +++++++++++---
 src/lib/meta/util.hpp            |  2 +-
 tests/lib/format-string-test.cpp | 35 ++++++++++++++++----------------
 4 files changed, 51 insertions(+), 21 deletions(-)

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
index 4db936d6e..d0804c77f 100644
--- a/src/lib/format-string.cpp
+++ b/src/lib/format-string.cpp
@@ -103,18 +103,38 @@ namespace util {
       pushParameter(string("(null)"));
   }
   
+  template<>
+  void
+  _Fmt::pushParameter (const char * const cString)
+  {
+    pushParameter (cString);
+  }
+  
+  
   
   /* ===== explicitly supported =================== */
   
   template void _Fmt::pushParameter(string const&);
+  template void _Fmt::pushParameter(char const&);
+  template void _Fmt::pushParameter(uchar const&);
   template void _Fmt::pushParameter(int const&);
   template void _Fmt::pushParameter(uint const&);
+  template void _Fmt::pushParameter(short const&);
+  template void _Fmt::pushParameter(ushort const&);
+  template void _Fmt::pushParameter(int64_t const&);
+  template void _Fmt::pushParameter(uint64_t const&);
   template void _Fmt::pushParameter(float const&);
   template void _Fmt::pushParameter(double const&);
+  template void _Fmt::pushParameter(void * const&);
   
   template void _Fmt::pushParameter(const string * const);
+  template void _Fmt::pushParameter(const uchar * const);
   template void _Fmt::pushParameter(const int * const);
   template void _Fmt::pushParameter(const uint * const);
+  template void _Fmt::pushParameter(const short * const);
+  template void _Fmt::pushParameter(const ushort * const);
+  template void _Fmt::pushParameter(const int64_t * const);
+  template void _Fmt::pushParameter(const uint64_t * const);
   template void _Fmt::pushParameter(const float * const);
   template void _Fmt::pushParameter(const double * const);
   
diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index b1a8ce44b..d7eb1fde2 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -71,10 +71,11 @@ namespace std { // forward declaration to avoid including 
 
 namespace util {
   
+  typedef unsigned char uchar;
+  
   using boost::enable_if;
   using std::string;
-  
-  
+
   
   
   
@@ -173,17 +174,25 @@ namespace util {
     /* the following definitions enable some basic types
      * to be forwarded to boost::format literally */
     template<> struct _shall_forward  { enum{ value = true }; };
+    template<> struct _shall_forward    { enum{ value = true }; };
+    template<> struct _shall_forward   { enum{ value = true }; };
     template<> struct _shall_forward     { enum{ value = true }; };
     template<> struct _shall_forward    { enum{ value = true }; };
+    template<> struct _shall_forward   { enum{ value = true }; };
+    template<> struct _shall_forward  { enum{ value = true }; };
+    template<> struct _shall_forward { enum{ value = true }; };
+    template<> struct _shall_forward{ enum{ value = true }; };
     template<> struct _shall_forward   { enum{ value = true }; };
     template<> struct _shall_forward  { enum{ value = true }; };
+    template<> struct _shall_forward   { enum{ value = true }; };
     
     
     template
     struct _shall_convert_toString
       {
         enum{ value = ! _shall_forward::value
-                 && lib::meta::_can_convertToString::value
+                 &&    lib::meta::can_convertToString::value
+                 &&   !lib::meta::is_sameType::value
         };
       };
     
diff --git a/src/lib/meta/util.hpp b/src/lib/meta/util.hpp
index f305c46bb..91724943f 100644
--- a/src/lib/meta/util.hpp
+++ b/src/lib/meta/util.hpp
@@ -75,7 +75,7 @@ namespace meta {
    * @see string-util.hpp more elaborate solution including lexical_cast
    */
   template
-  struct _can_convertToString
+  struct can_convertToString
     {
       static T & probe();
       
diff --git a/tests/lib/format-string-test.cpp b/tests/lib/format-string-test.cpp
index e87fe8739..acc39eb7e 100644
--- a/tests/lib/format-string-test.cpp
+++ b/tests/lib/format-string-test.cpp
@@ -89,8 +89,9 @@ namespace test {
           _Fmt formatter (formatString);
           
           uint val = rand() % 100;
+          void *pt = &val;
           
-          formatter % &val;
+          formatter % &pt;
           formatter % val;
           
           cout << formatter << endl;
@@ -102,7 +103,7 @@ namespace test {
         {
           int i(-12);
           CHECK (_Fmt("%d") % i     == "-12"    );
-          CHECK (_Fmt("%6d") % i    == "-   12" );
+          CHECK (_Fmt("%6d") % i    == "   -12" );
           CHECK (_Fmt("%-6d") % i   == "-12   " );
           CHECK (_Fmt("%+-6d") % -i == "+12   " );
           CHECK (_Fmt("%+06d") % -i == "+00012" );
@@ -242,8 +243,8 @@ namespace test {
       verify_errorHandling ()
         {
           cout << _Fmt("__nix_") % 1 % 2 << endl;
-          cout << _Fmt("__%d__") << endl;
-          cout << _Fmt("__%d__") % 1 << endl;
+          cout << _Fmt("__%d__")         << endl;
+          cout << _Fmt("__%d__") % 1     << endl;
           cout << _Fmt("__%d__") % 1 % 2 << endl;
           
           cout << _Fmt("__%d__") % "dirt" << endl;
@@ -255,19 +256,19 @@ namespace test {
       void
       verify_pointerHandling ()
         {
-          int             i(-12);   int           *  pi = &  i;
-          uint             u(12);   uint          *  pu = &  u;
-          short         sh(-123);   short         * psh = & sh;
-          ushort        ush(123);   ushort        *push = &ush;
-          long           l(-123);   long          *  pl = &  l;
-          ulong          ul(123);   ulong         * pul = & ul;
-          int64_t       ll(5e+9);   int64_t       * pll = & ll;
-          uint64_t       ull(ll);   uint64_t      *pull = &ull;
-          float         f(12.34);   float         *  pf = &  f;
-          double       d(-12.34);   double        *  pd = &  d;
-          char           c(0x40);   char          *  pc = &  c;
-          unsigned char uc(0xff);   unsigned char * puc = & uc;
-          string  str("Lumiera");   string        *pstr = &str;
+          int             i(-12);     int       *   pi = &  i;
+          uint             u(12);     uint      *   pu = &  u;
+          short         sh(-123);     short     *  psh = & sh;
+          ushort        ush(123);     ushort    * push = &ush;
+          long           l(-123);     long      *   pl = &  l;
+          ulong          ul(123);     ulong     *  pul = & ul;
+          int64_t       ll(5e+9);     int64_t   *  pll = & ll;
+          uint64_t       ull(ll);     uint64_t  * pull = &ull;
+          float         f(12.34);     float     *   pf = &  f;
+          double       d(-12.34);     double    *   pd = &  d;
+          char           c(0x40);     char      *   pc = &  c;
+          uchar         uc(0xff);     uchar     *  puc = & uc;
+          string  str("Lumiera");     string    * pstr = &str;
           
           CHECK (_Fmt("%d") %   i == _Fmt("%d") %   pi);
           CHECK (_Fmt("%d") %   u == _Fmt("%d") %   pu);

From e838fb97990ae4b66af073699d745ccbecadb624 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 30 Dec 2011 06:10:47 +0100
Subject: [PATCH 42/87] document and cover various formatting special cases

---
 src/lib/format-string.cpp          | 25 +++++++++--
 tests/lib/format-string-test.cpp   | 71 +++++++++++++++++-------------
 tests/lib/meta/meta-utils-test.cpp |  2 +-
 3 files changed, 64 insertions(+), 34 deletions(-)

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
index d0804c77f..d11f63bc2 100644
--- a/src/lib/format-string.cpp
+++ b/src/lib/format-string.cpp
@@ -85,7 +85,16 @@ namespace util {
   }
   
   
-  /** */
+  /** @internal access points for the frontend,
+   * allowing to push a parameter value down into
+   * the implementation for the actual formatting.
+   * @note we need to generate instantiations of this template function
+   *       explicitly for all basic types to be supported for direct handling,
+   *       otherwise we'll get linker errors. Lumiera uses the ``inclusion model''
+   *       for template instantiation, which means there is no compiler magic
+   *       involved and a template function either needs to be \em defined in
+   *       a header or explicitly instantiated in some translation unit.
+   */
   template
   void
   _Fmt::pushParameter (VAL const& val)
@@ -141,17 +150,27 @@ namespace util {
   
   
   
-  /** */
+  /** @remarks usually the _Fmt helper is used inline
+   * at places where a string is expected. The '%' operator
+   * used to fed parameters has a higher precedence than the
+   * assignment or comparison operators, ensuring that all parameters
+   * are evaluated and formatted prior to receiving the formatted result
+   */
   _Fmt::operator string()  const
   {
     return accessImpl(formatter_).str();
   }
   
   
+  /** send the formatted buffer directly to the output stream.
+   * @note this is more efficient than creating a string and outputting that,
+   *       because boost::format internally uses a stringstream to generate
+   *       the formatted representation, relying on the C++ output framework
+   */
   std::ostream&
   operator<< (std::ostream& os, _Fmt const& fmt)
   {
-    return os << string(fmt);
+    return os << accessImpl(fmt.formatter_);
   }
   
   
diff --git a/tests/lib/format-string-test.cpp b/tests/lib/format-string-test.cpp
index acc39eb7e..530339ec5 100644
--- a/tests/lib/format-string-test.cpp
+++ b/tests/lib/format-string-test.cpp
@@ -73,12 +73,12 @@ namespace test {
       void
       check_simpleInvocation ()
         {
-          string formatted = _Fmt("--format-template--int=%04d--double=%+5.2f--string=%-10s--")
+          string formatted = _Fmt("--format-template--int=%04d--double=%+5.2f--string=%-9s--")
                                  % 12
                                  % 1.228
                                  % "Lumiera";
           cout << formatted << endl;
-          CHECK (formatted == "--format-template--int=0012--double=+1.23--string=Lumiera   --");
+          CHECK (formatted == "--format-template--int=0012--double=+1.23--string=Lumiera  --");
         }
       
       
@@ -91,7 +91,7 @@ namespace test {
           uint val = rand() % 100;
           void *pt = &val;
           
-          formatter % &pt;
+          formatter % pt;
           formatter % val;
           
           cout << formatter << endl;
@@ -107,66 +107,77 @@ namespace test {
           CHECK (_Fmt("%-6d") % i   == "-12   " );
           CHECK (_Fmt("%+-6d") % -i == "+12   " );
           CHECK (_Fmt("%+06d") % -i == "+00012" );
-          CHECK (_Fmt("%+06X") % -i == "+0000D" );
-          CHECK (_Fmt("%+#X") % -i  == "+Dh"    );
+          CHECK (_Fmt("%06X") % -i  == "00000C" );
+          CHECK (_Fmt("%#x") % -i   == "0xc"    );
           
           uint u(12);
           CHECK (_Fmt("%d") % u     == "12"     );
           CHECK (_Fmt("%6d") % u    == "    12" );
           CHECK (_Fmt("%-6d") % u   == "12    " );
-          CHECK (_Fmt("%+-6d") % u  == "+12   " );
-          CHECK (_Fmt("%+06d") % u  == "+00012" );
+          CHECK (_Fmt("%-+6d") % u  == "12    " );
+          CHECK (_Fmt("%+06d") % u  == "000012" );
           
           short sh(-123);
-          CHECK (_Fmt("%6d") % sh   == "-  123" );
+          CHECK (_Fmt("%6d") % sh   == "  -123" );
           
           ushort ush(123);
           CHECK (_Fmt("%6d") % ush  == "   123" );
           
           long l(-123);
-          CHECK (_Fmt("%6d") % l    == "-  123" );
+          CHECK (_Fmt("%6d") % l    == "  -123" );
           
           ulong ul(123);
           CHECK (_Fmt("%6d") % ul   == "   123" );
           
           int64_t ll(5e+9);
           CHECK (_Fmt("%d") % ll    == "5000000000" );
-          CHECK (_Fmt("%10.3d") %ll == "       500" );
-          CHECK (_Fmt("%10.3E") %ll == "   5.000E9" );
+          CHECK (_Fmt("%5.3d") %ll  == "5000000000" );
+          CHECK (_Fmt("%10.3e") %ll == "5000000000" );
           
           uint64_t ull(ll);
           CHECK (_Fmt("%d") % ull   == "5000000000" );
           
           float f(12.34);
-          CHECK (_Fmt("%g") % f     == "12.34"  );
-          CHECK (_Fmt("%d") % f     == "12"     );
-          CHECK (_Fmt("%e") % f     == "12.34e0");
+          CHECK (_Fmt("%g")   % f   == "12.34"  );
+          CHECK (_Fmt("%d")   % f   == "12.34"  );
+          CHECK (_Fmt("%.3f") % f   == "12.340" );
+          CHECK (_Fmt("%.1e") % f   == "1.2e+01");
+          CHECK (_Fmt("%.0f") % f   == "12"     );
           
           double d(-12.34);
           CHECK (_Fmt("%g") % d     == "-12.34" );
           
           char c(0x40);
-          CHECK (_Fmt("%d") % c     == "64"     );
-          CHECK (_Fmt("%x") % c     == "40"     );
-          CHECK (_Fmt("%o") % c     == "100"    );
-          CHECK (_Fmt("%c") % c     == "@"      );
-          CHECK (_Fmt("%s") % c     == "@"      );
+          CHECK (_Fmt("%d") % c        == "@"   );
+          CHECK (_Fmt("%x") % c        == "@"   );
+          CHECK (_Fmt("%o") % c        == "@"   );
+          CHECK (_Fmt("%c") % c        == "@"   );
+          CHECK (_Fmt("%s") % c        == "@"   );
+          CHECK (_Fmt("%d") % short(c) == "64"  );
+          CHECK (_Fmt("%x") % short(c) == "40"  );
+          CHECK (_Fmt("%o") % short(c) == "100" );
+          CHECK (_Fmt("%c") % short(c) == "6"   );
+          CHECK (_Fmt("%s") % short(c) == "64"  );
           
-          unsigned char uc(0xff);
-          CHECK (_Fmt("%d") % uc    == "255"    );
-          CHECK (_Fmt("%x") % uc    == "ff"     );
-          CHECK (_Fmt("%X") % uc    == "FF"     );
-          CHECK (_Fmt("%c") % uc    == "\xFF"   );
-          CHECK (_Fmt("%s") % uc    == "\xFF"   );
+          uchar uc(0xff);
+          CHECK (_Fmt("%d") % uint(uc) == "255" );
+          CHECK (_Fmt("%x") % uint(uc) == "ff"  );
+          CHECK (_Fmt("%X") % uint(uc) == "FF"  );
+          CHECK (_Fmt("%c") % uint(uc) == "2"   );
+          CHECK (_Fmt("%s") % uint(uc) == "255" );
+          CHECK (_Fmt("%d") % uc       == "\xFF");
+          CHECK (_Fmt("%x") % uc       == "\xFF");
+          CHECK (_Fmt("%X") % uc       == "\xFF");
+          CHECK (_Fmt("%c") % uc       == "\xFF");
+          CHECK (_Fmt("%s") % uc       == "\xFF");
           
           c = char(uc);
-          CHECK (_Fmt("%d") % uc    == "-1"     );
-          CHECK (_Fmt("%c") % uc    == "\xFF"   );
+          CHECK (_Fmt("%c") % c        == "\xFF");
           
           string str("Lumiera");
           CHECK (_Fmt("%s") % str   == "Lumiera"    );
           CHECK (_Fmt("%10s") % str == "   Lumiera" );
-          CHECK (_Fmt("%8.4s") %str == "   Lumi"    );
+          CHECK (_Fmt("%7.4s") %str == "   Lumi"    );
           CHECK (_Fmt("%10c") % str == "         L" );
         }
       
@@ -226,12 +237,12 @@ namespace test {
           CHECK (contains (mangledType, "Silent"));
           
           CHECK (_Fmt("!!%s!!") % v  == "!!Number-013!!");
-          CHECK (_Fmt("!!%s!!") % x  == "!!unforeseen internal state (encountered Fantomas).!!");
+          CHECK (_Fmt("!!%s!!") % x  == "!!LUMIERA_ERROR_STATE:unforeseen state (encountered Fantomas).!!");
           
           CHECK (contains (_Fmt("%s") % rs1, "Silent"));
           CHECK (contains (_Fmt("%s") % rs2, "Silent"));
           
-          CHECK (_Fmt("!!%s!!") % rv  == "!!unforeseen internal state (encountered Fantomas).!!");
+          CHECK (_Fmt("!!%s!!") % rv  == "!!LUMIERA_ERROR_STATE:unforeseen state (encountered Fantomas).!!");
           
           x.i_ = 42;
           CHECK (_Fmt("!!%s!!") % rv  == "!!Number-042!!");
diff --git a/tests/lib/meta/meta-utils-test.cpp b/tests/lib/meta/meta-utils-test.cpp
index 3b2d84bb3..50aa87a4c 100644
--- a/tests/lib/meta/meta-utils-test.cpp
+++ b/tests/lib/meta/meta-utils-test.cpp
@@ -104,7 +104,7 @@ namespace test {
       static bool
       can_convert (TY const&)
         {
-          return _can_convertToString::value;
+          return can_convertToString::value;
         }
       
       void

From 35ed2dcf5cb26f24dd7dba1ebdd811895d3322c6 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 30 Dec 2011 20:20:11 +0100
Subject: [PATCH 43/87] add more robust error handling

...incl handling of secondary errors
---
 src/lib/format-string.cpp        | 102 ++++++++++++++++++++++++++-----
 src/lib/format-string.hpp        |  17 +++---
 tests/lib/format-string-test.cpp |   8 ++-
 3 files changed, 101 insertions(+), 26 deletions(-)

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
index d11f63bc2..927200f30 100644
--- a/src/lib/format-string.cpp
+++ b/src/lib/format-string.cpp
@@ -46,6 +46,7 @@
 
 
 #include "lib/error.hpp"
+#include "lib/format-util.hpp"
 #include "lib/format-string.hpp"
 
 #include 
@@ -68,15 +69,45 @@ namespace util {
       return reinterpret_cast (*buffer);
     }
     
+    /** in case the formatting of a (primitive) value fails,
+     *  we try to use a error indicator instead
+     */
+    inline void
+    pushFailsafeReplacement (char* formatter, const char* errorMsg =NULL)
+    try {
+        string placeholder("
   void
   _Fmt::pushParameter (VAL const& val)
-  {
-    accessImpl(formatter_) % val;
-  }
+  try {
+      accessImpl(formatter_) % val;
+    }
+  
+  catch (boost::io::too_many_args& argErr)
+    {
+      WARN (progress, "Format: excess argument '%s' of type %s ignored."
+                    , cStr(str(val))
+                    , cStr(tyStr(val)));
+    }
+  catch (std::exception& failure)
+    {
+      WARN (progress, "Format: Parameter '%s' causes problems: %s"
+                    , cStr(str(val))
+                    , failure.what());
+      pushFailsafeReplacement (formatter_, failure.what());
+    }
+  catch (...)
+    {
+      WARN (progress, "Format: Unexpected problems accepting format parameter '%s'", cStr(str(val)));
+      pushFailsafeReplacement (formatter_);
+    }
+  
   
   template
   void
   _Fmt::pushParameter (const VAL * const pVal)
   {
     if (pVal)
-      pushParameter(*pVal);
+      pushParameter (*pVal);
     else
-      pushParameter(string("(null)"));
+      pushParameter (string(""));
   }
   
   template<>
@@ -157,21 +208,44 @@ namespace util {
    * are evaluated and formatted prior to receiving the formatted result
    */
   _Fmt::operator string()  const
-  {
-    return accessImpl(formatter_).str();
-  }
+  try {
+      return accessImpl(formatter_).str();
+    }
+  
+  catch (std::exception& failure)
+    {
+      WARN (progress, "Format: Failure to receive formatted result: %s", failure.what());
+      return "";
+    }
+  catch (...)
+    {
+      WARN (progress, "Format: Unexpected problems while formatting output.");
+      return "";
+    }
+  
   
   
   /** send the formatted buffer directly to the output stream.
    * @note this is more efficient than creating a string and outputting that,
-   *       because boost::format internally uses a stringstream to generate
+   *       because boost::format internally uses a string-stream to generate
    *       the formatted representation, relying on the C++ output framework
    */
   std::ostream&
   operator<< (std::ostream& os, _Fmt const& fmt)
-  {
-    return os << accessImpl(fmt.formatter_);
-  }
+  try {
+      return os << accessImpl(fmt.formatter_);
+    }
+  
+  catch(std::exception& failure)
+    {
+      WARN (progress, "Format: Failure when outputting formatted result: %s", failure.what());
+      return os << "";
+    }
+  catch(...)
+    {
+      WARN (progress, "Format: Unexpected problems while producing formatted output.");
+      return os << "";
+    }
   
   
   
diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index d7eb1fde2..af58a9bda 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -201,7 +201,11 @@ namespace util {
     _log_and_stringify (std::exception const& ex)
     {
       WARN (progress, "Error while invoking custom string conversion: %s", ex.what());
-      return ex.what();
+      try {
+          return string("";
+        }
+      catch(...) { /* secondary errors ignored */ }
+      return "(formatting failure)";
     }
     
     inline string
@@ -209,15 +213,10 @@ namespace util {
     {
       const char* errID = lumiera_error();
       if (errID)
-        {
-          ERROR (progress, "Unknown error while invoking custom string conversion. Lumiera error flag = %s", errID);
-          return string("Unknown error in string conversion. FLAG=")+errID;
-        }
+        ERROR (progress, "Unknown error while invoking custom string conversion. Lumiera error flag = %s", errID);
       else
-        {
-          ERROR (progress, "Unknown error while invoking custom string conversion. No Lumiera error flag set.");
-          return "Unknown error in string conversion";
-        }
+        ERROR (progress, "Unknown error while invoking custom string conversion. No Lumiera error flag set.");
+      return "";
     }
     
   }//(End) guards/helpers
diff --git a/tests/lib/format-string-test.cpp b/tests/lib/format-string-test.cpp
index 530339ec5..46cae95c1 100644
--- a/tests/lib/format-string-test.cpp
+++ b/tests/lib/format-string-test.cpp
@@ -237,12 +237,12 @@ namespace test {
           CHECK (contains (mangledType, "Silent"));
           
           CHECK (_Fmt("!!%s!!") % v  == "!!Number-013!!");
-          CHECK (_Fmt("!!%s!!") % x  == "!!LUMIERA_ERROR_STATE:unforeseen state (encountered Fantomas).!!");
+          CHECK (_Fmt("!!%s!!") % x  == "!!!!");
           
           CHECK (contains (_Fmt("%s") % rs1, "Silent"));
           CHECK (contains (_Fmt("%s") % rs2, "Silent"));
           
-          CHECK (_Fmt("!!%s!!") % rv  == "!!LUMIERA_ERROR_STATE:unforeseen state (encountered Fantomas).!!");
+          CHECK (_Fmt("!!%s!!") % rv  == "!!!!");
           
           x.i_ = 42;
           CHECK (_Fmt("!!%s!!") % rv  == "!!Number-042!!");
@@ -258,6 +258,8 @@ namespace test {
           cout << _Fmt("__%d__") % 1     << endl;
           cout << _Fmt("__%d__") % 1 % 2 << endl;
           
+          const char* evil = NULL;
+          cout << _Fmt("__%d__") %  evil  << endl;
           cout << _Fmt("__%d__") % "dirt" << endl;
           cout << _Fmt("__%d__") % "1234" << endl;
           cout << _Fmt("__%d__") % "0xff" << endl;
@@ -307,7 +309,7 @@ namespace test {
           
           pv = NULL;
           vv = NULL;
-          CHECK (_Fmt("__%s__") % pv == "__(null)__");
+          CHECK (_Fmt("__%s__") % pv == "____");
           CHECK (_Fmt("__%s__") % pv == "__0__");
         }
     };

From c8f46f47c9ac544cc05ae062e5e47fd42081e12d Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 31 Dec 2011 01:30:07 +0100
Subject: [PATCH 44/87] handling of ptrs, first attempt

---
 src/lib/format-string.cpp        | 118 +++++++++++++++++--------------
 src/lib/format-string.hpp        |  75 ++++++++++++--------
 src/lib/meta/util.hpp            |  30 ++++++++
 tests/lib/format-string-test.cpp |   7 +-
 4 files changed, 145 insertions(+), 85 deletions(-)

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
index 927200f30..562fe10d1 100644
--- a/src/lib/format-string.cpp
+++ b/src/lib/format-string.cpp
@@ -69,10 +69,11 @@ namespace util {
       return reinterpret_cast (*buffer);
     }
     
+    
     /** in case the formatting of a (primitive) value fails,
      *  we try to use a error indicator instead
      */
-    inline void
+    void
     pushFailsafeReplacement (char* formatter, const char* errorMsg =NULL)
     try {
         string placeholder("
+    void
+    doFormatParameter (char* formatter, VAL const& val)
+    try {
+        accessImpl(formatter) % val;
+      }
+    
+    catch (boost::io::too_many_args& argErr)
+      {
+        WARN (progress, "Format: excess argument '%s' of type %s ignored."
+                      , cStr(str(val))
+                      , cStr(tyStr(val)));
+      }
+    catch (std::exception& failure)
+      {
+        WARN (progress, "Format: Parameter '%s' causes problems: %s"
+                      , cStr(str(val))
+                      , failure.what());
+        pushFailsafeReplacement (formatter, failure.what());
+      }
+    catch (...)
+      {
+        WARN (progress, "Format: Unexpected problems accepting format parameter '%s'", cStr(str(val)));
+        pushFailsafeReplacement (formatter);
+      }
+    
+    
     inline void
     suppressInsufficientArgumentErrors (char* formatter)
     {
@@ -128,75 +157,60 @@ namespace util {
    */
   template
   void
-  _Fmt::pushParameter (VAL const& val)
-  try {
-      accessImpl(formatter_) % val;
-    }
-  
-  catch (boost::io::too_many_args& argErr)
-    {
-      WARN (progress, "Format: excess argument '%s' of type %s ignored."
-                    , cStr(str(val))
-                    , cStr(tyStr(val)));
-    }
-  catch (std::exception& failure)
-    {
-      WARN (progress, "Format: Parameter '%s' causes problems: %s"
-                    , cStr(str(val))
-                    , failure.what());
-      pushFailsafeReplacement (formatter_, failure.what());
-    }
-  catch (...)
-    {
-      WARN (progress, "Format: Unexpected problems accepting format parameter '%s'", cStr(str(val)));
-      pushFailsafeReplacement (formatter_);
-    }
-  
+  _Fmt::pushParameter (const VAL val)
+  {
+    doFormatParameter (formatter_, val);
+  }
   
   template
   void
-  _Fmt::pushParameter (const VAL * const pVal)
+  _Fmt::pushParameter (const VAL * pVal)
   {
     if (pVal)
-      pushParameter (*pVal);
+      doFormatParameter (formatter_, *pVal);
     else
-      pushParameter (string(""));
+      doFormatParameter (formatter_, "");
   }
   
   template<>
   void
-  _Fmt::pushParameter (const char * const cString)
+  _Fmt::pushParameter (const char * cString)
   {
-    pushParameter (cString);
+    doFormatParameter (formatter_, cString? cString : "↯" );
+  }
+  template<>
+  void
+  _Fmt::pushParameter (const void * address)
+  {
+    doFormatParameter (formatter_, address);
   }
   
   
   
   /* ===== explicitly supported =================== */
   
-  template void _Fmt::pushParameter(string const&);
-  template void _Fmt::pushParameter(char const&);
-  template void _Fmt::pushParameter(uchar const&);
-  template void _Fmt::pushParameter(int const&);
-  template void _Fmt::pushParameter(uint const&);
-  template void _Fmt::pushParameter(short const&);
-  template void _Fmt::pushParameter(ushort const&);
-  template void _Fmt::pushParameter(int64_t const&);
-  template void _Fmt::pushParameter(uint64_t const&);
-  template void _Fmt::pushParameter(float const&);
-  template void _Fmt::pushParameter(double const&);
-  template void _Fmt::pushParameter(void * const&);
+  template void _Fmt::pushParameter(const string);
+  template void _Fmt::pushParameter(const char);
+  template void _Fmt::pushParameter(const uchar);
+  template void _Fmt::pushParameter(const int);
+  template void _Fmt::pushParameter(const uint);
+  template void _Fmt::pushParameter(const short);
+  template void _Fmt::pushParameter(const ushort);
+  template void _Fmt::pushParameter(const int64_t);
+  template void _Fmt::pushParameter(const uint64_t);
+  template void _Fmt::pushParameter(const float);
+  template void _Fmt::pushParameter(const double);
   
-  template void _Fmt::pushParameter(const string * const);
-  template void _Fmt::pushParameter(const uchar * const);
-  template void _Fmt::pushParameter(const int * const);
-  template void _Fmt::pushParameter(const uint * const);
-  template void _Fmt::pushParameter(const short * const);
-  template void _Fmt::pushParameter(const ushort * const);
-  template void _Fmt::pushParameter(const int64_t * const);
-  template void _Fmt::pushParameter(const uint64_t * const);
-  template void _Fmt::pushParameter(const float * const);
-  template void _Fmt::pushParameter(const double * const);
+  template void _Fmt::pushParameter(const string * );
+  template void _Fmt::pushParameter(const uchar *  );
+  template void _Fmt::pushParameter(const int *    );
+  template void _Fmt::pushParameter(const uint *   );
+  template void _Fmt::pushParameter(const short *  );
+  template void _Fmt::pushParameter(const ushort * );
+  template void _Fmt::pushParameter(const int64_t *);
+  template void _Fmt::pushParameter(const uint64_t*);
+  template void _Fmt::pushParameter(const float *  );
+  template void _Fmt::pushParameter(const double * );
   
   
   
diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index af58a9bda..2e7f63060 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -99,10 +99,13 @@ namespace util {
       struct Converter;
       
       template
-      void pushParameter (VAL const&);
+      void pushParameter (const VAL);
       
       template
-      void pushParameter (const VAL * const);
+      void pushParameter (const VAL *);
+      
+      template
+      void pushParameter (VAL *);
       
       
     public:
@@ -169,31 +172,44 @@ namespace util {
      * As fallback we rather just produce a type-ID
      */
     template
-    struct _shall_forward                     { enum{ value = false };};
+    struct _allow_call                     { enum{ value = false };};
+    
+    /* the following definitions enable some primitive types
+     * to be handed over to the boost::format implementation */
+    template<> struct _allow_call  { enum{ value = true }; };
+    template<> struct _allow_call    { enum{ value = true }; };
+    template<> struct _allow_call   { enum{ value = true }; };
+    template<> struct _allow_call     { enum{ value = true }; };
+    template<> struct _allow_call    { enum{ value = true }; };
+    template<> struct _allow_call   { enum{ value = true }; };
+    template<> struct _allow_call  { enum{ value = true }; };
+    template<> struct _allow_call { enum{ value = true }; };
+    template<> struct _allow_call{ enum{ value = true }; };
+    template<> struct _allow_call   { enum{ value = true }; };
+    template<> struct _allow_call  { enum{ value = true }; };
+    template<> struct _allow_call   { enum{ value = true }; };
+    
+    template
+    struct _shall_format_directly
+      {
+        typedef typename lib::meta::UnConst::Type BaseType;
+        
+        enum{ value = _allow_call::value };
+      };
+    
+    template
+    struct _shall_format_directly 
+      : _shall_format_directly
+      { };
     
-    /* the following definitions enable some basic types
-     * to be forwarded to boost::format literally */
-    template<> struct _shall_forward  { enum{ value = true }; };
-    template<> struct _shall_forward    { enum{ value = true }; };
-    template<> struct _shall_forward   { enum{ value = true }; };
-    template<> struct _shall_forward     { enum{ value = true }; };
-    template<> struct _shall_forward    { enum{ value = true }; };
-    template<> struct _shall_forward   { enum{ value = true }; };
-    template<> struct _shall_forward  { enum{ value = true }; };
-    template<> struct _shall_forward { enum{ value = true }; };
-    template<> struct _shall_forward{ enum{ value = true }; };
-    template<> struct _shall_forward   { enum{ value = true }; };
-    template<> struct _shall_forward  { enum{ value = true }; };
-    template<> struct _shall_forward   { enum{ value = true }; };
     
     
     template
     struct _shall_convert_toString
       {
-        enum{ value = ! _shall_forward::value
-                 &&    lib::meta::can_convertToString::value
-                 &&   !lib::meta::is_sameType::value
-        };
+        enum{ value = ! _shall_format_directly::value
+                   && lib::meta::can_convertToString::value
+            };
       };
     
     
@@ -230,7 +246,7 @@ namespace util {
   template
   struct _Fmt::Converter
     {
-      static string
+      static const string
       prepare (VAL const&)
         {
           return string("«")+typeid(VAL).name()+"»";
@@ -241,7 +257,7 @@ namespace util {
   template
   struct _Fmt::Converter >::type>
     {
-      static string
+      static const string
       prepare (VAL const& val)
         try {
             return string(val); 
@@ -259,7 +275,7 @@ namespace util {
   /** some basic types are directly forwarded down to the implementation;
    * @note this requires explicit specialisations in format-string.cpp */
   template
-  struct _Fmt::Converter >::type>
+  struct _Fmt::Converter >::type>
     {
       static VAL const&
       prepare (VAL const& val)
@@ -269,14 +285,11 @@ namespace util {
     };
   
   template
-  struct _Fmt::Converter >::type>
+  void
+  _Fmt::pushParameter (VAL * pV)   ///< treat as const
     {
-      static const VAL *
-      prepare (const VAL * const pVal)
-        {
-          return pVal;
-        }
-    };
+      pushParameter ((const VAL*) pV);
+    }
   
   
   
diff --git a/src/lib/meta/util.hpp b/src/lib/meta/util.hpp
index 91724943f..67dacc400 100644
--- a/src/lib/meta/util.hpp
+++ b/src/lib/meta/util.hpp
@@ -87,6 +87,36 @@ namespace meta {
     };
   
   
+  /** strip const from type: naive implementation */
+  template
+  struct UnConst
+    {
+      typedef T Type;
+    };
+  
+  template
+  struct UnConst
+    {
+      typedef T Type;
+    };
+  template
+  struct UnConst
+    {
+      typedef T* Type;
+    };
+  template
+  struct UnConst
+    {
+      typedef T* Type;
+    };
+  template
+  struct UnConst
+    {
+      typedef T* Type;
+    };
+  
+  
+  
   /** semi-automatic detection if an instantiation is possible.
    *  Requires help by the template to be tested, which needs to define
    *  a typedef member \c is_defined. The embedded metafunction Test can be used
diff --git a/tests/lib/format-string-test.cpp b/tests/lib/format-string-test.cpp
index 46cae95c1..6ba3b4c32 100644
--- a/tests/lib/format-string-test.cpp
+++ b/tests/lib/format-string-test.cpp
@@ -279,7 +279,6 @@ namespace test {
           uint64_t       ull(ll);     uint64_t  * pull = &ull;
           float         f(12.34);     float     *   pf = &  f;
           double       d(-12.34);     double    *   pd = &  d;
-          char           c(0x40);     char      *   pc = &  c;
           uchar         uc(0xff);     uchar     *  puc = & uc;
           string  str("Lumiera");     string    * pstr = &str;
           
@@ -293,14 +292,18 @@ namespace test {
           CHECK (_Fmt("%d") % ull == _Fmt("%d") % pull);
           CHECK (_Fmt("%e") %   f == _Fmt("%e") %   pf);
           CHECK (_Fmt("%e") %   d == _Fmt("%e") %   pd);
-          CHECK (_Fmt("%g") %   c == _Fmt("%g") %   pc);
           CHECK (_Fmt("%g") %  uc == _Fmt("%g") %  puc);
           CHECK (_Fmt("%s") % str == _Fmt("%s") % pstr);
           
+          char c('a');
+          char pc[2] = {'a', '\0'};
+          CHECK (_Fmt("%g") %   c == _Fmt("%g") %   pc);
+          
           Verbose v(42);
           Verbose *pv = &v;
           void    *vv = pv;
           CHECK (_Fmt("__%s__") % v  == "__Number-042__");
+          cout << "yyy=" << string(_Fmt("__%s__") % pv) << endl;
           CHECK (_Fmt("__%s__") % pv == "__Number-042__");
           CHECK (_Fmt("__%s__") % vv != "__Number-042__");
           

From e1b9b5b1354cd013768f1087b5c74b4ac0e9820e Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 31 Dec 2011 03:52:10 +0100
Subject: [PATCH 45/87] rewrite type selection logic to handle ptrs in the
 front-end

whew, quite a heavy rewrite, but greatly
simplifies the code and removes the necessity
to declare explicit specialisations of pointers
---
 src/lib/format-string.cpp        | 128 ++++++++++++-------------------
 src/lib/format-string.hpp        |  84 ++++++++++++--------
 tests/lib/format-string-test.cpp |  11 ++-
 3 files changed, 104 insertions(+), 119 deletions(-)

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
index 562fe10d1..c0c6926f2 100644
--- a/src/lib/format-string.cpp
+++ b/src/lib/format-string.cpp
@@ -70,6 +70,13 @@ namespace util {
     }
     
     
+    inline void
+    destroyImpl (char* buffer)
+    {
+      accessImpl(buffer).~format(); 
+    }
+    
+    
     /** in case the formatting of a (primitive) value fails,
      *  we try to use a error indicator instead
      */
@@ -88,34 +95,6 @@ namespace util {
     ERROR_LOG_AND_IGNORE (progress, "Supplying placeholder for problematic format parameter")
     
     
-    /** Core function: let boost::format handle a value */
-    template
-    void
-    doFormatParameter (char* formatter, VAL const& val)
-    try {
-        accessImpl(formatter) % val;
-      }
-    
-    catch (boost::io::too_many_args& argErr)
-      {
-        WARN (progress, "Format: excess argument '%s' of type %s ignored."
-                      , cStr(str(val))
-                      , cStr(tyStr(val)));
-      }
-    catch (std::exception& failure)
-      {
-        WARN (progress, "Format: Parameter '%s' causes problems: %s"
-                      , cStr(str(val))
-                      , failure.what());
-        pushFailsafeReplacement (formatter, failure.what());
-      }
-    catch (...)
-      {
-        WARN (progress, "Format: Unexpected problems accepting format parameter '%s'", cStr(str(val)));
-        pushFailsafeReplacement (formatter);
-      }
-    
-    
     inline void
     suppressInsufficientArgumentErrors (char* formatter)
     {
@@ -141,13 +120,16 @@ namespace util {
   
   _Fmt::~_Fmt ()
   {
-    accessImpl(formatter_).~format();
+    destroyImpl (formatter_);
   }
   
   
-  /** @internal access points for the frontend,
-   * allowing to push a parameter value down into the implementation
-   * for the actual formatting.
+  /** @internal access point for the frontend,
+   * allowing to push a single parameter value down
+   * into the implementation for the actual formatting.
+   * Only selected primitive types are handled directly this way,
+   * while all custom conversions, the handling of pointers and the
+   * fallback (showing a type string) is done in the frontend.
    * @note we need to generate instantiations of this template function
    *       explicitly for all basic types to be supported for direct handling,
    *       otherwise we'll get linker errors. Lumiera uses the ``inclusion model''
@@ -157,60 +139,48 @@ namespace util {
    */
   template
   void
-  _Fmt::pushParameter (const VAL val)
-  {
-    doFormatParameter (formatter_, val);
-  }
+  _Fmt::format (const VAL val, Implementation& formatter)
+  try {
+      accessImpl(formatter) % val;
+    }
   
-  template
-  void
-  _Fmt::pushParameter (const VAL * pVal)
-  {
-    if (pVal)
-      doFormatParameter (formatter_, *pVal);
-    else
-      doFormatParameter (formatter_, "");
-  }
+  catch (boost::io::too_many_args& argErr)
+    {
+      WARN (progress, "Format: excess argument '%s' of type %s ignored."
+                    , cStr(str(val))
+                    , cStr(tyStr(val)));
+    }
+  catch (std::exception& failure)
+    {
+      WARN (progress, "Format: Parameter '%s' causes problems: %s"
+                    , cStr(str(val))
+                    , failure.what());
+      pushFailsafeReplacement (formatter, failure.what());
+    }
+  catch (...)
+    {
+      WARN (progress, "Format: Unexpected problems accepting format parameter '%s'", cStr(str(val)));
+      pushFailsafeReplacement (formatter);
+    }
   
-  template<>
-  void
-  _Fmt::pushParameter (const char * cString)
-  {
-    doFormatParameter (formatter_, cString? cString : "↯" );
-  }
-  template<>
-  void
-  _Fmt::pushParameter (const void * address)
-  {
-    doFormatParameter (formatter_, address);
-  }
   
   
   
   /* ===== explicitly supported =================== */
   
-  template void _Fmt::pushParameter(const string);
-  template void _Fmt::pushParameter(const char);
-  template void _Fmt::pushParameter(const uchar);
-  template void _Fmt::pushParameter(const int);
-  template void _Fmt::pushParameter(const uint);
-  template void _Fmt::pushParameter(const short);
-  template void _Fmt::pushParameter(const ushort);
-  template void _Fmt::pushParameter(const int64_t);
-  template void _Fmt::pushParameter(const uint64_t);
-  template void _Fmt::pushParameter(const float);
-  template void _Fmt::pushParameter(const double);
-  
-  template void _Fmt::pushParameter(const string * );
-  template void _Fmt::pushParameter(const uchar *  );
-  template void _Fmt::pushParameter(const int *    );
-  template void _Fmt::pushParameter(const uint *   );
-  template void _Fmt::pushParameter(const short *  );
-  template void _Fmt::pushParameter(const ushort * );
-  template void _Fmt::pushParameter(const int64_t *);
-  template void _Fmt::pushParameter(const uint64_t*);
-  template void _Fmt::pushParameter(const float *  );
-  template void _Fmt::pushParameter(const double * );
+  template void _Fmt::format (const char,    Implementation&);
+  template void _Fmt::format (const uchar,   Implementation&);
+  template void _Fmt::format (const int,     Implementation&);
+  template void _Fmt::format (const uint,    Implementation&);
+  template void _Fmt::format (const short,   Implementation&);
+  template void _Fmt::format (const ushort,  Implementation&);
+  template void _Fmt::format (const int64_t, Implementation&);
+  template void _Fmt::format (const uint64_t,Implementation&);
+  template void _Fmt::format (const float,   Implementation&);
+  template void _Fmt::format (const double,  Implementation&);
+  template void _Fmt::format (const string,  Implementation&);
+  template void _Fmt::format (const void *,  Implementation&);
+  template void _Fmt::format (const char *,  Implementation&);
   
   
   
diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index 2e7f63060..0c49bbe0a 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -89,23 +89,19 @@ namespace util {
       /** size of an internal implementation Buffer */
       enum{ FORMATTER_SIZE = lib::meta::SizeTrait::BOOST_FORMAT };
       
+      typedef char Implementation[FORMATTER_SIZE];
       
       /** @internal buffer to hold a boost::format */
-      mutable char formatter_[FORMATTER_SIZE];
+      mutable Implementation formatter_;
       
       
+      template
+      static void format (const VAL, Implementation&);
+      
       /** helper to prepare parameters for inclusion */
       template
       struct Converter;
       
-      template
-      void pushParameter (const VAL);
-      
-      template
-      void pushParameter (const VAL *);
-      
-      template
-      void pushParameter (VAL *);
       
       
     public:
@@ -158,7 +154,7 @@ namespace util {
   inline _Fmt&
   _Fmt::operator% (VAL const& val)
   {
-    pushParameter (Converter::prepare (val));
+    Converter::dump (val, formatter_);
     return *this;
   }
   
@@ -187,7 +183,6 @@ namespace util {
     template<> struct _allow_call{ enum{ value = true }; };
     template<> struct _allow_call   { enum{ value = true }; };
     template<> struct _allow_call  { enum{ value = true }; };
-    template<> struct _allow_call   { enum{ value = true }; };
     
     template
     struct _shall_format_directly
@@ -197,11 +192,6 @@ namespace util {
         enum{ value = _allow_call::value };
       };
     
-    template
-    struct _shall_format_directly 
-      : _shall_format_directly
-      { };
-    
     
     
     template
@@ -246,10 +236,43 @@ namespace util {
   template
   struct _Fmt::Converter
     {
-      static const string
-      prepare (VAL const&)
+      static void
+      dump (VAL const&, Implementation& impl)
         {
-          return string("«")+typeid(VAL).name()+"»";
+          format (string("«")+typeid(VAL).name()+"»", impl);
+        }
+    };
+  
+  template
+  struct _Fmt::Converter
+    {
+      static void
+      dump (const VAL *pVal, Implementation& impl)
+        {
+          if (pVal)
+            Converter::dump(*pVal, impl);
+          else
+            format ("", impl);
+        }
+    };
+  
+  template<>
+  struct _Fmt::Converter
+    {
+      static void
+      dump (const void* address, Implementation& impl)
+        {
+          format (address, impl);
+        }
+    };
+  
+  template<>
+  struct _Fmt::Converter
+    {
+      static void
+      dump (const char* cString, Implementation& impl)
+        {
+          format (cString? cString : "↯", impl);
         }
     };
   
@@ -257,18 +280,18 @@ namespace util {
   template
   struct _Fmt::Converter >::type>
     {
-      static const string
-      prepare (VAL const& val)
+      static void
+      dump (VAL const& val, Implementation& impl)
         try {
-            return string(val); 
+            format (string(val), impl); 
           }
         catch(std::exception const& ex)
           {
-            return _log_and_stringify(ex);
+            format (_log_and_stringify(ex), impl);
           }
         catch(...)
           {
-            return _log_unknown_exception();
+            format (_log_unknown_exception(), impl);
           }
     };
   
@@ -277,20 +300,13 @@ namespace util {
   template
   struct _Fmt::Converter >::type>
     {
-      static VAL const&
-      prepare (VAL const& val)
+      static void
+      dump (const VAL val, Implementation& impl)
         {
-          return val;
+          format (val, impl);
         }
     };
   
-  template
-  void
-  _Fmt::pushParameter (VAL * pV)   ///< treat as const
-    {
-      pushParameter ((const VAL*) pV);
-    }
-  
   
   
   /* === comparison of formatter objects === */
diff --git a/tests/lib/format-string-test.cpp b/tests/lib/format-string-test.cpp
index 6ba3b4c32..48c5b5df3 100644
--- a/tests/lib/format-string-test.cpp
+++ b/tests/lib/format-string-test.cpp
@@ -46,11 +46,11 @@ namespace test {
    * @test verifies our front-end for printf-style format string based formatting.
    *       - the implementation is based on boost::format
    *       - we create a wrapper-object on-the fly, which is able to hold
-   *         the result of a partial invocation
-   *       - explicit specialisations feed all primitive types directly
-   *         down into the implementation level. If possible, a custom operator string()
+   *         the result of a partial invocation, until all parameters are given.
+   *       - explicit specialisations feed all primitive types directly down
+   *         into the implementation level. If possible, a custom operator string()
    *         will be used for formatting.
-   *       - any kind of exception will be logged, but handled gracefully
+   *       - exceptions will be logged, but handled gracefully
    * 
    * @see format-string.hpp
    * @see boost::format
@@ -303,7 +303,6 @@ namespace test {
           Verbose *pv = &v;
           void    *vv = pv;
           CHECK (_Fmt("__%s__") % v  == "__Number-042__");
-          cout << "yyy=" << string(_Fmt("__%s__") % pv) << endl;
           CHECK (_Fmt("__%s__") % pv == "__Number-042__");
           CHECK (_Fmt("__%s__") % vv != "__Number-042__");
           
@@ -313,7 +312,7 @@ namespace test {
           pv = NULL;
           vv = NULL;
           CHECK (_Fmt("__%s__") % pv == "____");
-          CHECK (_Fmt("__%s__") % pv == "__0__");
+          CHECK (_Fmt("__%s__") % vv == "__0__");
         }
     };
   

From 37384f1b681f5bbfa7dc4d50b8588ed801fbddb3 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 31 Dec 2011 06:38:31 +0100
Subject: [PATCH 46/87] formatting wrapper/frontend: unit test pass.

Closes #166
---
 src/lib/format-string.cpp                |  47 +++++++---
 src/lib/format-string.hpp                | 106 +++++++++++++++++++----
 tests/40components.tests                 |  15 +++-
 tests/lib/format-string-test.cpp         |   3 +
 tests/lib/time/quantiser-basics-test.cpp |   2 +-
 5 files changed, 142 insertions(+), 31 deletions(-)

diff --git a/src/lib/format-string.cpp b/src/lib/format-string.cpp
index c0c6926f2..85c3abc19 100644
--- a/src/lib/format-string.cpp
+++ b/src/lib/format-string.cpp
@@ -24,11 +24,13 @@
  ** Implementation for printf-style formatting, based on boost::format.
  ** This file holds the generic implementation of our format frontend,
  ** which actually just invokes boost::format. The corresponding header
- ** format-string.hpp contains some template functions and classes,
- ** which select an appropriate wrapper to pass the calls down.
+ ** format-string.hpp provides some template functions and classes,
+ ** either invoking a custom string conversion, or passing primitive
+ ** values down unaltered.
+ ** 
  ** Here, we define explicit specialisations for the frontend to invoke,
  ** which in turn just pass on the given argument value to the embedded
- ** boost::format object, which in turn integrates the formatted result
+ ** boost::format object, which in turn dumps the formatted result
  ** into an embedded string stream.
  ** 
  ** To avoid exposing boost::format in the frontend header, we use an
@@ -61,6 +63,7 @@ namespace util {
   
   using boost::format;
   
+  
   namespace { // implementation details...
     
     inline boost::format&
@@ -78,8 +81,7 @@ namespace util {
     
     
     /** in case the formatting of a (primitive) value fails,
-     *  we try to use a error indicator instead
-     */
+     *  we try to supply an error indicator instead */
     void
     pushFailsafeReplacement (char* formatter, const char* errorMsg =NULL)
     try {
@@ -109,14 +111,26 @@ namespace util {
   
   
   
-  /** */
+  /** Build a formatter object based on the given format string.
+   *  The actual implementation is delegated to an boost::format object,
+   *  which is placement-constructed into an opaque buffer embedded into
+   *  this object. Defining the necessary size for this buffer relies
+   *  on a implementation details of boost::format (and might break)
+   */
   _Fmt::_Fmt (string formatString)
-  {
-    BOOST_STATIC_ASSERT (sizeof(boost::format) <= FORMATTER_SIZE);
-    
-    new(formatter_) boost::format(formatString);
-    suppressInsufficientArgumentErrors (formatter_);
-  }
+  try {
+      BOOST_STATIC_ASSERT (sizeof(boost::format) <= FORMATTER_SIZE);
+      
+      new(formatter_) boost::format(formatString);
+      suppressInsufficientArgumentErrors (formatter_);
+    }
+  catch (boost::io::bad_format_string& syntaxError)
+    {
+      throw lumiera::error::Fatal (syntaxError
+                                  , _Fmt("Format string '%s' is broken") % formatString
+                                  , LUMIERA_ERROR_FORMAT_SYNTAX);
+    }
+  
   
   _Fmt::~_Fmt ()
   {
@@ -152,6 +166,7 @@ namespace util {
     }
   catch (std::exception& failure)
     {
+      _clear_errorflag();
       WARN (progress, "Format: Parameter '%s' causes problems: %s"
                     , cStr(str(val))
                     , failure.what());
@@ -159,6 +174,7 @@ namespace util {
     }
   catch (...)
     {
+      _clear_errorflag();
       WARN (progress, "Format: Unexpected problems accepting format parameter '%s'", cStr(str(val)));
       pushFailsafeReplacement (formatter);
     }
@@ -198,11 +214,13 @@ namespace util {
   
   catch (std::exception& failure)
     {
+      _clear_errorflag();
       WARN (progress, "Format: Failure to receive formatted result: %s", failure.what());
       return "";
     }
   catch (...)
     {
+      _clear_errorflag();
       WARN (progress, "Format: Unexpected problems while formatting output.");
       return "";
     }
@@ -222,15 +240,20 @@ namespace util {
   
   catch(std::exception& failure)
     {
+      _clear_errorflag();
       WARN (progress, "Format: Failure when outputting formatted result: %s", failure.what());
       return os << "";
     }
   catch(...)
     {
+      _clear_errorflag();
       WARN (progress, "Format: Unexpected problems while producing formatted output.");
       return os << "";
     }
   
   
+  LUMIERA_ERROR_DEFINE (FORMAT_SYNTAX, "Syntax error in format string for boost::format");
+  
+  
   
 } // namespace util
diff --git a/src/lib/format-string.hpp b/src/lib/format-string.hpp
index 0c49bbe0a..716aa0e3d 100644
--- a/src/lib/format-string.hpp
+++ b/src/lib/format-string.hpp
@@ -25,19 +25,77 @@
  ** Front-end for printf-style string template interpolation.
  ** While the actual implementation just delegates to boost::format, this front-end
  ** hides the direct dependency, additionally invokes a custom toSting conversion
- ** whenever possible, provides a direct conversion to string and catches any exceptions.
+ ** whenever possible, provides a direct automatic conversion to the formatted result
+ ** to string and catches any exceptions.
+ ** 
  ** This front-end is used pervasively for diagnostics and logging, so keeping down the
  ** compilation and object size cost and reliably handling any error is more important
  ** than the (small) performance gain of directly invoking boost::format (which is
  ** known to be 10 times slower than printf anyway).
  ** 
- ** @remarks The implementation is invoked through a set of explicit specialisations.
- **          For custom types, we prefer to invoke operator string(), which is determined
- **          by a directly coded metaprogramming test. The compile time and object size
- **          overhead incurred by using this header was verified to be negligible. 
+ ** \par Implementation notes
+ ** To perform the formatting, usually a \c _Fmt object is created as an anonymous
+ ** temporary, but it may as well be stored into a variable. Copying is not permitted.
+ ** Individual parameters are then fed for formatting through the \c '%' operator.
+ ** Each instance of _Fmt uses its own embedded boost::format object for implementation,
+ ** but this formatter resides within an opaque buffer embedded into the frontend object.
+ ** The rationale for this admittedly tricky approach is to confine any usage of boost::format
+ ** to the implementation translation unit (format-string.cpp).
  ** 
+ ** The implementation is invoked by the frontend through a set of explicit specialisations
+ ** for all the relevant \em primitive data types. For custom types, we prefer to invoke
+ ** operator string() if possible, which is determined by a simple metaprogramming test,
+ ** which is defined in lib/meta/util.pp, without relying on boost. As a fallback, for
+ ** all other types without built-in or custom string conversion, we use the mangled
+ ** type string produced by RTTI.
+ ** 
+ ** The compile time and object size overhead incurred by using this header was verified
+ ** to be negligible, in comparison to using boost::format. When compiling a demo example
+ ** on x86_64, the following executable sizes could be observed:
+ ** 
+ **                                          debug  stripped
+ ** just string concatenation ...............  42k  8.8k
+ ** including and using format-string.hpp ...  50k  9.4k
+ ** including and using boost::format ....... 420k  140k
+ ** 
+ ** In addition, we need to take the implementation translation unit (format-string.cpp)
+ ** into account, which is required once per application and contains the specialisations
+ ** for all primitive types. In the test showed above, the corresponding object file
+ ** had a size of 1300k (with debug information) resp. 290k (stripped).
+ ** 
+ ** \par Usage
+ ** The syntax of the format string is defined by boost::format and closely mimics
+ ** the printf formatting directives. The notable difference is that boost::format
+ ** uses the C++ stream output framework, and thus avoiding the perils of printf.
+ ** The individual formatting placeholders just set the corresponding flags on
+ ** an embedded string stream, thus the actual parameter types cause the
+ ** selection of a suitable format, not the definitions within the
+ ** format string.
+ ** 
+ ** An illegal format string will raise an error::Fatal. Any other error during usage of
+ ** the formatter is caught, logged and suppressed, inserting an error indicator into
+ ** the formatted result instead
+ ** 
+ ** A formatter is usually created as an anonymous object, at places where a string
+ ** is expected. An arbitrary number of parameters is then supplied using the \c '%' operator.
+ ** The result can be obtained
+ ** - by string conversion
+ ** - by feeding into an output stream.
+ ** 
+ ** Code example:
+ ** \code
+ ** double total = 22.9499;
+ ** const char * currency = "€";
+ ** cout << _Fmt("price %+5.2f %s") % total % currency << endl;
+ ** \endcode
+ ** 
+ ** @remarks See the unit-test for extensive usage examples and corner cases.
+ **          The header format-util.hpp provides an alternative string conversion,
+ **          using a bit of boost type traits and lexical_cast, but no boost::format.
+ ** @warning not suited for performance critical code. About 10 times slower than printf.
+ **  
  ** @see FormatString_test
- ** @see format-helper
+ ** @see format-util.hpp
  ** 
  */
 
@@ -71,26 +129,33 @@ namespace std { // forward declaration to avoid including 
 
 namespace util {
   
-  typedef unsigned char uchar;
-  
-  using boost::enable_if;
   using std::string;
-
+  using boost::enable_if;
   
+  typedef unsigned char uchar;
+
+  LUMIERA_ERROR_DECLARE (FORMAT_SYNTAX); ///< "Syntax error in format string for boost::format"
   
   
   
   /** 
-   * @todo write type comment
+   * A front-end for using printf-style formatting.
+   * Values to be formatted can be supplied through the
+   * operator%. Custom defined string conversions on objects
+   * will be used, any errors while invoking the format operation
+   * will be suppressed. The implementation is based on boost::format,
+   * but kept opaque to keep code size and compilation times down.
+   * @see FormatString_test
    */
   class _Fmt
     : boost::noncopyable
     {
-      /** size of an internal implementation Buffer */
+      /** size of an opaque implementation Buffer */
       enum{ FORMATTER_SIZE = lib::meta::SizeTrait::BOOST_FORMAT };
       
       typedef char Implementation[FORMATTER_SIZE];
       
+      
       /** @internal buffer to hold a boost::format */
       mutable Implementation formatter_;
       
@@ -143,9 +208,10 @@ namespace util {
    * \par type specific treatment
    * Basic types (numbers, chars, strings) are passed to the implementation
    * (= boost::format) literally. For custom types, we try to use a custom
-   * string conversion, if applicable. Any other type gets just translated
-   * into a type-ID (using the mangled RTTI info). In case of errors during
-   * the conversion, a string representation of the error is returned
+   * string conversion, if applicable. Non-NULL pointers will be dereferenced,
+   * with the exception of C-Strings and \c void*. Any other type gets just
+   * translated  into a type-ID (using the mangled RTTI info). In case of errors
+   * during the conversion, a string representation of the error is returned
    * @param val arbitrary value or pointer to be included into the result
    * @warning you need to provide exactly the right number of parameters,
    *          i.e. matching the number of fields in the format string.
@@ -203,9 +269,17 @@ namespace util {
       };
     
     
+    inline void
+    _clear_errorflag()
+    {
+      const char* errID = lumiera_error();
+      TRACE_IF (errID, progress, "Lumiera errorstate '%s' cleared.", errID);
+    }
+    
     inline string
     _log_and_stringify (std::exception const& ex)
     {
+      _clear_errorflag();
       WARN (progress, "Error while invoking custom string conversion: %s", ex.what());
       try {
           return string("";
@@ -276,7 +350,7 @@ namespace util {
         }
     };
   
-  /** some custom types explicitly provide string representation */
+  /** some custom types explicitly provide a string representation */
   template
   struct _Fmt::Converter >::type>
     {
diff --git a/tests/40components.tests b/tests/40components.tests
index 62827efac..92ead61e2 100644
--- a/tests/40components.tests
+++ b/tests/40components.tests
@@ -329,7 +329,18 @@ return: 0
 END
 
 
-PLANNED "formatting by string template" FormatString_test <
Date: Sat, 31 Dec 2011 20:33:50 +0100
Subject: [PATCH 47/87] rearrange OutputSlot ConnectionStateManager

... shape the various APIs more clearly,
make most functions protected
---
 src/proc/play/output-slot-connection.hpp | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/proc/play/output-slot-connection.hpp b/src/proc/play/output-slot-connection.hpp
index 2cbd34c4e..29e6bf8e4 100644
--- a/src/proc/play/output-slot-connection.hpp
+++ b/src/proc/play/output-slot-connection.hpp
@@ -171,14 +171,11 @@ namespace play {
         }
       
       
-    public:
-      ConnectionStateManager()
-        { }
-      
-      virtual
-     ~ConnectionStateManager()
-        { }
+    protected: /* == API for OutputSlot-Impl == */
       
+      /** factory function to build the actual
+       *  connection handling objects per channel */
+      virtual CON buildConnection()  =0;
       
       void
       init (uint numChannels)
@@ -188,9 +185,13 @@ namespace play {
         }
       
       
-      /** factory function to build the actual
-       *  connection handling objects per channel */
-      virtual CON buildConnection()  =0;
+      ConnectionStateManager() { }
+      
+    public:
+      virtual
+     ~ConnectionStateManager()
+        { }
+      
       
       
     private: // Implementation details

From e63fa6d64643688b8cfa75fa3519b6e2cfe2951c Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sun, 1 Jan 2012 06:20:42 +0100
Subject: [PATCH 48/87] Test-driven brainstorming: draft a ScopedCollection
 #877

---
 src/lib/opaque-holder.hpp                     |   4 +-
 src/lib/scoped-collection.hpp                 | 161 +++++++++
 src/lib/test/testdummy.hpp                    |  14 +-
 tests/40components.tests                      |   7 +-
 .../proc/play/diagnostic-output-slot.hpp      |   2 +
 tests/lib/diagnostic-context-test.cpp         |   2 +-
 tests/lib/scoped-collection-test.cpp          | 326 ++++++++++++++++++
 tests/lib/scoped-holder-test.cpp              |  12 +-
 tests/lib/scoped-holder-transfer-test.cpp     |   2 +-
 9 files changed, 516 insertions(+), 14 deletions(-)
 create mode 100644 src/lib/scoped-collection.hpp
 create mode 100644 tests/lib/scoped-collection-test.cpp

diff --git a/src/lib/opaque-holder.hpp b/src/lib/opaque-holder.hpp
index d19ecfcc8..7ffb2463b 100644
--- a/src/lib/opaque-holder.hpp
+++ b/src/lib/opaque-holder.hpp
@@ -253,6 +253,8 @@ namespace lib {
       template
       struct Buff : Buffer
         {
+          BOOST_STATIC_ASSERT (siz >= sizeof(SUB));
+          
           SUB&
           get()  const  ///< core operation: target is contained within the inline buffer
             {
@@ -267,8 +269,6 @@ namespace lib {
           explicit
           Buff (SUB const& obj)
             {
-              BOOST_STATIC_ASSERT (siz >= sizeof(SUB));
-              
               new(Buffer::ptr()) SUB (obj);
             }
           
diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
new file mode 100644
index 000000000..8a2fb81e0
--- /dev/null
+++ b/src/lib/scoped-collection.hpp
@@ -0,0 +1,161 @@
+/*
+  SCOPED-COLLECTION.hpp  -  managing a fixed collection of noncopyable polymorphic objects 
+
+  Copyright (C)         Lumiera.org
+    2012,               Hermann Vosseler 
+
+  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.
+
+*/
+
+/** @file scoped-collection.hpp
+ ** Managing a collection of noncopyable polymorphic objects in compact storage.
+ ** This helper supports the frequently encountered situation where a service
+ ** implementation internally manages a collection of implementation related
+ ** sub-components with reference semantics. Typically, those objects are
+ ** being used polymorphically, and often they are also added step by step.
+ ** The storage holding all those child objects is allocated in one chunk
+ ** and never adjusted.
+ ** 
+ ** - TODO: retro-fit with RefArray interface
+ ** 
+ ** @see ScopedCollection_test
+ ** @see scoped-ptrvect.hpp quite similar, but using individual heap pointers
+ */
+
+
+#ifndef LIB_SCOPED_COLLECTION_H
+#define LIB_SCOPED_COLLECTION_H
+
+
+//#include "include/logging.h"
+//#include "lib/iter-adapter.hpp"
+#include "lib/error.hpp"
+//#include "lib/util.hpp"
+
+//#include 
+//#include 
+#include 
+
+
+namespace lib {
+  
+  
+  
+  /**
+   * A fixed collection of noncopyable polymorphic objects.
+   * All child objects reside in a common chunk of storage
+   * and are owned and managed by this collection holder.
+   * Array style access and iteration.
+   */
+  template
+  class ScopedCollection
+    : boost::noncopyable
+    {
+//    typedef std::vector _Vec;
+//    typedef typename _Vec::iterator VIter;
+//    
+//    typedef RangeIter RIter;
+//    typedef PtrDerefIter IterType;
+//    
+//    typedef typename IterType::ConstIterType ConstIterType;
+//    typedef typename IterType::WrappedConstIterType RcIter;
+      
+      
+    public:
+      typedef size_t   size_type;
+//    typedef T &      reference;
+//    typedef T const& const_reference;
+      
+      
+      
+      ScopedCollection ()
+        { }
+      
+      explicit
+      ScopedCollection (size_type capacity)
+        {
+          UNIMPLEMENTED ("prepare scoped collection storage");
+        }
+      
+     ~ScopedCollection ()
+        { 
+          clear();
+        }
+      
+      
+      
+      
+      void
+      clear()
+        {
+          UNIMPLEMENTED ("drop all content objects");
+        }
+      
+      
+      /* === Element access and iteration === */
+      
+      T&
+      operator[] (size_type i)
+        {
+          return *get(i);
+        }
+      
+//    typedef IterType      iterator;
+//    typedef ConstIterType const_iterator;
+//    
+//    iterator       begin()        { return       iterator (allPtrs()); }
+//    iterator       end()          { return       iterator ( RIter() ); }
+//    const_iterator begin()  const { return const_iterator::build_by_cast (allPtrs()); }
+//    const_iterator end()    const { return const_iterator::nil();      }
+      
+      
+      
+      
+      /* ====== proxied vector functions ==================== */
+      
+//    size_type  size ()      const  { return _Vec::size();     }
+//    size_type  max_size ()  const  { return _Vec::max_size(); }
+//    size_type  capacity ()  const  { return _Vec::capacity(); }
+//    bool       empty ()     const  { return _Vec::empty();    }
+      
+      
+    private:
+      /** @internal element access, including range and null check */
+      T*
+      get (size_type i)
+        {
+          UNIMPLEMENTED("raw element access");
+        }
+      
+//    /** @internal access sequence of all managed pointers */
+//    RIter
+//    allPtrs ()
+//      {
+//        return RIter (_Vec::begin(), _Vec::end());
+//      }
+//    RIter
+//    allPtrs ()  const
+//      {
+//        _Vec& elements = util::unConst(*this);
+//        return RIter (elements.begin(), elements.end());
+//      }
+    };
+  
+  
+  
+  
+} // namespace lib
+#endif
diff --git a/src/lib/test/testdummy.hpp b/src/lib/test/testdummy.hpp
index 24d467c1f..27d4e79c7 100644
--- a/src/lib/test/testdummy.hpp
+++ b/src/lib/test/testdummy.hpp
@@ -48,14 +48,22 @@ namespace test{
         : val_(v)
         { init(); }
       
-      ~Dummy()
+      virtual ~Dummy()
         {
           checksum() -= val_;
         }
       
-      long add (int i)    { return val_+i; }
+      virtual long
+      acc (int i)   ///< dummy API operation
+        {
+          return val_+i;
+        }
       
-      int getVal()  const { return val_; }
+      int
+      getVal()  const
+        {
+          return val_;
+        }
       
       void
       setVal (int newVal)
diff --git a/tests/40components.tests b/tests/40components.tests
index 92ead61e2..d22d69d07 100644
--- a/tests/40components.tests
+++ b/tests/40components.tests
@@ -617,7 +617,12 @@ out: ^\.throw some exceptions...
 END
 
 
-TEST "ScopedPtrVect_test" ScopedPtrVect_test <timeOf (frameNr);
         }
       
diff --git a/tests/lib/diagnostic-context-test.cpp b/tests/lib/diagnostic-context-test.cpp
index 001c92cef..008c37af5 100644
--- a/tests/lib/diagnostic-context-test.cpp
+++ b/tests/lib/diagnostic-context-test.cpp
@@ -39,7 +39,7 @@ namespace test{
   
   namespace { // private test setup...
     
-    const uint NUM_THREADS = 50;
+    const uint NUM_THREADS = 40;
     const uint MAX_RAND    = 1000*1000;
     
     inline bool
diff --git a/tests/lib/scoped-collection-test.cpp b/tests/lib/scoped-collection-test.cpp
new file mode 100644
index 000000000..f712c239e
--- /dev/null
+++ b/tests/lib/scoped-collection-test.cpp
@@ -0,0 +1,326 @@
+/*
+  ScopedCollection(Test)  -  holding and owning a fixed collection of noncopyable objects
+
+  Copyright (C)         Lumiera.org
+    2012,               Hermann Vosseler 
+
+  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/test/test-helper.hpp"
+#include "lib/util.hpp"
+
+#include "lib/scoped-collection.hpp"
+#include "lib/test/testdummy.hpp"
+
+#include 
+
+
+namespace lib {
+namespace test{
+  
+  namespace error = lumiera::error;
+  
+  
+  namespace { // our explosive special Dummy
+    
+    LUMIERA_ERROR_DEFINE(SUBVERSIVE, "undercover action");
+    
+    class SubDummy
+      : public Dummy
+      {
+        int trigger_;
+        
+        /** special variant of the dummy API operation:
+         * @param i when zero, the trigger value will be revealed
+         */
+        virtual long
+        acc (int i)
+          {
+            if (!i)
+              return getVal() + trigger_;
+            else
+              return Dummy::acc(i);
+          }
+        
+      public:
+        SubDummy (int id, int trigger)
+          : Dummy(id)
+          , trigger_(trigger)
+          {
+            if (trigger == getVal())
+              throw new error::Fatal ("Subversive Bomb", LUMIERA_ERROR_SUBVERSIVE);
+          }
+      };
+    
+  }//(End) subversive test data
+  
+  
+  
+  
+  using util::isnil;
+//using std::tr1::placeholders::_1;                     /////////////////////////////TODO
+  using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST;
+  
+  typedef ScopedCollection CollD;
+  
+  
+  /********************************************************************
+   *  @test ScopedCollection manages a fixed set of objects, but these
+   *        child objects are noncopyable, may be polymorphic, an can
+   *        be created either all at once or chunk wise. The API is
+   *        similar to a vector and allows for element access
+   *        and iteration.
+   */
+  class ScopedCollection_test : public Test
+    {
+      
+      virtual void
+      run (Arg)
+        {
+          simpleUsage();
+          building_RAII_Style();
+          building_StackStyle();
+          iterating();
+        }
+      
+      
+      void
+      simpleUsage()
+        {
+          CHECK (0 == Dummy::checksum());
+          {
+#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
+            CollD container(5);
+            CHECK (isnil (container));
+            CHECK (0 == container.size());
+            CHECK (0 == Dummy::checksum());
+            
+            container.populate();
+            CHECK (!isnil (container));
+            CHECK (5 == container.size());
+            CHECK (0 != Dummy::checksum());
+
+            holder.clear();
+            CHECK (isnil (container));
+            CHECK (0 == container.size());
+            CHECK (0 == Dummy::checksum());
+            
+            container.populate();
+            CHECK (Dummy::checksum() == container[0].getVal()
+                                      + container[1].getVal()
+                                      + container[2].getVal()
+                                      + container[3].getVal()
+                                      + container[4].getVal());
+#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
+          }
+          CHECK (0 == Dummy::checksum());
+        }
+      
+      
+      void
+      iterating()
+        {
+          CHECK (0 == Dummy::checksum());
+          {
+#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
+            CollD coll(50);
+            for (int i=0; i(i);
+            
+            int check=0;
+            CollD::iterator ii = coll.begin();
+            while (ii)
+              {
+                CHECK (check == ii->getVal());
+                CHECK (check == ii->acc(+5) - 5);
+                ++check;
+                ++ii;
+              }
+            
+            
+            // Test the const iterator
+            check = 0;
+            CollD::const_iterator cii = coll.begin();
+            while (cii)
+              {
+                CHECK (check == cii->getVal());
+                ++check;
+                ++cii;
+              }
+            
+            
+            // Verify correct behaviour of iteration end
+            CHECK (! (coll.end()));
+            CHECK (isnil (coll.end()));
+            
+            VERIFY_ERROR (ITER_EXHAUST, *coll.end() );
+            VERIFY_ERROR (ITER_EXHAUST, ++coll.end() );
+            
+            CHECK (ii == coll.end());
+            CHECK (cii == coll.end());
+            VERIFY_ERROR (ITER_EXHAUST, ++ii );
+            VERIFY_ERROR (ITER_EXHAUST, ++cii );
+            
+#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
+          }
+          CHECK (0 == Dummy::checksum());
+        }
+      
+      
+      void
+      building_RAII_Style()
+        {
+          UNIMPLEMENTED ("building all at once");
+          CHECK (0 == Dummy::checksum());
+          {
+#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
+                        /** Functor to populate the Collection */
+                        class Populator
+                          {
+                            uint i_;
+                            int off_;
+                            
+                          public:
+                            Populator (int baseOffset)
+                              : i_(0)
+                              , off_(baseOffset)
+                              { }
+                            
+                            void
+                            operator() (int specialOffset, void* storage)
+                              {
+                                switch (i_ % 2) 
+                                  {
+                                  case 0:
+                                    new(storage) Dummy(i_+off_);
+                                    break;
+                                    
+                                  case 1:
+                                    new(storage) SubDummy(i_+off_, specialOffset);
+                                    break;
+                              }   }
+                          };
+            
+            
+            int rr = rand() % 100;
+            int trigger = 101;
+            
+            CollD coll (6, Populator(rr), trigger, _1 );
+            
+            CHECK (!isnil (coll));
+            CHECK (6 == coll.size());
+            CHECK (0 != Dummy::checksum());
+            
+            CHECK (coll[0].acc(0) == 0 + rr);
+            CHECK (coll[1].acc(0) == 1 + rr + trigger);
+            CHECK (coll[2].acc(0) == 2 + rr);
+            CHECK (coll[3].acc(0) == 3 + rr + trigger);
+            CHECK (coll[4].acc(0) == 4 + rr);
+            CHECK (coll[5].acc(0) == 5 + rr + trigger);
+            
+            coll.clear();
+            CHECK (0 == Dummy::checksum());
+            
+            // Verify Error handling while in creation:
+            // SubDummy explodes on equal ctor parameters
+            // which here happens for i==7
+            VERIFY_ERROR (SUBVERSIVE, CollD(10, Populator(0), 7, _1 ) );
+            
+            // any already created object was properly destroyed
+            CHECK (0 == Dummy::checksum());
+#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
+          }
+          CHECK (0 == Dummy::checksum());
+        }
+      
+      
+      void
+      building_StackStyle()
+        {
+          UNIMPLEMENTED ("pushing new objects successively");
+          CHECK (0 == Dummy::checksum());
+          {
+#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
+              
+            int rr = rand() % 100;
+            
+            CollD coll(3);
+            CHECK (0 == coll.size());
+            CHECK (0 == Dummy::checksum());
+
+            Dummy& d0 = coll.appendNew();
+            CHECK (1 == coll.size());
+            
+            Dummy& d1 = coll.appendNew (r1);
+            CHECK (2 == coll.size());
+
+            int sum = Dummy::checksum();
+
+            // trigger the bomb
+            VERIFY_ERROR (SUBVERSIVE, coll.appendNew(r1,r1) );
+            
+            CHECK (  2 == coll.size()); // the other objects survived
+            CHECK (sum == Dummy::checksum());
+            
+            Dummy& d2 = coll.appendNew (r1, r1+1);
+            CHECK (3 == coll.size());
+            
+            CHECK (sum + r1 == Dummy::checksum());
+            
+            VERIFY_ERROR (CAPACITY, coll.appendNew());
+            VERIFY_ERROR (CAPACITY, coll.appendNew());
+            VERIFY_ERROR (CAPACITY, coll.appendNew());
+            
+            CHECK (3 == coll.size());
+            CHECK (sum + r1 == Dummy::checksum());
+            
+            
+            CHECK (d0.acc(11) == coll[0].getVal() + 11 );
+            CHECK (d1.acc(22) == r1 + 22);
+            CHECK (d2.acc(33) == r1 + 33);
+            CHECK (d2.acc(0)  == r1 + (r1+1) );     // SubDummy's special implementation of the acc()-function
+                                                   //  returns the trigger value, when the argument is zero
+            
+            coll.clear();
+            coll.appendNew (11,22);
+            
+            CHECK (3 == coll.size());
+            CHECK (11 == Dummy::checksum());
+            
+            // NOTE DANGEROUS:
+            // The previously obtained references just point into the object storage.
+            // Thus we're now accessing a different object, even a different type!
+            CHECK (d0.acc(0) == 11 + 22);
+            
+            // The others even point into obsoleted storage holding zombie objects
+            CHECK (d1.acc(44) == r1 + 44);
+            
+#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
+          }
+          CHECK (0 == Dummy::checksum());
+        }
+    };
+  
+  
+  LAUNCHER (ScopedCollection_test, "unit common");
+  
+  
+}} // namespace lib::test
+
diff --git a/tests/lib/scoped-holder-test.cpp b/tests/lib/scoped-holder-test.cpp
index 40b2637e7..3815d86a3 100644
--- a/tests/lib/scoped-holder-test.cpp
+++ b/tests/lib/scoped-holder-test.cpp
@@ -96,15 +96,15 @@ namespace test{
             CHECK (false!=holder);
             CHECK (holder!=false);
             
-            CHECK (0 != Dummy::checksum());
+            CHECK (0 < Dummy::checksum());
             CHECK ( &(*holder));
-            CHECK (holder->add(2) == 2 + Dummy::checksum());
+            CHECK (holder->acc(2) == 2 + Dummy::checksum());
             
             Dummy *rawP = holder.get();
             CHECK (rawP);
             CHECK (holder);
             CHECK (rawP == &(*holder));
-            CHECK (rawP->add(-5) == holder->add(-5));
+            CHECK (rawP->acc(-5) == holder->acc(-5));
             
             TRACE (test, "holder at %p", &holder);
             TRACE (test, "object at %p", holder.get() );
@@ -127,7 +127,7 @@ namespace test{
             try
               {
                 create_contained_object (holder);
-                NOTREACHED ();
+                NOTREACHED ("expect failure in ctor");
               }
             catch (int val)
               {
@@ -221,13 +221,13 @@ namespace test{
               {
                 create_contained_object (maph[i]);
                 CHECK (maph[i]);
-                CHECK (0 < maph[i]->add(12));
+                CHECK (0 < maph[i]->acc(12));
               }
             CHECK (100==maph.size());
             CHECK (0 != Dummy::checksum());
             
             
-            long value55 = maph[55]->add(0); 
+            long value55 = maph[55]->acc(0); 
             long currSum = Dummy::checksum();
             
             CHECK (1 == maph.erase(55));
diff --git a/tests/lib/scoped-holder-transfer-test.cpp b/tests/lib/scoped-holder-transfer-test.cpp
index 36b1bdd2c..add399caa 100644
--- a/tests/lib/scoped-holder-transfer-test.cpp
+++ b/tests/lib/scoped-holder-transfer-test.cpp
@@ -143,7 +143,7 @@ namespace test {
             CHECK (rawP);
             CHECK (table[5]);
             CHECK (rawP == &(*table[5]));
-            CHECK (rawP->add(-555) == table[5]->add(-555));
+            CHECK (rawP->acc(-555) == table[5]->acc(-555));
           }
           CHECK (0 == Dummy::checksum());
         }

From 6c01579a26e395f1d2b4b727e051570169977edd Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 2 Jan 2012 06:11:27 +0100
Subject: [PATCH 49/87] WIP draft implementation of ScopedCollection

---
 src/lib/error.hpp                    |   1 +
 src/lib/exception.cpp                |   1 +
 src/lib/scoped-collection.hpp        | 263 ++++++++++++++++++++++-----
 tests/lib/scoped-collection-test.cpp |   2 +-
 4 files changed, 218 insertions(+), 49 deletions(-)

diff --git a/src/lib/error.hpp b/src/lib/error.hpp
index 110ffe61b..1677557be 100644
--- a/src/lib/error.hpp
+++ b/src/lib/error.hpp
@@ -125,6 +125,7 @@ namespace lumiera {
     LUMIERA_ERROR_DECLARE (LIFECYCLE);    ///< Lifecycle assumptions violated
     LUMIERA_ERROR_DECLARE (WRONG_TYPE);   ///< runtime type mismatch
     LUMIERA_ERROR_DECLARE (ITER_EXHAUST); ///< end of sequence reached
+    LUMIERA_ERROR_DECLARE (INDEX_BOUNDS); ///< index out of bounds
     LUMIERA_ERROR_DECLARE (BOTTOM_VALUE); ///< invalid or NIL value
     LUMIERA_ERROR_DECLARE (UNCONNECTED);  ///< missing connection
     LUMIERA_ERROR_DECLARE (UNIMPLEMENTED);///< unimplemented feature
diff --git a/src/lib/exception.cpp b/src/lib/exception.cpp
index 8c524e5d4..26ddaadb2 100644
--- a/src/lib/exception.cpp
+++ b/src/lib/exception.cpp
@@ -82,6 +82,7 @@ namespace lumiera {
     LUMIERA_ERROR_DEFINE (LIFECYCLE, "Lifecycle assumptions violated");
     LUMIERA_ERROR_DEFINE (WRONG_TYPE, "runtime type mismatch");
     LUMIERA_ERROR_DEFINE (ITER_EXHAUST, "end of sequence reached");
+    LUMIERA_ERROR_DEFINE (INDEX_BOUNDS, "index out of bounds");
     LUMIERA_ERROR_DEFINE (BOTTOM_VALUE, "invalid or NIL value");
     LUMIERA_ERROR_DEFINE (UNCONNECTED, "missing connection");
     LUMIERA_ERROR_DEFINE (UNIMPLEMENTED, "using a feature not yet implemented....");
diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
index 8a2fb81e0..f0f8aac34 100644
--- a/src/lib/scoped-collection.hpp
+++ b/src/lib/scoped-collection.hpp
@@ -41,117 +41,284 @@
 
 
 //#include "include/logging.h"
-//#include "lib/iter-adapter.hpp"
+#include "lib/iter-adapter.hpp"
 #include "lib/error.hpp"
 //#include "lib/util.hpp"
 
 //#include 
 //#include 
 #include 
+#include 
+#include 
 
 
 namespace lib {
   
+  namespace error = lumiera::error;
+  using error::LUMIERA_ERROR_INDEX_BOUNDS;
+  
   
   
   /**
    * A fixed collection of noncopyable polymorphic objects.
+
    * All child objects reside in a common chunk of storage
    * and are owned and managed by this collection holder.
    * Array style access and iteration.
    */
-  template
+  template
+    < class I                    ///< the nominal Base/Interface class for a family of types
+    , size_t siz = sizeof(I)     ///< maximum storage required for the targets to be held inline
+    >
   class ScopedCollection
     : boost::noncopyable
     {
+      
+      /** 
+       * Wrapper to hold one Child object.
+       * The storage will be an heap allocated
+       * array of such Wrapper objects.
+       */
+      class ElementHolder
+        : boost::noncopyable
+        {
+      
+          mutable char buf_[siz];
+          
+        public:
+          ElementHolder () { }
+         ~ElementHolder ()
+            {
+              destroy();
+            }
+         
+          I&
+          accessObj()  const
+            {
+              return reinterpret_cast (buf_);
+            }
+          
+          void
+          destroy()
+            {
+              accessObj().~I();
+            }
+          
+          I&
+          operator* ()  const
+            {
+              return accessObj();
+            }
+          
+          
+          
+          /** Abbreviation for placement new */ 
+#define EMBEDDED_ELEMENT_CTOR(_CTOR_CALL_)    \
+              BOOST_STATIC_ASSERT (siz >= sizeof(TY));\
+              return *new(&buf_) _CTOR_CALL_;   \
+          
+          
+          template
+          TY&
+          create ()
+            {
+              EMBEDDED_ELEMENT_CTOR ( TY() )
+            }
+          
+          
+          template
+          TY&                                               //___________________________________________
+          create (A1& a1)                                  ///< place object of type TY, using 1-arg ctor
+            {
+              EMBEDDED_ELEMENT_CTOR ( TY(a1) )
+            }
+          
+          
+          template< class TY
+                  , typename A1
+                  , typename A2
+                  >
+          TY&                                               //___________________________________________
+          create (A1& a1, A2& a2)                          ///< place object of type TY, using 2-arg ctor
+            {
+              EMBEDDED_ELEMENT_CTOR ( TY(a1,a2) )
+            }
+          
+          
+          template< class TY
+                  , typename A1
+                  , typename A2
+                  , typename A3
+                  >
+          TY&                                               //___________________________________________
+          create (A1& a1, A2& a2, A3& a3)                  ///< place object of type TY, using 3-arg ctor
+            {
+              EMBEDDED_ELEMENT_CTOR ( TY(a1,a2,a3) )
+            }
+          
+          
+          template< class TY
+                  , typename A1
+                  , typename A2
+                  , typename A3
+                  , typename A4
+                  >
+          TY&                                               //___________________________________________
+          create (A1& a1, A2& a2, A3& a3, A4& a4)          ///< place object of type TY, using 4-arg ctor
+            {
+              EMBEDDED_ELEMENT_CTOR ( TY(a1,a2,a3,a4) )
+            }
+          
+          
+          template< class TY
+                  , typename A1
+                  , typename A2
+                  , typename A3
+                  , typename A4
+                  , typename A5
+                  >
+          TY&                                               //___________________________________________
+          create (A1& a1, A2& a2, A3& a3, A4& a4, A5& a5)  ///< place object of type TY, using 5-arg ctor
+            {
+              EMBEDDED_ELEMENT_CTOR ( TY(a1,a2,a3,a4,a5) )
+            }
+#undef EMBEDDED_ELEMENT_CTOR
+        };
+      
+      typedef boost::scoped_array ElementStorage;
+      
+      size_t level_;
+      size_t capacity_;
+      ElementStorage elements_;
+      
 //    typedef std::vector _Vec;
 //    typedef typename _Vec::iterator VIter;
+      typedef ElementHolder* StorageIter;
 //    
-//    typedef RangeIter RIter;
-//    typedef PtrDerefIter IterType;
-//    
-//    typedef typename IterType::ConstIterType ConstIterType;
-//    typedef typename IterType::WrappedConstIterType RcIter;
+      typedef RangeIter RIter;
+      typedef PtrDerefIter IterType;
+      
+      typedef typename IterType::ConstIterType ConstIterType;
+      typedef typename IterType::WrappedConstIterType RcIter;
       
       
     public:
-      typedef size_t   size_type;
+//    typedef size_t   size_type;
 //    typedef T &      reference;
 //    typedef T const& const_reference;
       
       
       
-      ScopedCollection ()
-        { }
-      
-      explicit
-      ScopedCollection (size_type capacity)
-        {
-          UNIMPLEMENTED ("prepare scoped collection storage");
-        }
-      
      ~ScopedCollection ()
         { 
           clear();
         }
       
+      explicit
+      ScopedCollection (size_t maxElements)
+        : level_(0)
+        , capacity_(maxElements)
+        , elements_(new ElementHolder[maxElements])
+        { }
+      
+      template
+      ScopedCollection (size_t maxElements, CTOR builder)
+        : level_(0)
+        , capacity_(maxElements)
+        , elements_(new ElementHolder[maxElements])
+        { 
+          UNIMPLEMENTED ("use the builder to populate the elements right away");
+        }
       
       
       
       void
       clear()
         {
-          UNIMPLEMENTED ("drop all content objects");
+          REQUIRE (level_ <= capacity_, "Storage corrupted");
+          
+          while (level_)
+            {
+              --level_;
+              try {
+                  elements_[level_].destroy();
+                }
+              ERROR_LOG_AND_IGNORE (progress, "Clean-up of element in ScopedCollection")
+            }
         }
       
+      void
+      populate()
+        try {
+            while (level_ < capacity_)
+              {
+                elements_[level_].template create();
+                ++level_;
+              }
+          }
+        catch(...)
+          {
+            WARN (progress, "Failure while populating ScopedCollection. "
+                            "All elements will be discarded");
+            clear();
+            throw;
+          }
+      
       
       /* === Element access and iteration === */
       
-      T&
-      operator[] (size_type i)
+      I&
+      operator[] (size_t index)
         {
-          return *get(i);
+          if (index < level_)
+            return elements_[index];
+          
+          throw error::Logic ("Attempt to access not (yet) existing object in ScopedCollection"
+                             , LUMIERA_ERROR_INDEX_BOUNDS);
         }
       
-//    typedef IterType      iterator;
-//    typedef ConstIterType const_iterator;
-//    
-//    iterator       begin()        { return       iterator (allPtrs()); }
-//    iterator       end()          { return       iterator ( RIter() ); }
-//    const_iterator begin()  const { return const_iterator::build_by_cast (allPtrs()); }
-//    const_iterator end()    const { return const_iterator::nil();      }
+      typedef IterType      iterator;
+      typedef ConstIterType const_iterator;
+      
+      iterator       begin()        { return       iterator (allPtrs()); }
+      iterator       end()          { return       iterator ( RIter() ); }
+      const_iterator begin()  const { return const_iterator::build_by_cast (allPtrs()); }
+      const_iterator end()    const { return const_iterator::nil();      }
       
       
       
       
       /* ====== proxied vector functions ==================== */
       
-//    size_type  size ()      const  { return _Vec::size();     }
+      size_t  size ()      const  { return level_;     }
 //    size_type  max_size ()  const  { return _Vec::max_size(); }
 //    size_type  capacity ()  const  { return _Vec::capacity(); }
-//    bool       empty ()     const  { return _Vec::empty();    }
+      bool    empty ()     const  { return 0 == level_; }
       
       
     private:
-      /** @internal element access, including range and null check */
-      T*
-      get (size_type i)
-        {
-          UNIMPLEMENTED("raw element access");
-        }
+//    /** @internal element access, including range and null check */
+//    T*
+//    get (size_type i)
+//      {
+//        UNIMPLEMENTED("raw element access");
+//      }
       
-//    /** @internal access sequence of all managed pointers */
-//    RIter
-//    allPtrs ()
-//      {
-//        return RIter (_Vec::begin(), _Vec::end());
-//      }
-//    RIter
-//    allPtrs ()  const
-//      {
-//        _Vec& elements = util::unConst(*this);
-//        return RIter (elements.begin(), elements.end());
-//      }
+      /** @internal access sequence of all managed pointers */
+      RIter
+      allPtrs ()
+        {
+          ElementHolder * storage_begin = elements_.get();
+          ElementHolder * storage_end   = storage_begin + capacity_;
+          
+          return RIter (storage_begin, storage_end);
+        }
+      RIter
+      allPtrs ()  const
+        {
+          ScopedCollection& elements = util::unConst(*this);
+          return RIter (elements.begin(), elements.end());
+        }
     };
   
   
diff --git a/tests/lib/scoped-collection-test.cpp b/tests/lib/scoped-collection-test.cpp
index f712c239e..29eddda2f 100644
--- a/tests/lib/scoped-collection-test.cpp
+++ b/tests/lib/scoped-collection-test.cpp
@@ -117,7 +117,7 @@ namespace test{
             CHECK (5 == container.size());
             CHECK (0 != Dummy::checksum());
 
-            holder.clear();
+            container.clear();
             CHECK (isnil (container));
             CHECK (0 == container.size());
             CHECK (0 == Dummy::checksum());

From fa5e7db2d397f2a111d2a1ca4e50f1dd908c933a Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 3 Jan 2012 02:50:22 +0100
Subject: [PATCH 50/87] WIP rewrite iteration-control logic...

---
 src/lib/scoped-collection.hpp        | 68 ++++++++++++++++------------
 tests/lib/scoped-collection-test.cpp |  2 -
 2 files changed, 40 insertions(+), 30 deletions(-)

diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
index f0f8aac34..d9b80b469 100644
--- a/src/lib/scoped-collection.hpp
+++ b/src/lib/scoped-collection.hpp
@@ -191,15 +191,42 @@ namespace lib {
       size_t capacity_;
       ElementStorage elements_;
       
-//    typedef std::vector _Vec;
-//    typedef typename _Vec::iterator VIter;
-      typedef ElementHolder* StorageIter;
-//    
-      typedef RangeIter RIter;
-      typedef PtrDerefIter IterType;
       
-      typedef typename IterType::ConstIterType ConstIterType;
-      typedef typename IterType::WrappedConstIterType RcIter;
+      typedef IterAdapter<      I *, const ScopedCollection *> IterType;
+      typedef IterAdapter ConstIterType;
+      
+      /* ==== internal callback API for the iterator ==== */
+      
+      friend void
+      iterNext (const ScopedCollection*, const I* & pos)
+      {
+        ElementHolder* & storageLocation = reinterpret_cast (pos);
+        ++storageLocation;
+      }
+        
+      /** Implementation of Iteration-logic: detect iteration end.
+       *  @note the problem here is that this implementation chooses
+       *        to use two representations of "bottom" (end, invalid).
+       *        The reason is, we want the default-constructed IterAdapter
+       *        also be the "bottom" value. Thus, when we detect the
+       *        iteration end by internal logic (\c numberz_.end() ), we
+       *        immediately transform this into the official "bottom"
+       */
+      friend bool
+      hasNext (const ScopedCollection* src, const I* & pos)
+      {
+        REQUIRE (src);
+        if ((pos) && (pos < src->_access_end()))
+          return true;
+        else
+          {
+            pos = 0;
+            return false;
+      }   }
+      
+      I* _access_begin() { return &elements_[0]; }
+      I* _access_end() { return &elements_[level_]; }
+      
       
       
     public:
@@ -271,7 +298,7 @@ namespace lib {
       operator[] (size_t index)
         {
           if (index < level_)
-            return elements_[index];
+            return elements_[index].accessObj();
           
           throw error::Logic ("Attempt to access not (yet) existing object in ScopedCollection"
                              , LUMIERA_ERROR_INDEX_BOUNDS);
@@ -280,10 +307,10 @@ namespace lib {
       typedef IterType      iterator;
       typedef ConstIterType const_iterator;
       
-      iterator       begin()        { return       iterator (allPtrs()); }
-      iterator       end()          { return       iterator ( RIter() ); }
-      const_iterator begin()  const { return const_iterator::build_by_cast (allPtrs()); }
-      const_iterator end()    const { return const_iterator::nil();      }
+      iterator       begin ()       { return iterator       (this, _access_begin()); }
+      const_iterator begin () const { return const_iterator (this, _access_begin()); }
+      iterator       end ()         { return iterator();       }
+      const_iterator end ()   const { return const_iterator(); }
       
       
       
@@ -304,21 +331,6 @@ namespace lib {
 //        UNIMPLEMENTED("raw element access");
 //      }
       
-      /** @internal access sequence of all managed pointers */
-      RIter
-      allPtrs ()
-        {
-          ElementHolder * storage_begin = elements_.get();
-          ElementHolder * storage_end   = storage_begin + capacity_;
-          
-          return RIter (storage_begin, storage_end);
-        }
-      RIter
-      allPtrs ()  const
-        {
-          ScopedCollection& elements = util::unConst(*this);
-          return RIter (elements.begin(), elements.end());
-        }
     };
   
   
diff --git a/tests/lib/scoped-collection-test.cpp b/tests/lib/scoped-collection-test.cpp
index 29eddda2f..8847ee15f 100644
--- a/tests/lib/scoped-collection-test.cpp
+++ b/tests/lib/scoped-collection-test.cpp
@@ -106,7 +106,6 @@ namespace test{
         {
           CHECK (0 == Dummy::checksum());
           {
-#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
             CollD container(5);
             CHECK (isnil (container));
             CHECK (0 == container.size());
@@ -128,7 +127,6 @@ namespace test{
                                       + container[2].getVal()
                                       + container[3].getVal()
                                       + container[4].getVal());
-#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
           }
           CHECK (0 == Dummy::checksum());
         }

From 57741a94d970b311dd23bb228dbc3297cf425d93 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 4 Jan 2012 03:30:34 +0100
Subject: [PATCH 51/87] fix random init error (division by zero possible)

---
 tests/components/proc/asset/meta/time-grid-basics-test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/components/proc/asset/meta/time-grid-basics-test.cpp b/tests/components/proc/asset/meta/time-grid-basics-test.cpp
index ea98b04bc..e90eb794a 100644
--- a/tests/components/proc/asset/meta/time-grid-basics-test.cpp
+++ b/tests/components/proc/asset/meta/time-grid-basics-test.cpp
@@ -103,7 +103,7 @@ namespace test {
           Time point (myGrid->timeOf (randomFrame));
           CHECK (point == testOrigin + randomFrame * testFps.duration());
           
-          uint fract = rand() % DIRT_GRAIN;
+          uint fract = 1 + rand() % DIRT_GRAIN;
           FSecs dirt = rational_cast (1 / testFps / fract);
           
           Time dirty(point + Time(dirt));

From 690304f9bcf307c018dc3b214ac329227d7df205 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 4 Jan 2012 04:05:03 +0100
Subject: [PATCH 52/87] get the simple and iteration unit tests to pass

---
 src/lib/error.hpp                    |   1 +
 src/lib/exception.cpp                |   1 +
 src/lib/scoped-collection.hpp        | 130 ++++++++++++++++++++++++---
 src/lib/scoped-ptrvect.hpp           |   2 +
 tests/lib/scoped-collection-test.cpp |   9 +-
 5 files changed, 125 insertions(+), 18 deletions(-)

diff --git a/src/lib/error.hpp b/src/lib/error.hpp
index 1677557be..364fd1fe6 100644
--- a/src/lib/error.hpp
+++ b/src/lib/error.hpp
@@ -125,6 +125,7 @@ namespace lumiera {
     LUMIERA_ERROR_DECLARE (LIFECYCLE);    ///< Lifecycle assumptions violated
     LUMIERA_ERROR_DECLARE (WRONG_TYPE);   ///< runtime type mismatch
     LUMIERA_ERROR_DECLARE (ITER_EXHAUST); ///< end of sequence reached
+    LUMIERA_ERROR_DECLARE (CAPACITY);     ///< predefined fixed storage capacity
     LUMIERA_ERROR_DECLARE (INDEX_BOUNDS); ///< index out of bounds
     LUMIERA_ERROR_DECLARE (BOTTOM_VALUE); ///< invalid or NIL value
     LUMIERA_ERROR_DECLARE (UNCONNECTED);  ///< missing connection
diff --git a/src/lib/exception.cpp b/src/lib/exception.cpp
index 26ddaadb2..53d068899 100644
--- a/src/lib/exception.cpp
+++ b/src/lib/exception.cpp
@@ -82,6 +82,7 @@ namespace lumiera {
     LUMIERA_ERROR_DEFINE (LIFECYCLE, "Lifecycle assumptions violated");
     LUMIERA_ERROR_DEFINE (WRONG_TYPE, "runtime type mismatch");
     LUMIERA_ERROR_DEFINE (ITER_EXHAUST, "end of sequence reached");
+    LUMIERA_ERROR_DEFINE (CAPACITY,     "predefined fixed storage capacity");
     LUMIERA_ERROR_DEFINE (INDEX_BOUNDS, "index out of bounds");
     LUMIERA_ERROR_DEFINE (BOTTOM_VALUE, "invalid or NIL value");
     LUMIERA_ERROR_DEFINE (UNCONNECTED, "missing connection");
diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
index d9b80b469..adc2339f5 100644
--- a/src/lib/scoped-collection.hpp
+++ b/src/lib/scoped-collection.hpp
@@ -31,6 +31,8 @@
  ** 
  ** - TODO: retro-fit with RefArray interface
  ** 
+ ** @warning deliberately \em not threadsafe
+ ** 
  ** @see ScopedCollection_test
  ** @see scoped-ptrvect.hpp quite similar, but using individual heap pointers
  */
@@ -55,6 +57,7 @@
 namespace lib {
   
   namespace error = lumiera::error;
+  using error::LUMIERA_ERROR_CAPACITY;
   using error::LUMIERA_ERROR_INDEX_BOUNDS;
   
   
@@ -75,9 +78,10 @@ namespace lib {
     {
       
       /** 
-       * Wrapper to hold one Child object.
+       * Storage Frame to hold one Child object.
        * The storage will be an heap allocated
        * array of such Wrapper objects.
+       * @note doesn't manage the Child
        */
       class ElementHolder
         : boost::noncopyable
@@ -86,11 +90,6 @@ namespace lib {
           mutable char buf_[siz];
           
         public:
-          ElementHolder () { }
-         ~ElementHolder ()
-            {
-              destroy();
-            }
          
           I&
           accessObj()  const
@@ -198,11 +197,18 @@ namespace lib {
       /* ==== internal callback API for the iterator ==== */
       
       friend void
-      iterNext (const ScopedCollection*, const I* & pos)
+      iterNext (const ScopedCollection*, I* & pos)
       {
         ElementHolder* & storageLocation = reinterpret_cast (pos);
         ++storageLocation;
       }
+      
+      friend void
+      iterNext (const ScopedCollection*, const I* & pos)
+      {
+        const ElementHolder* & storageLocation = reinterpret_cast (pos);
+        ++storageLocation;
+      }
         
       /** Implementation of Iteration-logic: detect iteration end.
        *  @note the problem here is that this implementation chooses
@@ -212,8 +218,9 @@ namespace lib {
        *        iteration end by internal logic (\c numberz_.end() ), we
        *        immediately transform this into the official "bottom"
        */
+      template
       friend bool
-      hasNext (const ScopedCollection* src, const I* & pos)
+      hasNext (const ScopedCollection* src, POS & pos)
       {
         REQUIRE (src);
         if ((pos) && (pos < src->_access_end()))
@@ -224,8 +231,8 @@ namespace lib {
             return false;
       }   }
       
-      I* _access_begin() { return &elements_[0]; }
-      I* _access_end() { return &elements_[level_]; }
+      I* _access_begin() const { return & elements_[0].accessObj(); }
+      I* _access_end()   const { return & elements_[level_].accessObj(); }
       
       
       
@@ -292,6 +299,98 @@ namespace lib {
           }
       
       
+      /** push a new element of default type
+       *  to the end of this container
+       * @note EX_STRONG */
+      I& appendNewElement() { return appendNew(); }
+      
+      
+      template< class TY >
+      TY&                                                  //_________________________________________
+      appendNew ()                                        ///< add object of type TY, using 0-arg ctor
+        {
+          __ensureSufficientCapacity();
+          TY& newElm = elements_[level_].template create();
+          ++level_;
+          return newElm;
+        }
+      
+      
+      template< class TY
+              , typename A1
+              >
+      TY&                                                  //_________________________________________
+      appendNew (A1& a1)                                  ///< add object of type TY, using 1-arg ctor
+        {
+          __ensureSufficientCapacity();
+          TY& newElm = elements_[level_].template create(a1);
+          ++level_;
+          return newElm;
+        }
+      
+      
+      template< class TY
+              , typename A1
+              , typename A2
+              >
+      TY&                                                  //_________________________________________
+      appendNew (A1& a1, A2& a2)                          ///< add object of type TY, using 2-arg ctor
+        {
+          __ensureSufficientCapacity();
+          TY& newElm = elements_[level_].template create(a1,a2);
+          ++level_;
+          return newElm;
+        }
+      
+      
+      template< class TY
+              , typename A1
+              , typename A2
+              , typename A3
+              >
+      TY&                                                  //_________________________________________
+      appendNew (A1& a1, A2& a2, A3& a3)                  ///< add object of type TY, using 3-arg ctor
+        {
+          __ensureSufficientCapacity();
+          TY& newElm = elements_[level_].template create(a1,a2,a3);
+          ++level_;
+          return newElm;
+        }
+      
+      
+      template< class TY
+              , typename A1
+              , typename A2
+              , typename A3
+              , typename A4
+              >
+      TY&                                                  //_________________________________________
+      appendNew (A1& a1, A2& a2, A3& a3, A4& a4)          ///< add object of type TY, using 4-arg ctor
+        {
+          __ensureSufficientCapacity();
+          TY& newElm = elements_[level_].template create(a1,a2,a3,a4);
+          ++level_;
+          return newElm;
+        }
+      
+      
+      template< class TY
+              , typename A1
+              , typename A2
+              , typename A3
+              , typename A4
+              , typename A5
+              >
+      TY&                                                  //_________________________________________
+      appendNew (A1& a1, A2& a2, A3& a3, A4& a4, A5& a5)  ///< add object of type TY, using 5-arg ctor
+        {
+          __ensureSufficientCapacity();
+          TY& newElm = elements_[level_].template create(a1,a2,a3,a4,a5);
+          ++level_;
+          return newElm;
+        }
+      
+      
       /* === Element access and iteration === */
       
       I&
@@ -317,9 +416,9 @@ namespace lib {
       
       /* ====== proxied vector functions ==================== */
       
-      size_t  size ()      const  { return level_;     }
+      size_t  size ()      const  { return level_;    }
 //    size_type  max_size ()  const  { return _Vec::max_size(); }
-//    size_type  capacity ()  const  { return _Vec::capacity(); }
+      size_t  capacity ()  const  { return capacity_; }
       bool    empty ()     const  { return 0 == level_; }
       
       
@@ -330,6 +429,13 @@ namespace lib {
 //      {
 //        UNIMPLEMENTED("raw element access");
 //      }
+      void
+      __ensureSufficientCapacity()
+        {
+          if (level_ >= capacity_)
+            throw error::State ("ScopedCollection exceeding the initially defined capacity"
+                               , LUMIERA_ERROR_CAPACITY);
+        }
       
     };
   
diff --git a/src/lib/scoped-ptrvect.hpp b/src/lib/scoped-ptrvect.hpp
index dd04492a6..37dff93dd 100644
--- a/src/lib/scoped-ptrvect.hpp
+++ b/src/lib/scoped-ptrvect.hpp
@@ -35,6 +35,8 @@
  ** - TODO: detaching of objects...
  ** - TODO: retro-fit with RefArray interface
  ** 
+ ** @warning deliberately \em not threadsafe
+ ** 
  ** @see scoped-ptrvect-test.cpp
  ** @see scoped-holder.hpp
  ** @see gui::DisplayService usage example
diff --git a/tests/lib/scoped-collection-test.cpp b/tests/lib/scoped-collection-test.cpp
index 8847ee15f..c79f74e89 100644
--- a/tests/lib/scoped-collection-test.cpp
+++ b/tests/lib/scoped-collection-test.cpp
@@ -137,9 +137,8 @@ namespace test{
         {
           CHECK (0 == Dummy::checksum());
           {
-#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
             CollD coll(50);
-            for (int i=0; i(i);
             
             int check=0;
@@ -154,8 +153,9 @@ namespace test{
             
             
             // Test the const iterator
+            CollD const& const_coll (coll);
             check = 0;
-            CollD::const_iterator cii = coll.begin();
+            CollD::const_iterator cii = const_coll.begin();
             while (cii)
               {
                 CHECK (check == cii->getVal());
@@ -176,7 +176,6 @@ namespace test{
             VERIFY_ERROR (ITER_EXHAUST, ++ii );
             VERIFY_ERROR (ITER_EXHAUST, ++cii );
             
-#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
           }
           CHECK (0 == Dummy::checksum());
         }
@@ -185,7 +184,6 @@ namespace test{
       void
       building_RAII_Style()
         {
-          UNIMPLEMENTED ("building all at once");
           CHECK (0 == Dummy::checksum());
           {
 #if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
@@ -252,7 +250,6 @@ namespace test{
       void
       building_StackStyle()
         {
-          UNIMPLEMENTED ("pushing new objects successively");
           CHECK (0 == Dummy::checksum());
           {
 #if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877

From 434a371c33288907055e9e0ba655a90a65a28d15 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 4 Jan 2012 04:28:14 +0100
Subject: [PATCH 53/87] take ctor args by value; test attaching sub-types
 passes

---
 src/lib/scoped-collection.hpp        | 137 +++++++++++++--------------
 tests/lib/scoped-collection-test.cpp |  30 +++---
 2 files changed, 78 insertions(+), 89 deletions(-)

diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
index adc2339f5..d240a39ee 100644
--- a/src/lib/scoped-collection.hpp
+++ b/src/lib/scoped-collection.hpp
@@ -127,7 +127,7 @@ namespace lib {
           
           template
           TY&                                               //___________________________________________
-          create (A1& a1)                                  ///< place object of type TY, using 1-arg ctor
+          create (A1 a1)                                   ///< place object of type TY, using 1-arg ctor
             {
               EMBEDDED_ELEMENT_CTOR ( TY(a1) )
             }
@@ -138,7 +138,7 @@ namespace lib {
                   , typename A2
                   >
           TY&                                               //___________________________________________
-          create (A1& a1, A2& a2)                          ///< place object of type TY, using 2-arg ctor
+          create (A1 a1, A2 a2)                            ///< place object of type TY, using 2-arg ctor
             {
               EMBEDDED_ELEMENT_CTOR ( TY(a1,a2) )
             }
@@ -150,7 +150,7 @@ namespace lib {
                   , typename A3
                   >
           TY&                                               //___________________________________________
-          create (A1& a1, A2& a2, A3& a3)                  ///< place object of type TY, using 3-arg ctor
+          create (A1 a1, A2 a2, A3 a3)                     ///< place object of type TY, using 3-arg ctor
             {
               EMBEDDED_ELEMENT_CTOR ( TY(a1,a2,a3) )
             }
@@ -163,7 +163,7 @@ namespace lib {
                   , typename A4
                   >
           TY&                                               //___________________________________________
-          create (A1& a1, A2& a2, A3& a3, A4& a4)          ///< place object of type TY, using 4-arg ctor
+          create (A1 a1, A2 a2, A3 a3, A4 a4)              ///< place object of type TY, using 4-arg ctor
             {
               EMBEDDED_ELEMENT_CTOR ( TY(a1,a2,a3,a4) )
             }
@@ -177,13 +177,17 @@ namespace lib {
                   , typename A5
                   >
           TY&                                               //___________________________________________
-          create (A1& a1, A2& a2, A3& a3, A4& a4, A5& a5)  ///< place object of type TY, using 5-arg ctor
+          create (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)       ///< place object of type TY, using 5-arg ctor
             {
               EMBEDDED_ELEMENT_CTOR ( TY(a1,a2,a3,a4,a5) )
             }
 #undef EMBEDDED_ELEMENT_CTOR
         };
       
+      
+      
+      /* ==== Storage: heap allocated array of element buffers ==== */
+      
       typedef boost::scoped_array ElementStorage;
       
       size_t level_;
@@ -194,54 +198,9 @@ namespace lib {
       typedef IterAdapter<      I *, const ScopedCollection *> IterType;
       typedef IterAdapter ConstIterType;
       
-      /* ==== internal callback API for the iterator ==== */
-      
-      friend void
-      iterNext (const ScopedCollection*, I* & pos)
-      {
-        ElementHolder* & storageLocation = reinterpret_cast (pos);
-        ++storageLocation;
-      }
-      
-      friend void
-      iterNext (const ScopedCollection*, const I* & pos)
-      {
-        const ElementHolder* & storageLocation = reinterpret_cast (pos);
-        ++storageLocation;
-      }
-        
-      /** Implementation of Iteration-logic: detect iteration end.
-       *  @note the problem here is that this implementation chooses
-       *        to use two representations of "bottom" (end, invalid).
-       *        The reason is, we want the default-constructed IterAdapter
-       *        also be the "bottom" value. Thus, when we detect the
-       *        iteration end by internal logic (\c numberz_.end() ), we
-       *        immediately transform this into the official "bottom"
-       */
-      template
-      friend bool
-      hasNext (const ScopedCollection* src, POS & pos)
-      {
-        REQUIRE (src);
-        if ((pos) && (pos < src->_access_end()))
-          return true;
-        else
-          {
-            pos = 0;
-            return false;
-      }   }
-      
-      I* _access_begin() const { return & elements_[0].accessObj(); }
-      I* _access_end()   const { return & elements_[level_].accessObj(); }
-      
       
       
     public:
-//    typedef size_t   size_type;
-//    typedef T &      reference;
-//    typedef T const& const_reference;
-      
-      
       
      ~ScopedCollection ()
         { 
@@ -299,6 +258,7 @@ namespace lib {
           }
       
       
+      
       /** push a new element of default type
        *  to the end of this container
        * @note EX_STRONG */
@@ -320,7 +280,7 @@ namespace lib {
               , typename A1
               >
       TY&                                                  //_________________________________________
-      appendNew (A1& a1)                                  ///< add object of type TY, using 1-arg ctor
+      appendNew (A1 a1)                                   ///< add object of type TY, using 1-arg ctor
         {
           __ensureSufficientCapacity();
           TY& newElm = elements_[level_].template create(a1);
@@ -334,7 +294,7 @@ namespace lib {
               , typename A2
               >
       TY&                                                  //_________________________________________
-      appendNew (A1& a1, A2& a2)                          ///< add object of type TY, using 2-arg ctor
+      appendNew (A1 a1, A2 a2)                            ///< add object of type TY, using 2-arg ctor
         {
           __ensureSufficientCapacity();
           TY& newElm = elements_[level_].template create(a1,a2);
@@ -349,7 +309,7 @@ namespace lib {
               , typename A3
               >
       TY&                                                  //_________________________________________
-      appendNew (A1& a1, A2& a2, A3& a3)                  ///< add object of type TY, using 3-arg ctor
+      appendNew (A1 a1, A2 a2, A3 a3)                     ///< add object of type TY, using 3-arg ctor
         {
           __ensureSufficientCapacity();
           TY& newElm = elements_[level_].template create(a1,a2,a3);
@@ -365,7 +325,7 @@ namespace lib {
               , typename A4
               >
       TY&                                                  //_________________________________________
-      appendNew (A1& a1, A2& a2, A3& a3, A4& a4)          ///< add object of type TY, using 4-arg ctor
+      appendNew (A1 a1, A2 a2, A3 a3, A4 a4)              ///< add object of type TY, using 4-arg ctor
         {
           __ensureSufficientCapacity();
           TY& newElm = elements_[level_].template create(a1,a2,a3,a4);
@@ -382,7 +342,7 @@ namespace lib {
               , typename A5
               >
       TY&                                                  //_________________________________________
-      appendNew (A1& a1, A2& a2, A3& a3, A4& a4, A5& a5)  ///< add object of type TY, using 5-arg ctor
+      appendNew (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)       ///< add object of type TY, using 5-arg ctor
         {
           __ensureSufficientCapacity();
           TY& newElm = elements_[level_].template create(a1,a2,a3,a4,a5);
@@ -391,6 +351,7 @@ namespace lib {
         }
       
       
+      
       /* === Element access and iteration === */
       
       I&
@@ -403,32 +364,23 @@ namespace lib {
                              , LUMIERA_ERROR_INDEX_BOUNDS);
         }
       
+      
+      
       typedef IterType      iterator;
       typedef ConstIterType const_iterator;
       
-      iterator       begin ()       { return iterator       (this, _access_begin()); }
-      const_iterator begin () const { return const_iterator (this, _access_begin()); }
-      iterator       end ()         { return iterator();       }
-      const_iterator end ()   const { return const_iterator(); }
+      iterator       begin()       { return iterator       (this, _access_begin()); }
+      const_iterator begin() const { return const_iterator (this, _access_begin()); }
+      iterator       end ()        { return iterator();       }
+      const_iterator end ()  const { return const_iterator(); }
       
       
-      
-      
-      /* ====== proxied vector functions ==================== */
-      
-      size_t  size ()      const  { return level_;    }
-//    size_type  max_size ()  const  { return _Vec::max_size(); }
-      size_t  capacity ()  const  { return capacity_; }
-      bool    empty ()     const  { return 0 == level_; }
+      size_t  size ()        const { return level_;      }
+      size_t  capacity ()    const { return capacity_;   }
+      bool    empty ()       const { return 0 == level_; }
       
       
     private:
-//    /** @internal element access, including range and null check */
-//    T*
-//    get (size_type i)
-//      {
-//        UNIMPLEMENTED("raw element access");
-//      }
       void
       __ensureSufficientCapacity()
         {
@@ -437,6 +389,45 @@ namespace lib {
                                , LUMIERA_ERROR_CAPACITY);
         }
       
+      
+      /* ==== internal callback API for the iterator ==== */
+      
+      /** Iteration-logic: switch to next position
+       * @note assuming here that the start address of the embedded object
+       *       coincides with the start of an array element (ElementHolder)
+       */
+      friend void
+      iterNext (const ScopedCollection*, I* & pos)
+      {
+        ElementHolder* & storageLocation = reinterpret_cast (pos);
+        ++storageLocation;
+      }
+      
+      friend void
+      iterNext (const ScopedCollection*, const I* & pos)
+      {
+        const ElementHolder* & storageLocation = reinterpret_cast (pos);
+        ++storageLocation;
+      }
+      
+      /** Iteration-logic: detect iteration end. */
+      template
+      friend bool
+      hasNext (const ScopedCollection* src, POS & pos)
+      {
+        REQUIRE (src);
+        if ((pos) && (pos < src->_access_end()))
+          return true;
+        else
+          {
+            pos = 0;
+            return false;
+      }   }
+      
+      
+      I* _access_begin() const { return & elements_[0].accessObj(); }
+      I* _access_end()   const { return & elements_[level_].accessObj(); }
+      
     };
   
   
diff --git a/tests/lib/scoped-collection-test.cpp b/tests/lib/scoped-collection-test.cpp
index c79f74e89..f4ea3db91 100644
--- a/tests/lib/scoped-collection-test.cpp
+++ b/tests/lib/scoped-collection-test.cpp
@@ -252,7 +252,6 @@ namespace test{
         {
           CHECK (0 == Dummy::checksum());
           {
-#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
               
             int rr = rand() % 100;
             
@@ -260,43 +259,43 @@ namespace test{
             CHECK (0 == coll.size());
             CHECK (0 == Dummy::checksum());
 
-            Dummy& d0 = coll.appendNew();
+            Dummy& d0 = coll.appendNewElement();
             CHECK (1 == coll.size());
             
-            Dummy& d1 = coll.appendNew (r1);
+            Dummy& d1 = coll.appendNew (rr);
             CHECK (2 == coll.size());
 
             int sum = Dummy::checksum();
 
             // trigger the bomb
-            VERIFY_ERROR (SUBVERSIVE, coll.appendNew(r1,r1) );
+            VERIFY_ERROR (SUBVERSIVE, coll.appendNew(rr,rr) );
             
             CHECK (  2 == coll.size()); // the other objects survived
             CHECK (sum == Dummy::checksum());
             
-            Dummy& d2 = coll.appendNew (r1, r1+1);
+            Dummy& d2 = coll.appendNew (rr, rr+1);
             CHECK (3 == coll.size());
             
-            CHECK (sum + r1 == Dummy::checksum());
+            CHECK (sum + rr == Dummy::checksum());
             
-            VERIFY_ERROR (CAPACITY, coll.appendNew());
-            VERIFY_ERROR (CAPACITY, coll.appendNew());
-            VERIFY_ERROR (CAPACITY, coll.appendNew());
+            VERIFY_ERROR (CAPACITY, coll.appendNewElement());
+            VERIFY_ERROR (CAPACITY, coll.appendNewElement());
+            VERIFY_ERROR (CAPACITY, coll.appendNewElement());
             
             CHECK (3 == coll.size());
-            CHECK (sum + r1 == Dummy::checksum());
+            CHECK (sum + rr == Dummy::checksum());
             
             
             CHECK (d0.acc(11) == coll[0].getVal() + 11 );
-            CHECK (d1.acc(22) == r1 + 22);
-            CHECK (d2.acc(33) == r1 + 33);
-            CHECK (d2.acc(0)  == r1 + (r1+1) );     // SubDummy's special implementation of the acc()-function
+            CHECK (d1.acc(22) == rr + 22);
+            CHECK (d2.acc(33) == rr + 33);
+            CHECK (d2.acc(0)  == rr + (rr+1) );     // SubDummy's special implementation of the acc()-function
                                                    //  returns the trigger value, when the argument is zero
             
             coll.clear();
             coll.appendNew (11,22);
             
-            CHECK (3 == coll.size());
+            CHECK ( 1 == coll.size());
             CHECK (11 == Dummy::checksum());
             
             // NOTE DANGEROUS:
@@ -305,9 +304,8 @@ namespace test{
             CHECK (d0.acc(0) == 11 + 22);
             
             // The others even point into obsoleted storage holding zombie objects
-            CHECK (d1.acc(44) == r1 + 44);
+            CHECK (d1.acc(44) == rr + 44);
             
-#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
           }
           CHECK (0 == Dummy::checksum());
         }

From 72e8d224540cdb9e2a602a46c1a88b0a95e9c822 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Thu, 5 Jan 2012 03:40:04 +0100
Subject: [PATCH 54/87] implement the RAII-style collection ctor. test pass

---
 src/lib/scoped-collection.hpp        |  54 +++++++-------
 tests/lib/scoped-collection-test.cpp | 102 +++++++++++++++++----------
 2 files changed, 93 insertions(+), 63 deletions(-)

diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
index d240a39ee..52f272c06 100644
--- a/src/lib/scoped-collection.hpp
+++ b/src/lib/scoped-collection.hpp
@@ -64,7 +64,7 @@ namespace lib {
   
   /**
    * A fixed collection of noncopyable polymorphic objects.
-
+   * 
    * All child objects reside in a common chunk of storage
    * and are owned and managed by this collection holder.
    * Array style access and iteration.
@@ -77,6 +77,7 @@ namespace lib {
     : boost::noncopyable
     {
       
+    public:
       /** 
        * Storage Frame to hold one Child object.
        * The storage will be an heap allocated
@@ -103,11 +104,6 @@ namespace lib {
               accessObj().~I();
             }
           
-          I&
-          operator* ()  const
-            {
-              return accessObj();
-            }
           
           
           
@@ -186,21 +182,8 @@ namespace lib {
       
       
       
-      /* ==== Storage: heap allocated array of element buffers ==== */
-      
-      typedef boost::scoped_array ElementStorage;
-      
-      size_t level_;
-      size_t capacity_;
-      ElementStorage elements_;
       
       
-      typedef IterAdapter<      I *, const ScopedCollection *> IterType;
-      typedef IterAdapter ConstIterType;
-      
-      
-      
-    public:
       
      ~ScopedCollection ()
         { 
@@ -219,10 +202,19 @@ namespace lib {
         : level_(0)
         , capacity_(maxElements)
         , elements_(new ElementHolder[maxElements])
-        { 
-          UNIMPLEMENTED ("use the builder to populate the elements right away");
-        }
-      
+        {
+        try { 
+          while (level_ < capacity_)
+            {
+              ElementHolder& storageFrame (elements_[level_]);
+              builder (storageFrame);
+              ++level_;
+            }}
+        catch(...)
+          {
+            clear();
+            throw;
+        } }   
       
       
       void
@@ -366,8 +358,9 @@ namespace lib {
       
       
       
-      typedef IterType      iterator;
-      typedef ConstIterType const_iterator;
+      typedef IterAdapter<      I *, const ScopedCollection *> iterator;
+      typedef IterAdapter const_iterator;
+      
       
       iterator       begin()       { return iterator       (this, _access_begin()); }
       const_iterator begin() const { return const_iterator (this, _access_begin()); }
@@ -380,7 +373,18 @@ namespace lib {
       bool    empty ()       const { return 0 == level_; }
       
       
+      
     private:
+      /* ==== Storage: heap allocated array of element buffers ==== */
+      
+      typedef boost::scoped_array ElementStorage;
+      
+      size_t level_;
+      size_t capacity_;
+      ElementStorage elements_;
+      
+      
+      
       void
       __ensureSufficientCapacity()
         {
diff --git a/tests/lib/scoped-collection-test.cpp b/tests/lib/scoped-collection-test.cpp
index f4ea3db91..acfdf99e0 100644
--- a/tests/lib/scoped-collection-test.cpp
+++ b/tests/lib/scoped-collection-test.cpp
@@ -75,7 +75,6 @@ namespace test{
   
   
   using util::isnil;
-//using std::tr1::placeholders::_1;                     /////////////////////////////TODO
   using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST;
   
   typedef ScopedCollection CollD;
@@ -115,7 +114,7 @@ namespace test{
             CHECK (!isnil (container));
             CHECK (5 == container.size());
             CHECK (0 != Dummy::checksum());
-
+            
             container.clear();
             CHECK (isnil (container));
             CHECK (0 == container.size());
@@ -179,46 +178,64 @@ namespace test{
           }
           CHECK (0 == Dummy::checksum());
         }
+        
+        
+        /** Functor to populate the Collection */
+        class Populator
+          {
+            uint i_;
+            int off_;
+            int trigg_;
+            
+          public:
+            Populator (int baseOffset, int triggerCode)
+              : i_(0)
+              , off_(baseOffset)
+              , trigg_(triggerCode)
+              { }
+            
+            void
+            operator() (CollD::ElementHolder& storage)
+              {
+                switch (i_ % 2) 
+                  {
+                  case 0:
+                    storage.create (i_+off_);
+                    break;
+                    
+                  case 1:
+                    storage.create (i_+off_, trigg_);
+                    break;
+                  }
+                ++i_;
+              }
+          };
       
-      
+      /** @test using the ScopedCollection according to the RAII pattern.
+       * For this usage style, the collection is filled right away, during
+       * construction. If anything goes wrong, the whole collection is
+       * cleared and invalidated. Consequently there is no tangible "lifecycle"
+       * at the usage site. Either the collection is fully usable, or not at all.
+       * This requires the client to provide a functor (callback) to define
+       * the actual objects to be created within the ScopedCollection. These
+       * may as well be subclasses of the base type I, provided the general
+       * element storage size #siz was chosen sufficiently large to hold
+       * those subclass instances.
+       * 
+       * This test demonstrates the most elaborate usage pattern, where
+       * the client provides a full blown functor object, which even
+       * has embedded state. But, generally speaking, anything
+       * exposing a suitable function call operator is acceptable.
+       */
       void
       building_RAII_Style()
         {
           CHECK (0 == Dummy::checksum());
           {
-#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
-                        /** Functor to populate the Collection */
-                        class Populator
-                          {
-                            uint i_;
-                            int off_;
-                            
-                          public:
-                            Populator (int baseOffset)
-                              : i_(0)
-                              , off_(baseOffset)
-                              { }
-                            
-                            void
-                            operator() (int specialOffset, void* storage)
-                              {
-                                switch (i_ % 2) 
-                                  {
-                                  case 0:
-                                    new(storage) Dummy(i_+off_);
-                                    break;
-                                    
-                                  case 1:
-                                    new(storage) SubDummy(i_+off_, specialOffset);
-                                    break;
-                              }   }
-                          };
-            
-            
             int rr = rand() % 100;
             int trigger = 101;
             
-            CollD coll (6, Populator(rr), trigger, _1 );
+            CollD coll (6, Populator(rr, trigger));
             
             CHECK (!isnil (coll));
             CHECK (6 == coll.size());
@@ -237,16 +254,25 @@ namespace test{
             // Verify Error handling while in creation:
             // SubDummy explodes on equal ctor parameters
             // which here happens for i==7
-            VERIFY_ERROR (SUBVERSIVE, CollD(10, Populator(0), 7, _1 ) );
+            VERIFY_ERROR (SUBVERSIVE, CollD(10, Populator(0, 7)) );
             
             // any already created object was properly destroyed
             CHECK (0 == Dummy::checksum());
-#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #877
+            
           }
           CHECK (0 == Dummy::checksum());
         }
       
       
+      /** @test using the ScopedCollection to hold a variable
+       * and possibly increasing number of elements, within the
+       * fixed limits of the maximum capacity defined by the
+       * ctor parameter. Any new elements will be created
+       * behind the already existing objects. In case
+       * of failure while creating an element, only
+       * this element gets destroyed, the rest of
+       * the container remains intact.
+       */
       void
       building_StackStyle()
         {
@@ -258,15 +284,15 @@ namespace test{
             CollD coll(3);
             CHECK (0 == coll.size());
             CHECK (0 == Dummy::checksum());
-
+            
             Dummy& d0 = coll.appendNewElement();
             CHECK (1 == coll.size());
             
             Dummy& d1 = coll.appendNew (rr);
             CHECK (2 == coll.size());
-
+            
             int sum = Dummy::checksum();
-
+            
             // trigger the bomb
             VERIFY_ERROR (SUBVERSIVE, coll.appendNew(rr,rr) );
             

From e5c42e05e6748902dd1308b9ad9048fafca3aa3f Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Thu, 5 Jan 2012 23:17:16 +0100
Subject: [PATCH 55/87] finish ScopedCollection (closes #877)

---
 src/lib/scoped-collection.hpp        | 131 +++++++++++++-
 tests/40components.tests             |   2 +-
 tests/lib/scoped-collection-test.cpp | 250 ++++++++++++++++++---------
 3 files changed, 294 insertions(+), 89 deletions(-)

diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
index 52f272c06..f3a1e313f 100644
--- a/src/lib/scoped-collection.hpp
+++ b/src/lib/scoped-collection.hpp
@@ -29,8 +29,35 @@
  ** The storage holding all those child objects is allocated in one chunk
  ** and never adjusted.
  ** 
- ** - TODO: retro-fit with RefArray interface
+ ** \par usage patterns
+ ** The common ground for all usage of this container is to hold and some
+ ** with exclusive ownership; when the enclosing container goes out of scope,
+ ** all the dtors of the embedded objects will be invoked. Frequently this
+ ** side effect is the reason for using the container: we want to own some
+ ** resource handles to be available exactly as long as the managing object
+ ** needs and accesses them.
  ** 
+ ** There are two different usage patterns for populating a ScopedCollection
+ ** - the "stack style" usage creates an empty container (using the one arg
+ **   ctor just to specify the maximum size). The storage to hold up to this
+ **   number of objects is (heap) allocated right away, but no objects are
+ **   created. Later on, individual objects are "pushed" into the collection
+ **   by invoking #appendNewElement() to create a new element of the default
+ **   type I) or #appendNew(args) to create some subtype. This way,
+ **   the container is being filled successively.
+ ** - the "RAII style" usage strives to create all of the content objects
+ **   right away, immediately after the memory allocation. This usage pattern
+ **   avoids any kind of "lifecylce state". Either the container comes up sane
+ **   and fully populated, or the ctor call fails and any already created
+ **   objects are discarded.
+ ** @note intentionally there is no operation to discard individual objects,
+ **       all you can do is to #clear() the whole container.
+ ** @note the container can hold instances of a subclass of the type defined
+ **       by the template parameter I. But you need to ensure in this case
+ **       that the defined buffer size for each element (2nt template parameter)
+ **       is sufficient to hold any of these subclass instances. This condition
+ **       is protected by a static assertion (compilation failure). 
+ ** @warning when using subclasses, a virtual dtor is mandatory
  ** @warning deliberately \em not threadsafe
  ** 
  ** @see ScopedCollection_test
@@ -52,6 +79,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 
 namespace lib {
@@ -87,7 +116,7 @@ namespace lib {
       class ElementHolder
         : boost::noncopyable
         {
-      
+          
           mutable char buf_[siz];
           
         public:
@@ -107,9 +136,13 @@ namespace lib {
           
           
           
-          /** Abbreviation for placement new */ 
+#define TYPE_SANITY_CHECK \
+              BOOST_STATIC_ASSERT ((boost::is_base_of::value || boost::is_same::value))
+          
+          
+          /** Abbreviation for placement new */
 #define EMBEDDED_ELEMENT_CTOR(_CTOR_CALL_)    \
-              BOOST_STATIC_ASSERT (siz >= sizeof(TY));\
+              TYPE_SANITY_CHECK;               \
               return *new(&buf_) _CTOR_CALL_;   \
           
           
@@ -178,6 +211,7 @@ namespace lib {
               EMBEDDED_ELEMENT_CTOR ( TY(a1,a2,a3,a4,a5) )
             }
 #undef EMBEDDED_ELEMENT_CTOR
+#undef TYPE_SANITY_CHECK
         };
       
       
@@ -197,6 +231,13 @@ namespace lib {
         , elements_(new ElementHolder[maxElements])
         { }
       
+      /** creating a ScopedCollection in RAII-style:
+       *  The embedded elements will be created immediately.
+       *  Ctor fails in case of any error during element creation.
+       * @param builder functor to be invoked for each "slot".
+       *        It gets an ElementHolder& as parameter, and should
+       *        use this to create an object of some I-subclass
+       */
       template
       ScopedCollection (size_t maxElements, CTOR builder)
         : level_(0)
@@ -216,6 +257,22 @@ namespace lib {
             throw;
         } }   
       
+      /* == some pre-defined Builders == */
+      
+      class FillAll;           ///< fills the ScopedCollection with default constructed I-instances
+      
+      template
+      class FillWith;          ///< fills the ScopedCollection with default constructed TY-instances
+      
+      template
+      class PullFrom;          ///< fills by copy-constructing values pulled from the iterator IT
+      
+      template
+      static PullFrom
+      pull (IT iter)           ///< convenience shortcut to pull from any given Lumiera Forward Iterator
+        {
+          return PullFrom (iter);
+        }
       
       void
       clear()
@@ -437,5 +494,71 @@ namespace lib {
   
   
   
+  /* === Supplement: pre-defined element builders === */
+  
+  /** \par usage
+   * Pass an instance of this builder functor as 2nd parameter
+   * to ScopedCollections's ctor. (an anonymous instance is OK).
+   * Using this variant of the compiler switches the collection to RAII-style:
+   * It will immediately try to create all the embedded objects, invoking this
+   * builder functor for each "slot" to hold such an embedded object. Actually,
+   * this "slot" is an ElementHolder instance, which provides functions for
+   * placement-creating objects into this embedded buffer.
+   */
+  template
+  class ScopedCollection::FillAll
+    {
+    public:
+      void
+      operator() (typename ScopedCollection::ElementHolder& storage)
+        {
+          storage.template create();
+        }
+    };
+  
+  template
+  template
+  class ScopedCollection::FillWith
+    {
+    public:
+      void
+      operator() (typename ScopedCollection::ElementHolder& storage)
+        {
+          storage.template create();
+        }
+    };
+  
+  /** \par usage
+   * This variant allows to "pull" elements from an iterator.
+   * Actually, the collection will try to create each element right away,
+   * by invoking the copy ctor and passing the value yielded by the iterator.
+   * @note anything in accordance to the Lumera Forward Iterator pattern is OK.
+   *       This rules out just passing a plain STL iterator (because these can't
+   *       tell for themselves when they're exhausted). Use an suitable iter-adapter
+   *       instead, e.g. by invoking lib::iter_stl::eachElm(stl_container) 
+   */
+  template
+  template
+  class ScopedCollection::PullFrom
+    {
+      IT iter_;
+      
+      typedef typename iter::TypeBinding::value_type ElementType;
+      
+    public:
+      PullFrom (IT source)
+        : iter_(source)
+        { }
+      
+      void
+      operator() (typename ScopedCollection::ElementHolder& storage)
+        {
+          storage.template create (*iter_);
+          ++iter_;
+        }
+    };
+  
+  
+  
 } // namespace lib
 #endif
diff --git a/tests/40components.tests b/tests/40components.tests
index d22d69d07..b1a93d5d1 100644
--- a/tests/40components.tests
+++ b/tests/40components.tests
@@ -617,7 +617,7 @@ out: ^\.throw some exceptions...
 END
 
 
-PLANNED "Managed Collection (I)" ScopedCollection_test < (i_+off_);
-                    break;
-                    
-                  case 1:
-                    storage.create (i_+off_, trigg_);
-                    break;
-                  }
-                ++i_;
-              }
-          };
-      
-      /** @test using the ScopedCollection according to the RAII pattern.
-       * For this usage style, the collection is filled right away, during
-       * construction. If anything goes wrong, the whole collection is
-       * cleared and invalidated. Consequently there is no tangible "lifecycle"
-       * at the usage site. Either the collection is fully usable, or not at all.
-       * This requires the client to provide a functor (callback) to define
-       * the actual objects to be created within the ScopedCollection. These
-       * may as well be subclasses of the base type I, provided the general
-       * element storage size #siz was chosen sufficiently large to hold
-       * those subclass instances.
-       * 
-       * This test demonstrates the most elaborate usage pattern, where
-       * the client provides a full blown functor object, which even
-       * has embedded state. But, generally speaking, anything
-       * exposing a suitable function call operator is acceptable.
-       */
-      void
-      building_RAII_Style()
-        {
-          CHECK (0 == Dummy::checksum());
-          {
-            int rr = rand() % 100;
-            int trigger = 101;
-            
-            CollD coll (6, Populator(rr, trigger));
-            
-            CHECK (!isnil (coll));
-            CHECK (6 == coll.size());
-            CHECK (0 != Dummy::checksum());
-            
-            CHECK (coll[0].acc(0) == 0 + rr);
-            CHECK (coll[1].acc(0) == 1 + rr + trigger);
-            CHECK (coll[2].acc(0) == 2 + rr);
-            CHECK (coll[3].acc(0) == 3 + rr + trigger);
-            CHECK (coll[4].acc(0) == 4 + rr);
-            CHECK (coll[5].acc(0) == 5 + rr + trigger);
-            
-            coll.clear();
-            CHECK (0 == Dummy::checksum());
-            
-            // Verify Error handling while in creation:
-            // SubDummy explodes on equal ctor parameters
-            // which here happens for i==7
-            VERIFY_ERROR (SUBVERSIVE, CollD(10, Populator(0, 7)) );
-            
-            // any already created object was properly destroyed
-            CHECK (0 == Dummy::checksum());
-            
-          }
-          CHECK (0 == Dummy::checksum());
-        }
       
       
       /** @test using the ScopedCollection to hold a variable
@@ -335,9 +265,161 @@ namespace test{
           }
           CHECK (0 == Dummy::checksum());
         }
+        
+        
+      /** @test using the ScopedCollection according to the RAII pattern.
+       * For this usage style, the collection is filled right away, during
+       * construction. If anything goes wrong, the whole collection is
+       * cleared and invalidated. Consequently there is no tangible "lifecycle"
+       * at the usage site. Either the collection is fully usable, or not at all.
+       * This requires the client to provide a functor (callback) to define
+       * the actual objects to be created within the ScopedCollection. These
+       * may as well be subclasses of the base type I, provided the general
+       * element storage size #siz was chosen sufficiently large to hold
+       * those subclass instances.
+       * 
+       * This test demonstrates the most elaborate usage pattern, where
+       * the client provides a full blown functor object #Populator,
+       * which even has embedded state. Generally speaking, anything
+       * exposing a suitable function call operator is acceptable.
+       */
+      void
+      building_RAII_Style()
+        {
+          CHECK (0 == Dummy::checksum());
+          {
+            int rr = rand() % 100;
+            int trigger = 101;
+            
+            CollD coll (6, Populator(rr, trigger));
+            
+            CHECK (!isnil (coll));
+            CHECK (6 == coll.size());
+            CHECK (0 != Dummy::checksum());
+            
+            CHECK (coll[0].acc(0) == 0 + rr);
+            CHECK (coll[1].acc(0) == 1 + rr + trigger);
+            CHECK (coll[2].acc(0) == 2 + rr);
+            CHECK (coll[3].acc(0) == 3 + rr + trigger);
+            CHECK (coll[4].acc(0) == 4 + rr);
+            CHECK (coll[5].acc(0) == 5 + rr + trigger);
+            
+            coll.clear();
+            CHECK (0 == Dummy::checksum());
+            
+            // Verify Error handling while in creation:
+            // SubDummy explodes on equal ctor parameters
+            // which here happens for i==7
+            VERIFY_ERROR (SUBVERSIVE, CollD(10, Populator(0, 7)) );
+            
+            // any already created object was properly destroyed
+            CHECK (0 == Dummy::checksum());
+            
+          }
+          CHECK (0 == Dummy::checksum());
+        }
+      
+      /** Functor to populate the Collection */
+      class Populator
+        {
+          uint i_;
+          int off_;
+          int trigg_;
+          
+        public:
+          Populator (int baseOffset, int triggerCode)
+            : i_(0)
+            , off_(baseOffset)
+            , trigg_(triggerCode)
+            { }
+          
+          void
+          operator() (CollD::ElementHolder& storage)
+            {
+              switch (i_ % 2) 
+                {
+                case 0:
+                  storage.create (i_+off_);
+                  break;
+                  
+                case 1:
+                  storage.create (i_+off_, trigg_);
+                  break;
+                }
+              ++i_;
+            }
+        };
+      
+      
+      
+      /** @test for using ScopedCollection in RAII style,
+       * several pre-defined "populators" are provided.
+       * The most obvious one being just to fill the
+       * collection with default constructed objects.
+       */
+      void
+      verify_defaultPopulator()
+        {
+          CHECK (0 == Dummy::checksum());
+          
+          CollD coll (25, CollD::FillAll() );
+          
+          CHECK (!isnil (coll));
+          CHECK (25 == coll.size());
+          CHECK (0 != Dummy::checksum());
+          
+          for (CollD::iterator ii = coll.begin(); ii; ++ii)
+            {
+              CHECK ( INSTANCEOF (Dummy,    & (*ii)));
+              CHECK (!INSTANCEOF (SubDummy, & (*ii)));
+            }
+        }
+      
+      
+      void
+      verify_subclassPopulator()
+        {
+          CHECK (0 == Dummy::checksum());
+          
+          CollD coll (25, CollD::FillWith() );
+          
+          CHECK (!isnil (coll));
+          CHECK (25 == coll.size());
+          CHECK (0 != Dummy::checksum());
+          
+          for (CollD::iterator ii = coll.begin(); ii; ++ii)
+            CHECK (INSTANCEOF (SubDummy, & (*ii)));
+        }
+      
+      
+      void
+      verify_iteratorPopulator()
+        {
+          typedef ScopedCollection CollI;
+          
+          CollI source (25);
+          for (uint i=0; i < source.capacity(); ++i)
+            source.appendNew(i);           // holding the numbers 0..24
+          
+          CollI coll (20, CollI::pull(source.begin()));
+                                              // this immediately pulls in the first 20 elements 
+          CHECK (!isnil (coll));
+          CHECK (20 == coll.size());
+          CHECK (25 == source.size());
+          
+          for (uint i=0; i < coll.size(); ++i)
+            {
+              CHECK (coll[i] == i        );
+              CHECK (coll[i] == source[i]);
+            }
+          
+          // note: the iterator is assumed to deliver a sufficient amount of elements
+          VERIFY_ERROR (ITER_EXHAUST, CollI (50, CollI::pull (source.begin())));
+        }
     };
   
   
+  
   LAUNCHER (ScopedCollection_test, "unit common");
   
   

From e41065101a76d77c5f19a3ce07ac7b135bfec11e Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 6 Jan 2012 03:16:22 +0100
Subject: [PATCH 56/87] switch OutputSlot to use the ScopedCollection

..hehe, makes the code way more sane
---
 src/lib/scoped-collection.hpp                 |   2 +-
 src/proc/asset/meta/time-grid.cpp             |   2 +
 src/proc/play/output-slot-connection.hpp      |  44 +++++---
 .../proc/play/diagnostic-output-slot.hpp      | 101 ++++++++++++------
 4 files changed, 102 insertions(+), 47 deletions(-)

diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
index f3a1e313f..b9174401b 100644
--- a/src/lib/scoped-collection.hpp
+++ b/src/lib/scoped-collection.hpp
@@ -404,7 +404,7 @@ namespace lib {
       /* === Element access and iteration === */
       
       I&
-      operator[] (size_t index)
+      operator[] (size_t index)  const
         {
           if (index < level_)
             return elements_[index].accessObj();
diff --git a/src/proc/asset/meta/time-grid.cpp b/src/proc/asset/meta/time-grid.cpp
index c46509787..89744eee0 100644
--- a/src/proc/asset/meta/time-grid.cpp
+++ b/src/proc/asset/meta/time-grid.cpp
@@ -75,6 +75,8 @@ namespace meta {
      * from the AssetManager, then attach a further
      * smart-ptr-to-Quantiser to that, which then can be
      * published via the \link advice.hpp "advice system"\endlink
+     * @note this allows to use a time grid just "by name",
+     *       without explicit dependance to the Session / Assets
      */
     inline PGrid
     publishWrapped (TimeGrid& newGrid)
diff --git a/src/proc/play/output-slot-connection.hpp b/src/proc/play/output-slot-connection.hpp
index 29e6bf8e4..71a830c7e 100644
--- a/src/proc/play/output-slot-connection.hpp
+++ b/src/proc/play/output-slot-connection.hpp
@@ -41,17 +41,19 @@
 
 #include "lib/error.hpp"
 #include "proc/play/output-slot.hpp"
+#include "lib/scoped-collection.hpp"
+#include "lib/iter-adapter-stl.hpp"
+#include "lib/iter-source.hpp"
 #include "lib/handle.hpp"
 //#include "lib/time/timevalue.hpp"
 //#include "proc/engine/buffer-provider.hpp"
 //#include "proc/play/timings.hpp"
-#include "lib/iter-source.hpp"
-#include "lib/iter-adapter-stl.hpp"
 //#include "lib/sync.hpp"
 
 #include 
 #include 
 //#include 
+#include 
 #include 
 //#include 
 
@@ -65,7 +67,9 @@ namespace play {
 //using std::string;
   using lib::transform;
   using lib::iter_stl::eachElm;
-
+  
+  using std::tr1::placeholders::_1;
+  using std::tr1::bind;
   using std::vector;
 //using std::tr1::shared_ptr;
   using boost::scoped_ptr;
@@ -92,6 +96,7 @@ namespace play {
    *   implementation; yet it may as well be called from a separate
    *   service thread or some kind of callback.
    * @note the meaning of FrameID is implementation defined.
+   * @note typically the concrete connection is noncopyable
    */
   class OutputSlot::Connection
     {
@@ -121,6 +126,8 @@ namespace play {
     {
     public:
       virtual ~ConnectionState() { }
+      
+      virtual Connection& access (uint)  const    =0;
     };
   
   
@@ -143,11 +150,12 @@ namespace play {
   template
   class ConnectionStateManager
     : public OutputSlot::ConnectionState
-    , public vector
     {
-      typedef vector Connections;
+      typedef lib::ScopedCollection Connections;
       typedef OutputSlot::OpenedSinks OpenedSinks;
       
+      Connections connections_;
+      
       
       /* == Allocation Interface == */
       
@@ -155,7 +163,7 @@ namespace play {
       getOpenedSinks()
         {
           REQUIRE (this->isActive());
-          return transform (eachElm(*this), connectOutputSink);
+          return transform (eachElm(connections_), connectOutputSink);
         }
       
       Timings
@@ -167,25 +175,29 @@ namespace play {
       bool
       isActive()  const
         {
-          return 0 < Connections::size();
+          return 0 < connections_.size();
+        }
+      
+      CON&
+      access (uint chanNr)  const
+        {
+          return connections_[chanNr];
         }
       
       
     protected: /* == API for OutputSlot-Impl == */
       
+      typedef typename Connections::ElementHolder& ConnectionStorage;
+      
       /** factory function to build the actual
        *  connection handling objects per channel */
-      virtual CON buildConnection()  =0;
-      
-      void
-      init (uint numChannels)
-        {
-          for (uint i=0; i query4grid(gridID) ;
+      PGrid testGrid25 = query4grid.getAdvice();
+      
+      if (!testGrid25)
+        testGrid25 = TimeGrid::build (gridID, FrameRate::PAL);
+      
+      ENSURE (testGrid25);
+      return testGrid25;
+    }
+  }
+  
+  
   /** 
    * Diagnostic output connection for a single channel,
    * allowing to track generated frames and verify 
@@ -77,17 +99,20 @@ namespace play {
    */
   class TrackingInMemoryBlockSequence
     : public OutputSlot::Connection
+    , boost::noncopyable
     {
       
       typedef std::tr1::unordered_set FrameTrackingInfo;
       
       
-      shared_ptr buffProvider_;
+      TrackingHeapBlockProvider buffProvider_;
       BufferDescriptor bufferType_;
       
       FrameTrackingInfo frameTrackingIndex_;
       PGrid frameGrid_;
       
+      bool closed_;
+      
       
       BuffHandle
       trackFrame (FrameID frameNr, BuffHandle const& newBuffer)
@@ -115,8 +140,9 @@ namespace play {
       BuffHandle
       claimBufferFor(FrameID frameNr) 
         {
+          REQUIRE (!closed_);
           return trackFrame (frameNr,
-                             buffProvider_->lockBuffer (bufferType_));
+                             buffProvider_.lockBuffer (bufferType_));
         }
       
       
@@ -132,34 +158,38 @@ namespace play {
       void
       transfer (BuffHandle const& filledBuffer)
         {
+          REQUIRE (!closed_);
           pushout (filledBuffer);
         }
       
       void
       pushout (BuffHandle const& data4output)
         {
-          buffProvider_->emitBuffer   (data4output);
-          buffProvider_->releaseBuffer(data4output);
+          REQUIRE (!closed_);
+          buffProvider_.emitBuffer   (data4output);
+          buffProvider_.releaseBuffer(data4output);
         }
       
       void
       discard (BuffHandle const& superseededData)
         {
-          buffProvider_->releaseBuffer (superseededData);
+          REQUIRE (!closed_);
+          buffProvider_.releaseBuffer (superseededData);
         }
       
       void
       shutDown ()
         {
-          buffProvider_.reset();
+          closed_ = true;
         }
       
     public:
       TrackingInMemoryBlockSequence()
-        : buffProvider_(new TrackingHeapBlockProvider())
-        , bufferType_(buffProvider_->getDescriptor())
+        : buffProvider_()
+        , bufferType_(buffProvider_.getDescriptor())
         , frameTrackingIndex_()
-        , frameGrid_(TimeGrid::build ("DiagnosticOutputSlot-buffer-grid", FrameRate::PAL))  /////////////TODO should rather pass that in as part of a "timings" definition
+        , frameGrid_(getTestTimeGrid())                              /////////////TODO should rather pass that in as part of a "timings" definition
+        , closed_(false)
         {
           INFO (engine_dbg, "building in-memory diagnostic output sequence");
         }
@@ -173,22 +203,20 @@ namespace play {
       
       /* === Diagnostic API === */
       
-      TestFrame*
+      TestFrame const *
       accessEmittedFrame (uint frameNr)  const
         {
-          REQUIRE (buffProvider_);
-          if (frameNr <= buffProvider_->emittedCnt())
-            return &buffProvider_->accessAs (frameNr);
+          if (frameNr <= buffProvider_.emittedCnt())
+            return & accessFrame(frameNr);
           else
             return 0;                                               ////////////////////////////////TICKET #856
         }
       
-      diagn::Block*
+      diagn::Block const *
       accessEmittedBuffer (uint bufferNr)  const
         {
-          REQUIRE (buffProvider_);
-          if (bufferNr <= buffProvider_->emittedCnt())
-            return & buffProvider_->access_emitted (bufferNr);
+          if (bufferNr <= buffProvider_.emittedCnt())
+            return & accessBlock(bufferNr);
           else
             return 0;
         }
@@ -196,9 +224,21 @@ namespace play {
       bool
       wasAllocated (uint frameNr)  const
         {
-          REQUIRE (buffProvider_);
           return contains (frameTrackingIndex_, frameNr);
         }
+      
+    private:
+      TestFrame const&
+      accessFrame (uint frameNr)  const
+        {
+          return unConst(this)->buffProvider_.accessAs (frameNr);
+        }
+      
+      diagn::Block const&
+      accessBlock (uint bufferNr)  const
+        {
+          return unConst(this)->buffProvider_.access_emitted (bufferNr);
+        }
     };
   
   
@@ -210,17 +250,18 @@ namespace play {
   class SimulatedOutputSequences
     : public ConnectionStateManager
     {
-      TrackingInMemoryBlockSequence
-      buildConnection()
+      typedef ConnectionStateManager _Base;
+      
+      void
+      buildConnection(ConnectionStorage storage)
         {
-          return TrackingInMemoryBlockSequence();
+          storage.create();
         }
       
     public:
       SimulatedOutputSequences (uint numChannels)
-        {
-          init (numChannels);
-        }
+        : _Base(numChannels)
+        { }
     };
   
     
@@ -276,7 +317,7 @@ namespace play {
         {
           REQUIRE (!isFree(), "diagnostic OutputSlot not (yet) connected");
           REQUIRE (channel <= getOutputChannelCount());
-          return static_cast (*state_).at(channel);
+          return static_cast (state_->access (channel));
         }
       
       
@@ -307,7 +348,7 @@ namespace play {
        * the emitted Data as a sequence of TestFrame objects.
        */
       class OutputFramesLog
-        : public lib::IterSource
+        : public lib::IterSource
         , boost::noncopyable
         {
           TrackingInMemoryBlockSequence const& outSeq_;
@@ -366,8 +407,8 @@ namespace play {
       bool
       buffer_was_closed (uint channel, FrameID frame)
         {
-          diagn::Block* block = accessSequence(channel)
-                                  .accessEmittedBuffer(frame);
+          diagn::Block const *block = accessSequence(channel)
+                                        .accessEmittedBuffer(frame);
           return block
               && block->was_closed();
         }
@@ -376,8 +417,8 @@ namespace play {
       bool
       emitted (uint channel, FrameID frame)
         {
-          diagn::Block* block = accessSequence(channel)
-                                  .accessEmittedBuffer(frame);
+          diagn::Block const *block = accessSequence(channel)
+                                        .accessEmittedBuffer(frame);
           return block
               && block->was_used();
         }

From b64dff1ad89edc5ea4edf66af87c258ba33cabc7 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 00:02:03 +0100
Subject: [PATCH 57/87] spelling and comments

---
 src/lib/meta/function-closure.hpp            | 4 ++--
 tests/lib/meta/function-closure-test.cpp     | 2 +-
 tests/lib/meta/function-composition-test.cpp | 7 ++-----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/lib/meta/function-closure.hpp b/src/lib/meta/function-closure.hpp
index 207c139bd..4275a5cb6 100644
--- a/src/lib/meta/function-closure.hpp
+++ b/src/lib/meta/function-closure.hpp
@@ -796,8 +796,8 @@ namespace func{
   /*  ========== function-style interface =============  */
   
   /** build a TupleApplicator, which embodies the given
-   *  argument tuple and can be used to apply various
-   *  functions to them.
+   *  argument tuple and can be used to apply them
+   *  to various functions repeatedly.
    */
   template
   typename _Sig::Applicator
diff --git a/tests/lib/meta/function-closure-test.cpp b/tests/lib/meta/function-closure-test.cpp
index bc48c07bf..a3809bdb8 100644
--- a/tests/lib/meta/function-closure-test.cpp
+++ b/tests/lib/meta/function-closure-test.cpp
@@ -24,7 +24,7 @@
 /** @file function-closure-test.cpp
  ** Testing a combination of tr1::function objects and metaprogramming.
  ** Argument types will be extracted and represented as typelist, so they
- ** can be manipulated at compile time. This test uses some functions with
+ ** can be manipulated at compile time. This test uses some test functions
  ** and systematically applies or binds them to corresponding data tuples.
  ** Moreover, closure objects will be constructed in various flavours,
  ** combining a function object and a set of parameters.
diff --git a/tests/lib/meta/function-composition-test.cpp b/tests/lib/meta/function-composition-test.cpp
index 38bf82a16..45a50a047 100644
--- a/tests/lib/meta/function-composition-test.cpp
+++ b/tests/lib/meta/function-composition-test.cpp
@@ -127,7 +127,7 @@ namespace test {
   /******************************************************************************
    * @test this test covers some extensions and variations on function closures:
    *       - partial application of a function, returning a partial closure
-   *       - variation: binding a arbitrary term, might even be a nested binder
+   *       - variation: binding an arbitrary term, might even be a nested binder
    *       - chaining of two functions with suitable arguments ("composition")
    */
   class FunctionComposition_test : public Test
@@ -142,10 +142,7 @@ namespace test {
         }
       
       
-      /** verify the test input data
-       *  @see TypeListManipl_test#check_diagnostics()
-       *       for an explanation of the DISPLAY macro
-       */
+      /** verify the test input data */
       void
       check_diagnostics ()
         {

From c134026502394302e5a6e44257df64ee533631b8 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 02:53:07 +0100
Subject: [PATCH 58/87] for experimenting with -O3

---
 research/SConscript | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/research/SConscript b/research/SConscript
index 0fef0dae8..b82f1981f 100644
--- a/research/SConscript
+++ b/research/SConscript
@@ -9,9 +9,11 @@ Import('env','artifacts','core')
 support_lib = artifacts['support']
 
 
+envR = env.Clone()
+# envR.Append(CCFLAGS=' -O3 ')
 
 # build additional test and administrative tools....
-experiments = [ env.Program('try', ['try.cpp'] + support_lib)           #### to try out some feature...
+experiments = [ envR.Program('try', ['try.cpp'] + support_lib)          #### to try out some feature...
               ]
 
 #

From 00c08bd27b2a45e9a975b64395171011066809b5 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 03:11:02 +0100
Subject: [PATCH 59/87] fix helper functions not declared as inline

---
 src/lib/itertools.hpp             | 2 +-
 src/lib/meta/function-closure.hpp | 7 +++++++
 src/lib/meta/tuple.hpp            | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/lib/itertools.hpp b/src/lib/itertools.hpp
index 22a9e6c32..12b2286cb 100644
--- a/src/lib/itertools.hpp
+++ b/src/lib/itertools.hpp
@@ -543,7 +543,7 @@ namespace lib {
   /** filters away repeated values
    *  emitted by source iterator */
   template
-  FilterIter
+  inline FilterIter
   filterRepetitions (IT const& source)
   {
     typedef typename IT::value_type Val;
diff --git a/src/lib/meta/function-closure.hpp b/src/lib/meta/function-closure.hpp
index 4275a5cb6..572eb32fa 100644
--- a/src/lib/meta/function-closure.hpp
+++ b/src/lib/meta/function-closure.hpp
@@ -800,6 +800,7 @@ namespace func{
    *  to various functions repeatedly.
    */
   template
+  inline
   typename _Sig::Applicator
   tupleApplicator (Tuple& args)
   {
@@ -810,6 +811,7 @@ namespace func{
   
   /** apply the given function to the argument tuple */
   template
+  inline
   typename _Fun::Ret
   apply (SIG& f, Tuple& args)
   {
@@ -824,6 +826,7 @@ namespace func{
    *          invoked later to yield the
    *          function result. */
   template
+  inline
   typename _Clo::Type
   closure (SIG& f, Tuple& args)
   {
@@ -836,6 +839,7 @@ namespace func{
   
   /** close the given function over the first argument */
   template
+  inline
   typename _PapS::Function
   applyFirst (SIG& f, ARG arg)
   {
@@ -848,6 +852,7 @@ namespace func{
   
   /** close the given function over the last argument */
   template
+  inline
   typename _PapE::Function
   applyLast (SIG& f, ARG arg)
   {
@@ -862,6 +867,7 @@ namespace func{
   /** bind the last function argument to an arbitrary term,
    *  which especially might be a (nested) binder... */
   template
+  inline
   typename _PapE::Function
   bindLast (SIG& f, TERM const& arg)
   {
@@ -875,6 +881,7 @@ namespace func{
   
   /** build a functor chaining the given functions */
   template
+  inline
   typename _Chain::Function
   chained (SIG1& f1, SIG2& f2)
   {
diff --git a/src/lib/meta/tuple.hpp b/src/lib/meta/tuple.hpp
index 03c68384f..73e633f1b 100644
--- a/src/lib/meta/tuple.hpp
+++ b/src/lib/meta/tuple.hpp
@@ -283,6 +283,7 @@ namespace meta {
   namespace tuple { // some convenience access functions
   
     template 
+    inline
     typename Shifted::Head&
     element (TUP& tup)
     {

From 90e6dae2d58c1961cf43c1fc5e66836799de0121 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 03:11:51 +0100
Subject: [PATCH 60/87] add includes missing in some metaprogramming headers

types uint and string
---
 src/lib/meta/typelist-manip.hpp |  2 ++
 src/lib/meta/util.hpp           | 17 ++++++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/lib/meta/typelist-manip.hpp b/src/lib/meta/typelist-manip.hpp
index 22144e86f..536630e13 100644
--- a/src/lib/meta/typelist-manip.hpp
+++ b/src/lib/meta/typelist-manip.hpp
@@ -56,6 +56,8 @@
 
 #include "lib/meta/typelist.hpp"
 
+#include 
+
 namespace lib {
 namespace meta {
     
diff --git a/src/lib/meta/util.hpp b/src/lib/meta/util.hpp
index 67dacc400..63ae2aa47 100644
--- a/src/lib/meta/util.hpp
+++ b/src/lib/meta/util.hpp
@@ -37,18 +37,21 @@
 #ifndef LIB_META_UTIL_H
 #define LIB_META_UTIL_H
 
-  
+
+#include 
+
+
 namespace lib {
 namespace meta {
-    
-    
+  
+  
   /* types for figuring out the overload resolution chosen by the compiler */
-
+  
   typedef char Yes_t;
   struct No_t { char more_than_one[4]; };
-    
-    
-    
+  
+  
+  
   
   /** Compile-time Type equality:
    *  Simple Trait template to pick up types considered

From feff7537efa907a31fd7d9e6a2dc538c898bba8b Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 03:27:31 +0100
Subject: [PATCH 61/87] reduce memory requirements for this test

...it caused out of memory frequently.
---
 src/lib/diagnostic-context.hpp        |  4 ++++
 tests/40components.tests              |  2 +-
 tests/lib/diagnostic-context-test.cpp | 12 ++++++++----
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/lib/diagnostic-context.hpp b/src/lib/diagnostic-context.hpp
index 221f59fad..5d3167fee 100644
--- a/src/lib/diagnostic-context.hpp
+++ b/src/lib/diagnostic-context.hpp
@@ -124,6 +124,10 @@ namespace lib {
        *         on the thread-local diagnostic stack. Might
        *         be empty. Values start with frame next to
        *         the current scope and end with outermost.
+       * @warning can be inefficient on very large stacks
+       * @todo benchmark and improve the data structure
+       *       used for the snapshot. Vector is not
+       *       an optimal choice here.
        */
       static ValSequence
       extractStack()
diff --git a/tests/40components.tests b/tests/40components.tests
index b1a93d5d1..4f60cf263 100644
--- a/tests/40components.tests
+++ b/tests/40components.tests
@@ -679,7 +679,7 @@ return: 0
 END
 
 
-TEST "Thread-local diagnostic context" DiagrnsticContext_test  <
@@ -39,8 +39,9 @@ namespace test{
   
   namespace { // private test setup...
     
+                             /* WARNING: memory hungry */
     const uint NUM_THREADS = 40;
-    const uint MAX_RAND    = 1000*1000;
+    const uint MAX_RAND    = 100*1000;
     
     inline bool
     isOdd (uint val)
@@ -80,7 +81,7 @@ namespace test{
    * @see lib::ThreadLocal
    * @see backend::Thread
    */
-  class DiagrnsticContext_test : public Test
+  class DiagnosticContext_test : public Test
     {
       
       virtual void
@@ -147,6 +148,9 @@ namespace test{
        * take a snapshot of the full ContextStack and then unwind.
        * Thus the captured numbers must from a decreasing sequence
        * of odd values.
+       * @warning this test case causes memory pressure.
+       *          The reason seems to be the frequent re-allocations
+       *          of the vector used to take the snapshots 
        */
       void
       verify_heavilyParallelUsage()
@@ -206,7 +210,7 @@ namespace test{
   
   
   /** Register this test class... */
-  LAUNCHER (DiagrnsticContext_test, "function common");
+  LAUNCHER (DiagnosticContext_test, "function common");
   
   
   

From 9bba3667633b10a349792b12568b47ac1f8e0578 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 03:28:12 +0100
Subject: [PATCH 62/87] investigate partial application of member functions

---
 research/try.cpp                  | 178 ++++++++++++++++++------------
 src/lib/meta/function-closure.hpp | 117 ++++++++++++++++++++
 2 files changed, 227 insertions(+), 68 deletions(-)

diff --git a/research/try.cpp b/research/try.cpp
index 763f90caa..d03b9d2da 100644
--- a/research/try.cpp
+++ b/research/try.cpp
@@ -22,100 +22,142 @@
 // 10/11 - simple demo using a pointer and a struct
 // 11/11 - using the boost random number generator(s)
 // 12/11 - how to detect if string conversion is possible?
+// 1/12  - is partial application of member functions possible?
 
 
-#include "lib/util.hpp"
+/** @file try.cpp
+ ** Research: perform a partial application of a member function.
+ ** The result of this partial application should be a functor expecting the remaining arguments.
+ ** The idea was to use this at various library functions expecting a functor or callback, so to
+ ** improve readability of the client code: clients could then just pass a member pointer, without
+ ** the need to use any tr1::bind expression.
+ ** 
+ ** \par Costs in code size
+ ** While this turned out to be possible, even without much work, just based on the existing
+ ** templates for partial functor application (function-closure.hpp), the resulting code size
+ ** is rather sobering. Especially in debug mode, quite some overhead is created, which makes
+ ** usage of this convenience feature in general purpose library code rather questionable.
+ ** When compiling with -O3 though, most of the overhead will be removed
+ ** 
+ ** The following numbers could be observed:
+ ** \code
+ **                                  debug / stripped   // debug-O3 / stripped
+ ** just using a member pointer:     39013 /  7048            42061 /  7056
+ ** using tr1::bind and function:    90375 / 15416            65415 /  9376
+ ** partial apply, passing functor: 158727 / 23576            97479 / 11296
+ ** partial apply with mem pointer: 119495 / 17816            78031 /  9440
+ ** \endcode
+ */
 
+
+#include "lib/meta/tuple.hpp"
+#include "lib/meta/function-closure.hpp"
+
+//#include 
 #include 
-#include 
+
+using lib::meta::Types;
+using lib::meta::Tuple;
+//using std::tr1::placeholders::_1;
+//using std::tr1::placeholders::_2;
+using std::tr1::function;
+using std::tr1::bind;
 
 using std::string;
 using std::cout;
 using std::endl;
 
 
-typedef char Yes_t;
-struct No_t { char more_than_one[4]; };
+namespace lib {
+namespace meta{
+namespace func{
 
 
-template
-struct _can_convertToString
+template
+struct _PupS
   {
-    static TY & probe();
+    typedef typename _Fun::Ret Ret;
+    typedef typename _Fun::Args::List Args;
+    typedef typename Splice::Front ArgsFront;
+    typedef typename Splice::Back  ArgsBack;
+    typedef typename Types::Seq            ArgsToClose;
+    typedef typename Types::Seq             ArgsRemaining;
+    typedef typename _Sig::Type    ReducedSignature;
     
-    static Yes_t check(string);
-    static No_t  check(...);
+    typedef function                Function;
+  };
+
+template
+inline 
+typename _PupS::Function
+papply (SIG f, A1 a1)
+{
+  typedef typename _PupS::ArgsToClose ArgsToClose;
+  typedef Tuple        ArgTuple;
+  ArgTuple val(a1);
+  return PApply::bindFront (f, val);
+}
+
+template
+inline 
+typename _PupS::Function
+papply (SIG f, A1 a1, A2 a2)
+{
+  typedef typename _PupS::ArgPrefix ArgsToClose;
+  typedef Tuple        ArgTuple;
+  ArgTuple val(a1,a2);
+  return PApply::bindFront (f, val);
+}
+
+
+}}} // namespace lib::meta::func
+
+class Something
+  {
+    int i_;
+    
+    void
+    privateFun(char a)
+      {
+        char aa(a + i_);
+        cout << "Char-->" << aa < FunP;
+    
+    FunP
+    getBinding()
+      {
+//        function memf = bind (&Something::privateFun, _1, _2);
+//        return lib::meta::func::papply (memf, this);
+        return lib::meta::func::papply (&Something::privateFun, this);
+      }
+    
+//    typedef void (Something::*FunP) (char);
+//    
+//    FunP
+//    getBinding()
+//      {
+//        return &Something::privateFun;
+//      }
   };
 
 
 
 
-template
-bool
-investigate (TY const&)
-  {
-    return _can_convertToString::value;
-  }
-
-#define SHOW_CHECK(_EXPR_) cout << STRINGIFY(_EXPR_) << "\t : " << (investigate(_EXPR_)? "Yes":"No") << endl;
 
 int 
 main (int, char**)
   {
+    Something some(23);
+    Something::FunP fup = some.getBinding();
     
-    SHOW_CHECK (string("nebbich"));
-    SHOW_CHECK ("gurks");
-    SHOW_CHECK (23.34);
-    SHOW_CHECK (23);
-    
-    string urgs("urgs");
-    string & urgs_ref (urgs);
-    string const& urgs_const_ref (urgs);
-    string * urgs_ptr = &urgs;
-    
-    SHOW_CHECK (urgs_ref);
-    SHOW_CHECK (urgs_const_ref);
-    SHOW_CHECK (*urgs_ptr);
-    
-    SubString sub;
-    Something thing;
-    const SomehowStringy stringy = SomehowStringy();
-    SomehowSubSub subsub;
-    SubString const& subRef(subsub);
-    
-    SHOW_CHECK (sub);
-    SHOW_CHECK (thing);
-    SHOW_CHECK (stringy);
-    SHOW_CHECK (subsub);
-    SHOW_CHECK (subRef);
+    fup ('a');
     
     cout <<  "\n.gulp.\n";
     
diff --git a/src/lib/meta/function-closure.hpp b/src/lib/meta/function-closure.hpp
index 572eb32fa..4b75a2f54 100644
--- a/src/lib/meta/function-closure.hpp
+++ b/src/lib/meta/function-closure.hpp
@@ -67,18 +67,26 @@ namespace func{
     
     using tuple::element;
     
+    /**
+     * Helper to dissect an arbitrary function signature,
+     * irrespective if the parameter is given as function reference,
+     * function pointer, member function pointer or functor object.
+     * The base case assumes a (language) function reference.
+     */
     template
     struct _Fun
       {
         typedef typename FunctionSignature >::Ret Ret;
         typedef typename FunctionSignature >::Args Args;
       };
+    /** Specialisation for using a function pointer */
     template
     struct _Fun
       {
         typedef typename FunctionSignature >::Ret Ret;
         typedef typename FunctionSignature >::Args Args;
       };
+    /** Specialisation for passing a functor */
     template
     struct _Fun >
       {
@@ -86,6 +94,115 @@ namespace func{
         typedef typename FunctionSignature >::Args Args;
       };
     
+    /** Specialisations for member function pointers */
+    template
+    struct _Fun
+      {
+        typedef RET Ret;
+        typedef Types Args;
+      };
+    
+    template< typename RET, class CLASS
+            , typename A1
+            >
+    struct _Fun
+      {
+        typedef RET Ret;
+        typedef Types Args;
+      };
+    
+    template< typename RET, class CLASS
+            , typename A1
+            , typename A2
+            >
+    struct _Fun
+      {
+        typedef RET Ret;
+        typedef Types Args;
+      };
+    
+    template< typename RET, class CLASS
+            , typename A1
+            , typename A2
+            , typename A3
+            >
+    struct _Fun
+      {
+        typedef RET Ret;
+        typedef Types Args;
+      };
+    
+    template< typename RET, class CLASS
+            , typename A1
+            , typename A2
+            , typename A3
+            , typename A4
+            >
+    struct _Fun
+      {
+        typedef RET Ret;
+        typedef Types Args;
+      };
+    
+    template< typename RET, class CLASS
+            , typename A1
+            , typename A2
+            , typename A3
+            , typename A4
+            , typename A5
+            >
+    struct _Fun
+      {
+        typedef RET Ret;
+        typedef Types Args;
+      };
+    
+    template< typename RET, class CLASS
+            , typename A1
+            , typename A2
+            , typename A3
+            , typename A4
+            , typename A5
+            , typename A6
+            >
+    struct _Fun
+      {
+        typedef RET Ret;
+        typedef Types Args;
+      };
+    
+    template< typename RET, class CLASS
+            , typename A1
+            , typename A2
+            , typename A3
+            , typename A4
+            , typename A5
+            , typename A6
+            , typename A7
+            >
+    struct _Fun
+      {
+        typedef RET Ret;
+        typedef Types Args;
+      };
+    
+    template< typename RET, class CLASS
+            , typename A1
+            , typename A2
+            , typename A3
+            , typename A4
+            , typename A5
+            , typename A6
+            , typename A7
+            , typename A8
+            >
+    struct _Fun
+      {
+        typedef RET Ret;
+        typedef Types Args;
+      };
+    
+    
     template
     struct is_Functor                 { static const bool value = false; };
     template

From e6888f7b832857702d88e761c39216ece3a3a7bc Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 04:11:39 +0100
Subject: [PATCH 63/87] supplement direct support for populating by member
 function

this turns out to be the typical usage scenario
for ScopedCollection: a manager object owning
the collection will populate it with specially
crafted components and invoke a member function
for creating the individual components.

This shortcut avoids using tr1::bind alltogether
---
 src/lib/scoped-collection.hpp        | 27 +++++++++++++++
 tests/lib/scoped-collection-test.cpp | 49 ++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+)

diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
index b9174401b..2c9f85d7a 100644
--- a/src/lib/scoped-collection.hpp
+++ b/src/lib/scoped-collection.hpp
@@ -257,6 +257,33 @@ namespace lib {
             throw;
         } }   
       
+      /** variation of RAII-style: using a builder function,
+       *  which is a member of some object. This supports the
+       *  typical usage situation, where a manager object builds
+       *  a ScopedCollection of some components
+       * @param builder member function used to create the elements
+       * @param instance the owning class instance, on which the 
+       *        builder member function will be invoked ("this").
+       */
+      template
+      ScopedCollection (size_t maxElements, void (TY::*builder) (ElementHolder&), TY * const instance)
+        : level_(0)
+        , capacity_(maxElements)
+        , elements_(new ElementHolder[maxElements])
+        {
+        try { 
+          while (level_ < capacity_)
+            {
+              ElementHolder& storageFrame (elements_[level_]);
+              (instance->*builder) (storageFrame);
+              ++level_;
+            }}
+        catch(...)
+          {
+            clear();
+            throw;
+        } }   
+      
       /* == some pre-defined Builders == */
       
       class FillAll;           ///< fills the ScopedCollection with default constructed I-instances
diff --git a/tests/lib/scoped-collection-test.cpp b/tests/lib/scoped-collection-test.cpp
index 76c76c12e..f112e79da 100644
--- a/tests/lib/scoped-collection-test.cpp
+++ b/tests/lib/scoped-collection-test.cpp
@@ -111,6 +111,7 @@ namespace test{
           iterating();
           verify_defaultPopulator();
           verify_iteratorPopulator();
+          verify_embeddedCollection();
         }
       
       
@@ -416,6 +417,54 @@ namespace test{
           // note: the iterator is assumed to deliver a sufficient amount of elements
           VERIFY_ERROR (ITER_EXHAUST, CollI (50, CollI::pull (source.begin())));
         }
+      
+      
+      /** @test simulate the typical situation of a manager
+       * owning some embedded components. Here, our ManagerDemo
+       * instance owns a collection of numbers 50..1. They are
+       * created right while initialising the manager, and this
+       * initialisation is done by invoking a member function
+       * of the manager
+       */
+      void
+      verify_embeddedCollection()
+        {
+          ManagerDemo object_with_embedded_Collection(50);
+          CHECK (sum(50) == object_with_embedded_Collection.useMyNumbers());
+        }
+      
+      class ManagerDemo
+        {
+          typedef ScopedCollection CollI;
+          
+          uint memberVar_;
+          const CollI my_own_Numbers_;
+          
+          void
+          buildNumbers (CollI::ElementHolder& storage)
+            {
+              storage.create(memberVar_);
+              --memberVar_;
+            }
+          
+        public:
+          ManagerDemo(uint cnt)
+            : memberVar_(cnt)
+            , my_own_Numbers_(cnt, &ManagerDemo::buildNumbers, this)
+            { 
+              CHECK (0 == memberVar_);
+              CHECK (cnt == my_own_Numbers_.size());
+            }
+          
+          uint
+          useMyNumbers()
+            {
+              uint sum(0);
+              for (CollI::const_iterator ii = my_own_Numbers_.begin(); ii; ++ii)
+                sum += *ii;
+              return sum;
+            }
+        };
     };
   
   

From 5cc034d26b0a3a66399b3cfef96c4ce949c0f9eb Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 04:44:48 +0100
Subject: [PATCH 64/87] refactor ScopedCollection to use an init() function

---
 src/lib/scoped-collection.hpp                 | 85 ++++++++++++-------
 src/proc/play/output-slot-connection.hpp      | 12 ++-
 .../proc/play/diagnostic-output-slot.hpp      |  4 +-
 3 files changed, 65 insertions(+), 36 deletions(-)

diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp
index 2c9f85d7a..0ff2d37ef 100644
--- a/src/lib/scoped-collection.hpp
+++ b/src/lib/scoped-collection.hpp
@@ -47,7 +47,7 @@
  **   the container is being filled successively.
  ** - the "RAII style" usage strives to create all of the content objects
  **   right away, immediately after the memory allocation. This usage pattern
- **   avoids any kind of "lifecylce state". Either the container comes up sane
+ **   avoids any kind of "lifecycle state". Either the container comes up sane
  **   and fully populated, or the ctor call fails and any already created
  **   objects are discarded.
  ** @note intentionally there is no operation to discard individual objects,
@@ -69,13 +69,9 @@
 #define LIB_SCOPED_COLLECTION_H
 
 
-//#include "include/logging.h"
-#include "lib/iter-adapter.hpp"
 #include "lib/error.hpp"
-//#include "lib/util.hpp"
+#include "lib/iter-adapter.hpp"
 
-//#include 
-//#include 
 #include 
 #include 
 #include 
@@ -139,7 +135,6 @@ namespace lib {
 #define TYPE_SANITY_CHECK \
               BOOST_STATIC_ASSERT ((boost::is_base_of::value || boost::is_same::value))
           
-          
           /** Abbreviation for placement new */
 #define EMBEDDED_ELEMENT_CTOR(_CTOR_CALL_)    \
               TYPE_SANITY_CHECK;               \
@@ -244,18 +239,8 @@ namespace lib {
         , capacity_(maxElements)
         , elements_(new ElementHolder[maxElements])
         {
-        try { 
-          while (level_ < capacity_)
-            {
-              ElementHolder& storageFrame (elements_[level_]);
-              builder (storageFrame);
-              ++level_;
-            }}
-        catch(...)
-          {
-            clear();
-            throw;
-        } }   
+          populate_by (builder);
+        }
       
       /** variation of RAII-style: using a builder function,
        *  which is a member of some object. This supports the
@@ -271,18 +256,8 @@ namespace lib {
         , capacity_(maxElements)
         , elements_(new ElementHolder[maxElements])
         {
-        try { 
-          while (level_ < capacity_)
-            {
-              ElementHolder& storageFrame (elements_[level_]);
-              (instance->*builder) (storageFrame);
-              ++level_;
-            }}
-        catch(...)
-          {
-            clear();
-            throw;
-        } }   
+          populate_by (builder,instance);
+        }
       
       /* == some pre-defined Builders == */
       
@@ -316,6 +291,7 @@ namespace lib {
             }
         }
       
+      /** init all elements default constructed */
       void
       populate()
         try {
@@ -333,6 +309,53 @@ namespace lib {
             throw;
           }
       
+      /** init all elements at once,
+       *  invoking a builder functor for each.
+       * @param builder to create the individual elements
+       *        this functor is responsible to invoke the appropriate
+       *        ElementHolder#create function, which places a new element
+       *        into the storage frame passed as parameter.
+       */
+      template
+      void
+      populate_by (CTOR builder)
+        try { 
+          while (level_ < capacity_)
+            {
+              ElementHolder& storageFrame (elements_[level_]);
+              builder (storageFrame);
+              ++level_;
+          } }
+        catch(...)
+          {
+            WARN (progress, "Failure while populating ScopedCollection. "
+                            "All elements will be discarded");
+            clear();
+            throw;
+          }
+      
+      /** variation of element initialisation,
+       *  invoking a member function of some manager object
+       *  for each collection element to be created.
+       */
+      template
+      void
+      populate_by (void (TY::*builder) (ElementHolder&), TY * const instance)
+        try { 
+          while (level_ < capacity_)
+            {
+              ElementHolder& storageFrame (elements_[level_]);
+              (instance->*builder) (storageFrame);
+              ++level_;
+          } }
+        catch(...)
+          {
+            WARN (progress, "Failure while populating ScopedCollection. "
+                            "All elements will be discarded");
+            clear();
+            throw;
+          }
+      
       
       
       /** push a new element of default type
diff --git a/src/proc/play/output-slot-connection.hpp b/src/proc/play/output-slot-connection.hpp
index 71a830c7e..332943ae5 100644
--- a/src/proc/play/output-slot-connection.hpp
+++ b/src/proc/play/output-slot-connection.hpp
@@ -68,8 +68,8 @@ namespace play {
   using lib::transform;
   using lib::iter_stl::eachElm;
   
-  using std::tr1::placeholders::_1;
-  using std::tr1::bind;
+//using std::tr1::placeholders::_1;
+//using std::tr1::bind;
   using std::vector;
 //using std::tr1::shared_ptr;
   using boost::scoped_ptr;
@@ -186,6 +186,11 @@ namespace play {
       
       
     protected: /* == API for OutputSlot-Impl == */
+      void
+      init() ///< derived classes need to invoke this to build the actual connections
+        {
+          connections_.populate_by (&ConnectionStateManager::buildConnection, this);
+        }
       
       typedef typename Connections::ElementHolder& ConnectionStorage;
       
@@ -195,8 +200,7 @@ namespace play {
       
       
       ConnectionStateManager(uint numChannels)
-        : connections_( numChannels
-                      , bind (&ConnectionStateManager::buildConnection, this, _1 ))
+        : connections_(numChannels)
         { }
       
     public:
diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp
index 1554ce8cf..920630856 100644
--- a/tests/components/proc/play/diagnostic-output-slot.hpp
+++ b/tests/components/proc/play/diagnostic-output-slot.hpp
@@ -261,7 +261,9 @@ namespace play {
     public:
       SimulatedOutputSequences (uint numChannels)
         : _Base(numChannels)
-        { }
+        {
+          init();
+        }
     };
   
     

From 73cfef69c813be499484757628e36fd478ea30c2 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 06:40:21 +0100
Subject: [PATCH 65/87] fix some problems with OutputSlotProtocol_test

still WIP...
 - there is a logical contradiction with the frame numbers
 - somehow, in diagnostics, we access the wrong sequence instance
---
 src/proc/asset/meta/time-grid.cpp                        | 1 +
 tests/components/proc/play/diagnostic-output-slot.hpp    | 2 +-
 tests/components/proc/play/output-slot-protocol-test.cpp | 3 ---
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/proc/asset/meta/time-grid.cpp b/src/proc/asset/meta/time-grid.cpp
index 89744eee0..d72878f03 100644
--- a/src/proc/asset/meta/time-grid.cpp
+++ b/src/proc/asset/meta/time-grid.cpp
@@ -85,6 +85,7 @@ namespace meta {
     PQuant quantiser (dynamic_pointer_cast(gridImplementation));
     Literal bindingID (cStr(newGrid.ident.name));
     
+    advice::Provision(bindingID).setAdvice(gridImplementation);
     advice::Provision(bindingID).setAdvice(quantiser);
     return gridImplementation;
     }
diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp
index 920630856..6ec40d009 100644
--- a/tests/components/proc/play/diagnostic-output-slot.hpp
+++ b/tests/components/proc/play/diagnostic-output-slot.hpp
@@ -117,7 +117,7 @@ namespace play {
       BuffHandle
       trackFrame (FrameID frameNr, BuffHandle const& newBuffer)
         {
-          REQUIRE (contains (frameTrackingIndex_,frameNr),
+          REQUIRE (!contains (frameTrackingIndex_,frameNr),
                    "attempt to lock already used frame %lu", frameNr);
           
           frameTrackingIndex_.insert (frameNr);
diff --git a/tests/components/proc/play/output-slot-protocol-test.cpp b/tests/components/proc/play/output-slot-protocol-test.cpp
index 480b664c8..a1e0fef09 100644
--- a/tests/components/proc/play/output-slot-protocol-test.cpp
+++ b/tests/components/proc/play/output-slot-protocol-test.cpp
@@ -92,15 +92,12 @@ namespace test {
           int64_t frameNr = 123;
           BuffHandle buff00 = sink1.lockBufferFor (frameNr);
           BuffHandle buff10 = sink2.lockBufferFor (frameNr);
-          buff00.create();
-          buff10.create();
           
           // rendering process calculates content....
           buff00.accessAs() = testData(0,0);
           
           // while further frames might be processed in parallel
           BuffHandle buff11 = sink2.lockBufferFor (++frameNr);
-          buff11.create();
           buff11.accessAs() = testData(1,1);
           buff10.accessAs() = testData(1,0);
           

From 8de4ecc8ac6f8b30190e118676868d3e867a0a72 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 7 Jan 2012 21:22:35 +0100
Subject: [PATCH 66/87] add diagnostic messages showing each connection access

currently the problem seems to be we're
accessing the wrong connection...
---
 .gitignore                                    |  2 ++
 src/proc/play/output-slot-connection.hpp      |  2 ++
 .../proc/play/diagnostic-output-slot.hpp      | 25 ++++++++++++-------
 3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/.gitignore b/.gitignore
index e2f73fc4d..5c6dc182c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,8 @@
 *.gch
 ,valgrind.log*
 *.pyc
+/.sconf_temp
+/.settings
 optcache
 Makefile.in
 build/*
diff --git a/src/proc/play/output-slot-connection.hpp b/src/proc/play/output-slot-connection.hpp
index 332943ae5..f83b789c6 100644
--- a/src/proc/play/output-slot-connection.hpp
+++ b/src/proc/play/output-slot-connection.hpp
@@ -215,6 +215,8 @@ namespace play {
       static DataSink
       connectOutputSink (CON& connection)
         {
+          TRACE (test, "activating Con=%p", &connection );
+          
           DataSink newSink;
           newSink.activate(&connection, shutdownConnection);
           return newSink;
diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp
index 6ec40d009..7e7a2f91d 100644
--- a/tests/components/proc/play/diagnostic-output-slot.hpp
+++ b/tests/components/proc/play/diagnostic-output-slot.hpp
@@ -117,6 +117,8 @@ namespace play {
       BuffHandle
       trackFrame (FrameID frameNr, BuffHandle const& newBuffer)
         {
+          TRACE (test, "Con=%p : track buffer %zu for frame-#%lu"
+                     , this, newBuffer.entryID(), frameNr);
           REQUIRE (!contains (frameTrackingIndex_,frameNr),
                    "attempt to lock already used frame %lu", frameNr);
           
@@ -140,7 +142,9 @@ namespace play {
       BuffHandle
       claimBufferFor(FrameID frameNr) 
         {
+          TRACE (test, "Con=%p : lock buffer for frame-#%lu", this, frameNr);
           REQUIRE (!closed_);
+          
           return trackFrame (frameNr,
                              buffProvider_.lockBuffer (bufferType_));
         }
@@ -149,16 +153,22 @@ namespace play {
       bool
       isTimely (FrameID frameNr, TimeValue currentTime)
         {
+          TRACE (test, "Con=%p : timely? frame-#%lu"
+                     , this, frameNr);
+          
           if (Time::ANYTIME == currentTime)
             return true;
-          
-          return currentTime < deadlineFor (frameNr);
+          else
+            return currentTime < deadlineFor (frameNr);
         }
       
       void
       transfer (BuffHandle const& filledBuffer)
         {
+          TRACE (test, "Con=%p : transfer buffer %zu"
+                     , this, filledBuffer.entryID());
           REQUIRE (!closed_);
+          
           pushout (filledBuffer);
         }
       
@@ -191,13 +201,13 @@ namespace play {
         , frameGrid_(getTestTimeGrid())                              /////////////TODO should rather pass that in as part of a "timings" definition
         , closed_(false)
         {
-          INFO (engine_dbg, "building in-memory diagnostic output sequence");
+          INFO (engine_dbg, "building in-memory diagnostic output sequence (at %p)", this);
         }
       
       virtual
      ~TrackingInMemoryBlockSequence()
         {
-          INFO (engine_dbg, "releasing diagnostic output sequence");
+          INFO (engine_dbg, "releasing diagnostic output sequence (at %p)", this);
         }
       
       
@@ -224,6 +234,8 @@ namespace play {
       bool
       wasAllocated (uint frameNr)  const
         {
+          TRACE (test, "query wasAllocated. Con=%p", this);
+          
           return contains (frameTrackingIndex_, frameNr);
         }
       
@@ -424,11 +436,6 @@ namespace play {
           return block
               && block->was_used();
         }
-      
-      
-      
-    private:
-      
     };
   
   

From d732e7e211d09b98c5ad5f2ec0124f2335fce2bd Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sun, 8 Jan 2012 01:14:36 +0100
Subject: [PATCH 67/87] Lumiera Forward Iterators: remove support for
 post-increment

---
 src/lib/iter-adapter.hpp                      | 22 ------
 src/proc/mobject/session/defs-registry.hpp    |  1 -
 .../session/defs-registry-impl-test.cpp       | 76 +++++++++----------
 .../proc/play/output-slot-protocol-test.cpp   | 10 +--
 tests/lib/iter-adapter-test.cpp               |  7 +-
 5 files changed, 48 insertions(+), 68 deletions(-)

diff --git a/src/lib/iter-adapter.hpp b/src/lib/iter-adapter.hpp
index 1b92fd8ac..9cb5f6bee 100644
--- a/src/lib/iter-adapter.hpp
+++ b/src/lib/iter-adapter.hpp
@@ -191,15 +191,6 @@ namespace lib {
           return *this;
         }
       
-      IterAdapter
-      operator++(int)
-        {
-          _maybe_throw();
-          IterAdapter oldPos(*this);
-          iterate();
-          return oldPos;
-        }
-      
       bool
       isValid ()  const
         {
@@ -334,13 +325,6 @@ namespace lib {
           return *this;
         }
       
-      RangeIter
-      operator++(int)
-        {
-          _maybe_throw();
-          return RangeIter (p_++,e_);
-        }
-      
       bool
       isValid ()  const
         {
@@ -551,12 +535,6 @@ namespace lib {
           return *this;
         }
       
-      PtrDerefIter
-      operator++(int)
-        {
-          return PtrDerefIter (i_++);
-        }
-      
       bool
       isValid ()  const
         {
diff --git a/src/proc/mobject/session/defs-registry.hpp b/src/proc/mobject/session/defs-registry.hpp
index 53bfa7a93..d72c92014 100644
--- a/src/proc/mobject/session/defs-registry.hpp
+++ b/src/proc/mobject/session/defs-registry.hpp
@@ -236,7 +236,6 @@ namespace session {
           public:
             P operator* ()    { return ptr; }
             bool  hasNext ()       { return next || findNext(); }
-            Iter  operator++ (int) { Iter tmp=*this; operator++(); return tmp; }
             Iter& operator++ ()
               { 
                 ptr=findNext();
diff --git a/tests/components/proc/mobject/session/defs-registry-impl-test.cpp b/tests/components/proc/mobject/session/defs-registry-impl-test.cpp
index 756001376..6ec3ed9b7 100644
--- a/tests/components/proc/mobject/session/defs-registry-impl-test.cpp
+++ b/tests/components/proc/mobject/session/defs-registry-impl-test.cpp
@@ -172,33 +172,33 @@ namespace test    {
         {
           Iter13 i (reg_->candidates(Q13 ("irrelevant query")));
           CHECK ( i.hasNext());
-          CHECK ( *i++ == o1);   // ordered according to the degree of the queries
-          CHECK ( *i++ == o2);
-          CHECK ( *i++ == o3);
-          CHECK ( *i++ == o3);
-          CHECK ( *i++ == o2);
-          CHECK ( *i   == o1);
+          CHECK ( *i == o1); ++i;   // ordered according to the degree of the queries
+          CHECK ( *i == o2); ++i;
+          CHECK ( *i == o3); ++i;
+          CHECK ( *i == o3); ++i;
+          CHECK ( *i == o2); ++i;
+          CHECK ( *i == o1);
           CHECK (!i.hasNext());
           CHECK (! *++i ); // null after end
           
           i = reg_->candidates(q3);
-          CHECK ( *i++ == o3);   // found by direct match
-          CHECK ( *i++ == o1);   // followed by the ordered enumeration
-          CHECK ( *i++ == o2);
-          CHECK ( *i++ == o3);
-          CHECK ( *i++ == o3);
-          CHECK ( *i++ == o2);
-          CHECK ( *i++ == o1);
+          CHECK ( *i == o3); ++i;   // found by direct match
+          CHECK ( *i == o1); ++i;   // followed by the ordered enumeration
+          CHECK ( *i == o2); ++i;
+          CHECK ( *i == o3); ++i;
+          CHECK ( *i == o3); ++i;
+          CHECK ( *i == o2); ++i;
+          CHECK ( *i == o1); ++i;
           CHECK (!i.hasNext());
           
           i = reg_->candidates(Q13());
-          CHECK ( *i++ == o1);   // found by direct match to the empty query
-          CHECK ( *i++ == o1);
-          CHECK ( *i++ == o2);
-          CHECK ( *i++ == o3);
-          CHECK ( *i++ == o3);
-          CHECK ( *i++ == o2);
-          CHECK ( *i++ == o1);
+          CHECK ( *i == o1); ++i;   // found by direct match to the empty query
+          CHECK ( *i == o1); ++i;
+          CHECK ( *i == o2); ++i;
+          CHECK ( *i == o3); ++i;
+          CHECK ( *i == o3); ++i;
+          CHECK ( *i == o2); ++i;
+          CHECK ( *i == o1); ++i;
           CHECK (!i.hasNext());
           
           uint d=0;
@@ -230,12 +230,12 @@ namespace test    {
           
           Iter13 i (reg_->candidates(q4));
           CHECK ( i.hasNext());
-          CHECK ( *i++ == o1);    // ordered according to the degree of the queries
-                                  // but the o2 entries are missing
-          CHECK ( *i++ == o3);
-          CHECK ( *i++ == o3);
+          CHECK ( *i == o1); ++i;    // ordered according to the degree of the queries
+                                     // but the o2 entries are missing
+          CHECK ( *i == o3); ++i;
+          CHECK ( *i == o3); ++i;
                                   // missing
-          CHECK ( *i   == o1);
+          CHECK ( *i == o1);
           CHECK (!i.hasNext());
           
           o3.reset(); // killing the only reference....
@@ -243,33 +243,33 @@ namespace test    {
           
           i = reg_->candidates(Q13 ("something"));
           CHECK ( i.hasNext());
-          CHECK ( *i++ == o1);    // ordered according to the degree of the queries
-                                  // but now also the o3 entries are missing...
-          CHECK ( *i   == o1);
+          CHECK ( *i == o1); ++i;    // ordered according to the degree of the queries
+                                     // but now also the o3 entries are missing...
+          CHECK ( *i == o1);
           CHECK (!i.hasNext());
           
           CHECK ( reg_->put (o1, q5));   // trying to register the same object at the same place
                                          // doesn't change anything (but counts as "success")
           i = reg_->candidates(q5);
-          CHECK ( *i++ == o1); // direct match
-          CHECK ( *i++ == o1);
-          CHECK ( *i++ == o1);
+          CHECK ( *i == o1); ++i; // direct match
+          CHECK ( *i == o1); ++i;
+          CHECK ( *i == o1); ++i;
           CHECK (!i.hasNext());
           
           CHECK (!reg_->put (o2, q5));   // trying to (re)register o2 with a existing query
                                          // counts as failure (nothing changes)
           i = reg_->candidates(q5);
-          CHECK ( *i++ == o1); // direct match
-          CHECK ( *i++ == o1);
-          CHECK ( *i++ == o1);
+          CHECK ( *i == o1); ++i; // direct match
+          CHECK ( *i == o1); ++i;
+          CHECK ( *i == o1); ++i;
           CHECK (!i.hasNext());
           
           CHECK ( reg_->put (o2, q2));   // trying to (re)register o2 with another query succeeds
           i = reg_->candidates(q2);
-          CHECK ( *i++ == o2); // direct match
-          CHECK ( *i++ == o1);
-          CHECK ( *i++ == o2); // inserted here in the dataset
-          CHECK ( *i++ == o1);
+          CHECK ( *i == o2); ++i; // direct match
+          CHECK ( *i == o1); ++i;
+          CHECK ( *i == o2); ++i; // inserted here in the dataset
+          CHECK ( *i == o1); ++i;
           CHECK (!i.hasNext());
           
           CHECK ( reg_->forget (o1));
diff --git a/tests/components/proc/play/output-slot-protocol-test.cpp b/tests/components/proc/play/output-slot-protocol-test.cpp
index a1e0fef09..18b54388f 100644
--- a/tests/components/proc/play/output-slot-protocol-test.cpp
+++ b/tests/components/proc/play/output-slot-protocol-test.cpp
@@ -84,8 +84,8 @@ namespace test {
           // "calculation streams" for the individual
           // Channels to be output through this slot.
           OutputSlot::OpenedSinks sinks = alloc.getOpenedSinks();
-          DataSink sink1 = *sinks++;
-          DataSink sink2 = *sinks++;
+          DataSink sink1 = *sinks;
+          DataSink sink2 = *++sinks;
           
           // within the frame-calculation "loop"
           // we perform an data exchange cycle
@@ -127,12 +127,12 @@ namespace test {
           DiagnosticOutputSlot::OutFrames stream1 = checker.getChannel(1);
           
           CHECK ( stream0);
-          CHECK (*stream0++ == testData(0,0));
+          CHECK (*stream0 == testData(0,0)); ++stream0;
           CHECK (!stream0);
           
           CHECK ( stream1);
-          CHECK (*stream1++ == testData(1,0));
-          CHECK (*stream1++ == testData(1,1));
+          CHECK (*stream1 == testData(1,0)); ++stream1;
+          CHECK (*stream1 == testData(1,1)); ++stream1;
           CHECK (!stream1);
 #if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #819
 #endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #819
diff --git a/tests/lib/iter-adapter-test.cpp b/tests/lib/iter-adapter-test.cpp
index 6376c49bc..ef6f2c9da 100644
--- a/tests/lib/iter-adapter-test.cpp
+++ b/tests/lib/iter-adapter-test.cpp
@@ -215,7 +215,10 @@ namespace test{
           
           // now for example the client could....
           while ( range )
-            cout << "::" << *range++;
+            {
+              cout << "::" << *range;
+              ++range;
+            }
           
           cout << endl;
           CHECK (isnil (range));
@@ -317,7 +320,7 @@ namespace test{
           TestContainer::ref_iterator rI (elms.begin_ref());
           
           CHECK (0 == *rI );
-          CHECK (0 == *rI++);
+          ++rI;
           CHECK (1 == *rI  );
           CHECK (2 == *++rI);
           

From 24a1060ae9cd8d8b187de598b943c49d378f8b1a Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sun, 8 Jan 2012 01:32:45 +0100
Subject: [PATCH 68/87] fix inconsistency in OutputSlot protocol test

need to distinguish between nominal frame number
and the sequence number in the output frame stream
---
 .../proc/play/diagnostic-output-slot.hpp      | 35 ++++++++-----------
 .../proc/play/output-slot-protocol-test.cpp   | 24 ++++++-------
 2 files changed, 25 insertions(+), 34 deletions(-)

diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp
index 7e7a2f91d..e6e971a9d 100644
--- a/tests/components/proc/play/diagnostic-output-slot.hpp
+++ b/tests/components/proc/play/diagnostic-output-slot.hpp
@@ -404,38 +404,31 @@ namespace play {
       
       
       bool
-      buffer_was_used (uint channel, FrameID frame)
+      frame_was_allocated (uint channel, FrameID nominalFrame)
         {
           return accessSequence(channel)
-                   .wasAllocated(frame);
+                   .wasAllocated(nominalFrame);
         }
       
       
       bool
-      buffer_unused   (uint channel, FrameID frame)
-        {
-          return !buffer_was_used(channel, frame);
-        }
-      
-      
-      bool
-      buffer_was_closed (uint channel, FrameID frame)
+      output_was_emitted (uint channel, FrameID outputFrame)
         {
           diagn::Block const *block = accessSequence(channel)
-                                        .accessEmittedBuffer(frame);
-          return block
-              && block->was_closed();
-        }
-      
-      
-      bool
-      emitted (uint channel, FrameID frame)
-        {
-          diagn::Block const *block = accessSequence(channel)
-                                        .accessEmittedBuffer(frame);
+                                        .accessEmittedBuffer(outputFrame);
           return block
               && block->was_used();
         }
+      
+      
+      bool
+      output_was_closed (uint channel, FrameID outputFrame)
+        {
+          diagn::Block const *block = accessSequence(channel)
+                                        .accessEmittedBuffer(outputFrame);
+          return block
+              && block->was_closed();
+        }
     };
   
   
diff --git a/tests/components/proc/play/output-slot-protocol-test.cpp b/tests/components/proc/play/output-slot-protocol-test.cpp
index 18b54388f..028346593 100644
--- a/tests/components/proc/play/output-slot-protocol-test.cpp
+++ b/tests/components/proc/play/output-slot-protocol-test.cpp
@@ -109,19 +109,19 @@ namespace test {
           
           // Verify sane operation....
           DiagnosticOutputSlot& checker = DiagnosticOutputSlot::access(oSlot);
-          CHECK (checker.buffer_was_used (0,0));
-          CHECK (checker.buffer_unused   (0,1));
-          CHECK (checker.buffer_was_used (1,0));
-          CHECK (checker.buffer_was_used (1,1));
+          CHECK ( checker.frame_was_allocated (0,123));
+          CHECK (!checker.frame_was_allocated (0,124));
+          CHECK ( checker.frame_was_allocated (1,123));
+          CHECK ( checker.frame_was_allocated (1,124));
           
-          CHECK (checker.buffer_was_closed (0,0));
-          CHECK (checker.buffer_was_closed (1,0));
-          CHECK (checker.buffer_was_closed (1,1));
+          CHECK (checker.output_was_closed (0,0));
+          CHECK (checker.output_was_closed (1,0));
+          CHECK (checker.output_was_closed (1,1));
           
-          CHECK ( checker.emitted (0,0));
-          CHECK (!checker.emitted (0,1));
-          CHECK ( checker.emitted (1,0));
-          CHECK ( checker.emitted (1,1));
+          CHECK ( checker.output_was_emitted (0,0));
+          CHECK (!checker.output_was_emitted (0,1));
+          CHECK ( checker.output_was_emitted (1,0));
+          CHECK ( checker.output_was_emitted (1,1));
           
           DiagnosticOutputSlot::OutFrames stream0 = checker.getChannel(0); 
           DiagnosticOutputSlot::OutFrames stream1 = checker.getChannel(1);
@@ -134,8 +134,6 @@ namespace test {
           CHECK (*stream1 == testData(1,0)); ++stream1;
           CHECK (*stream1 == testData(1,1)); ++stream1;
           CHECK (!stream1);
-#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #819
-#endif    /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #819
         }
     };
   

From f5290a99a31e13ef9b49de7e6383e6d6b8a51276 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sun, 8 Jan 2012 03:06:32 +0100
Subject: [PATCH 69/87] OutputSlot : simulated usage protocol passes unit test

OutputSlotProtocol_test

Some parts are still missing
 - timings
 _ initialisation
---
 src/proc/play/output-slot-connection.hpp            |  2 ++
 tests/47playout.tests                               |  2 +-
 .../components/proc/play/diagnostic-output-slot.hpp |  4 ++--
 .../proc/play/output-slot-protocol-test.cpp         | 13 +------------
 4 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/proc/play/output-slot-connection.hpp b/src/proc/play/output-slot-connection.hpp
index f83b789c6..ed61ef864 100644
--- a/src/proc/play/output-slot-connection.hpp
+++ b/src/proc/play/output-slot-connection.hpp
@@ -162,6 +162,7 @@ namespace play {
       OpenedSinks
       getOpenedSinks()
         {
+                                                                                 //////////////////////////TICKET #878  not re-entrant, lifecycle isn't clear
           REQUIRE (this->isActive());
           return transform (eachElm(connections_), connectOutputSink);
         }
@@ -189,6 +190,7 @@ namespace play {
       void
       init() ///< derived classes need to invoke this to build the actual connections
         {
+                                                                                 //////////////////////////TICKET #878  really build all at once? or on demand?
           connections_.populate_by (&ConnectionStateManager::buildConnection, this);
         }
       
diff --git a/tests/47playout.tests b/tests/47playout.tests
index d59689f3b..0bdc2a9ad 100644
--- a/tests/47playout.tests
+++ b/tests/47playout.tests
@@ -2,6 +2,6 @@ TESTING "Component Test Suite: Player and Output" ./test-components --group=play
 
 
 
-PLANNED "Output Slot Protocol" OutputSlotProtocol_test <
-//#include 
-
-//using boost::format;
-//using std::string;
-//using std::cout;
 
 
 namespace proc {
 namespace play {
 namespace test {
   
-//  using lib::AllocationCluster;
-//  using mobject::session::PEffect;
   using proc::engine::BuffHandle;
   using proc::engine::test::testData;
   using proc::engine::test::TestFrame;
   
   
-  namespace { // Test fixture
-    
-  }
   
   
   /*******************************************************************

From c62eccd25f392deb9e82bb9a8aee46254541dca0 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 9 Jan 2012 01:32:24 +0100
Subject: [PATCH 70/87] SCons overhaul/clean-up: disentangle main build

The goal is to make the build scrips more clear
at first sight. So move the main build targets
into a separate SConscript, to make them similar
to the tests, research and tools.

The final goal of this makeover is to reduce
the main SConstruct as much as possible
---
 SConstruct     | 41 ++--------------------------------------
 src/SConscript | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 39 deletions(-)
 create mode 100644 src/SConscript

diff --git a/SConstruct b/SConstruct
index 16c8c3123..01714c6a9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -38,7 +38,7 @@ CUSTOPTFILE  = 'custom-options'
 
 # these are accessible via env.path.xxxx
 srcIcon      = 'icons'
-srcConf      = 'data/config'
+srcConf      = '#data/config'
 buildExe     = '#$TARGDIR'
 buildLib     = '#$TARGDIR/modules'
 buildPlug    = '#$TARGDIR/modules'
@@ -333,45 +333,8 @@ def defineBuildTargets(env, artifacts):
         We use a custom function to declare a whole tree of srcfiles. 
     """
     
-    lLib  = env.SharedLibrary('lumiera',        srcSubtree('src/lib'),    install=True)
-    lApp  = env.SharedLibrary('lumieracommon',  srcSubtree('src/common'), install=True, LIBS=lLib)
-    lBack = env.SharedLibrary('lumierabackend', srcSubtree('src/backend'),install=True)
-    lProc = env.SharedLibrary('lumieraproc',    srcSubtree('src/proc'),   install=True)
-    
-    core = lLib+lApp+lBack+lProc
-    
-    artifacts['corelib'] = core
-    artifacts['support'] = lLib
-    artifacts['config']  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
-                           + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
-                           )
-    artifacts['lumiera'] = ( env.Program('lumiera', ['src/lumiera/main.cpp'] + core, install=True)
-                           + artifacts['config']
-                           )
-    
-    # building Lumiera Plugins
-    artifacts['plugins'] = [] # currently none 
-    
-    # render and install Icons
-    vector_icon_dir      = env.path.srcIcon+'svg'
-    prerendered_icon_dir = env.path.srcIcon+'prerendered'
-    artifacts['icons']   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
-                           + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
-                           )
-    
-    # the Lumiera GTK GUI
-    envGtk = env.Clone()
-    envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','xext','sm'])
-    envGtk.Append(LIBS=core)
-    
-    guimodule = envGtk.LumieraPlugin('gtk_gui', srcSubtree('src/gui'), install=True)
-    artifacts['gui'] = ( guimodule
-                       + [env.GuiResource(f) for f in env.Glob('src/gui/*.rc')]
-                       + artifacts['icons']
-                       )
-    
     # call subdir SConscript(s) for independent components
-    SConscript(dirs=['src/tool','research','tests'], exports='env artifacts core')
+    SConscript(dirs=['src','src/tool','research','tests'], exports='env artifacts')
 
 
 
diff --git a/src/SConscript b/src/SConscript
new file mode 100644
index 000000000..66aa8aa7a
--- /dev/null
+++ b/src/SConscript
@@ -0,0 +1,51 @@
+# -*- python -*-
+##
+## SConscript  -  SCons buildscript for the Lumiera Application.
+##                Definitions how to build the main tree
+##
+
+from Buildhelper import srcSubtree
+from Buildhelper import scanSubtree
+
+Import('env','artifacts')
+
+
+lLib  = env.SharedLibrary('lumiera',        srcSubtree('lib'),    install=True)
+lApp  = env.SharedLibrary('lumieracommon',  srcSubtree('common'), install=True, LIBS=lLib)
+lBack = env.SharedLibrary('lumierabackend', srcSubtree('backend'),install=True)
+lProc = env.SharedLibrary('lumieraproc',    srcSubtree('proc'),   install=True)
+
+core = lLib+lApp+lBack+lProc
+
+artifacts['corelib'] = core
+artifacts['support'] = lLib
+artifacts['config']  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
+                       + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
+                       )
+artifacts['lumiera'] = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, install=True)
+                       + artifacts['config']
+                       )
+
+# building Lumiera Plugins
+artifacts['plugins'] = [] # currently none 
+
+# render and install Icons
+vector_icon_dir      = env.path.srcIcon+'svg'
+prerendered_icon_dir = env.path.srcIcon+'prerendered'
+artifacts['icons']   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
+                       + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
+                       )
+
+# the Lumiera GTK GUI
+envGtk = env.Clone()
+envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','xext','sm'])
+envGtk.Append(LIBS=core)
+
+guimodule = envGtk.LumieraPlugin('gtk_gui', srcSubtree('gui'), install=True)
+artifacts['gui'] = ( guimodule
+                   + [env.GuiResource(f) for f in env.Glob('gui/*.rc')]
+                   + artifacts['icons']
+                   )
+
+
+Export('core')

From 25b21fe575eafddf4620f24cd1816a19838523aa Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 9 Jan 2012 02:27:59 +0100
Subject: [PATCH 71/87] reorder building/installing of Icons

no need to define them together with the source.
SCons is able to work out the real dependencies
just fine. Thus, Icons remain in Main SConstruct
---
 SConstruct     | 15 ++++++++++++++-
 src/SConscript |  9 ---------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/SConstruct b/SConstruct
index 01714c6a9..4d015ee0b 100644
--- a/SConstruct
+++ b/SConstruct
@@ -38,7 +38,7 @@ CUSTOPTFILE  = 'custom-options'
 
 # these are accessible via env.path.xxxx
 srcIcon      = 'icons'
-srcConf      = '#data/config'
+srcConf      = 'data/config'
 buildExe     = '#$TARGDIR'
 buildLib     = '#$TARGDIR/modules'
 buildPlug    = '#$TARGDIR/modules'
@@ -333,6 +333,19 @@ def defineBuildTargets(env, artifacts):
         We use a custom function to declare a whole tree of srcfiles. 
     """
     
+    # define Icons to render and install
+    vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
+    prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
+    print "ICON: vector_icon_dir=%s prerendered=%s" % (vector_icon_dir,prerendered_icon_dir)
+    artifacts['icons']   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
+                           + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
+                           )
+    
+    #define Configuration files to install
+    artifacts['config']  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
+                           + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
+                           )
+    
     # call subdir SConscript(s) for independent components
     SConscript(dirs=['src','src/tool','research','tests'], exports='env artifacts')
 
diff --git a/src/SConscript b/src/SConscript
index 66aa8aa7a..10cea7404 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -19,9 +19,6 @@ core = lLib+lApp+lBack+lProc
 
 artifacts['corelib'] = core
 artifacts['support'] = lLib
-artifacts['config']  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
-                       + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
-                       )
 artifacts['lumiera'] = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, install=True)
                        + artifacts['config']
                        )
@@ -29,12 +26,6 @@ artifacts['lumiera'] = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, ins
 # building Lumiera Plugins
 artifacts['plugins'] = [] # currently none 
 
-# render and install Icons
-vector_icon_dir      = env.path.srcIcon+'svg'
-prerendered_icon_dir = env.path.srcIcon+'prerendered'
-artifacts['icons']   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
-                       + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
-                       )
 
 # the Lumiera GTK GUI
 envGtk = env.Clone()

From f84da63e111047d101db2e8fedf570aca60fba40 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 9 Jan 2012 02:56:29 +0100
Subject: [PATCH 72/87] use import/export instead of passing an artefacts map

---
 SConstruct          | 52 ++++++++++++++++++++++-----------------------
 research/SConscript |  3 +--
 src/SConscript      | 26 +++++++++++------------
 src/tool/SConscript | 14 ++++++------
 tests/SConscript    | 27 +++++++++++------------
 5 files changed, 60 insertions(+), 62 deletions(-)

diff --git a/SConstruct b/SConstruct
index 4d015ee0b..1170195d5 100644
--- a/SConstruct
+++ b/SConstruct
@@ -319,7 +319,7 @@ def configurePlatform(env):
 
 
 
-def defineSetupTargets(env, artifacts):
+def defineSetupTargets(env):
     """ build operations and targets to be done /before/ compiling.
         things like creating a source tarball or preparing a version header.
     """
@@ -327,7 +327,7 @@ def defineSetupTargets(env, artifacts):
 
 
 
-def defineBuildTargets(env, artifacts):
+def defineBuildTargets(env):
     """ define the source file/dirs comprising each artifact to be built.
         setup sub-environments with special build options if necessary.
         We use a custom function to declare a whole tree of srcfiles. 
@@ -336,52 +336,51 @@ def defineBuildTargets(env, artifacts):
     # define Icons to render and install
     vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
     prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
-    print "ICON: vector_icon_dir=%s prerendered=%s" % (vector_icon_dir,prerendered_icon_dir)
-    artifacts['icons']   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
-                           + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
-                           )
+    icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
+              + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
+              )
     
     #define Configuration files to install
-    artifacts['config']  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
-                           + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
-                           )
+    config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
+              + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
+              )
     
     # call subdir SConscript(s) for independent components
-    SConscript(dirs=['src','src/tool','research','tests'], exports='env artifacts')
+    SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
 
 
 
-def definePostBuildTargets(env, artifacts):
+def definePostBuildTargets(env):
     """ define further actions after the core build (e.g. Documentation).
         define alias targets to trigger the installing.
     """
-    build = env.Alias('build', ( artifacts['lumiera']
-                               + artifacts['plugins']
-                               + artifacts['tools']
-                               + artifacts['gui']
-                               ))
+    Import('lumiera plugins tools gui testsuite')
+    build = env.Alias('build', lumiera + plugins + tools +gui)
+    
     # additional files to be cleaned when cleaning 'build'
     env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
     env.Clean ('build', [ 'src/pre.gch' ])
     
-    doxydoc = artifacts['doxydoc'] = env.Doxygen('doc/devel/Doxyfile')
+    doxydoc = env.Doxygen('doc/devel/Doxyfile')
     env.Alias ('doc', doxydoc)
     env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
     
-    env.Alias ('all', build+artifacts['testsuite']+doxydoc)
+    env.Alias ('all', build + testsuite + doxydoc)
     env.Default('build')
     # SCons default target
 
 
-def defineInstallTargets(env, artifacts):
+def defineInstallTargets(env):
     """ define additional artifacts to be installed into target locations.
         @note: we use customised SCons builders defining install targets 
                for all executables automatically. see LumieraEnvironment.py
     """
-    env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
-#   env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=artifacts['doxydoc'])
+    Import('lumiera plugins tools gui testsuite')
     
-    env.Alias('install', artifacts['gui'])
+    env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
+#   env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
+    
+    env.Alias('install', gui)
     env.Alias('install', '$DESTDIR')
 
 #####################################################################
@@ -397,7 +396,6 @@ env = setupBasicEnvironment(localDefinitions)
 if not (isCleanupOperation(env) or isHelpRequest()):
     env = configurePlatform(env)
     
-artifacts = {}
 # the various things we build. 
 # Each entry actually is a SCons-Node list.
 # Passing these entries to other builders defines dependencies.
@@ -406,8 +404,8 @@ artifacts = {}
 # 'plugins'     : plugin shared lib
 # 'tools'       : small tool applications (e.g mpegtoc)
 
-defineSetupTargets(env, artifacts)
-defineBuildTargets(env, artifacts)
-definePostBuildTargets(env, artifacts)
-defineInstallTargets(env, artifacts)
+defineSetupTargets(env)
+defineBuildTargets(env)
+definePostBuildTargets(env)
+defineInstallTargets(env)
 
diff --git a/research/SConscript b/research/SConscript
index 0fef0dae8..1d3263a72 100644
--- a/research/SConscript
+++ b/research/SConscript
@@ -4,9 +4,8 @@
 ##                Things defined here usuall won't be installed
 ##
 
-Import('env','artifacts','core')
+Import('env core support_lib')
 
-support_lib = artifacts['support']
 
 
 
diff --git a/src/SConscript b/src/SConscript
index 10cea7404..c0718205d 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -7,7 +7,7 @@
 from Buildhelper import srcSubtree
 from Buildhelper import scanSubtree
 
-Import('env','artifacts')
+Import('env icons config')
 
 
 lLib  = env.SharedLibrary('lumiera',        srcSubtree('lib'),    install=True)
@@ -15,16 +15,16 @@ lApp  = env.SharedLibrary('lumieracommon',  srcSubtree('common'), install=True,
 lBack = env.SharedLibrary('lumierabackend', srcSubtree('backend'),install=True)
 lProc = env.SharedLibrary('lumieraproc',    srcSubtree('proc'),   install=True)
 
-core = lLib+lApp+lBack+lProc
+core        = lLib+lApp+lBack+lProc
+core_lib    = core
+support_lib = lLib
 
-artifacts['corelib'] = core
-artifacts['support'] = lLib
-artifacts['lumiera'] = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, install=True)
-                       + artifacts['config']
-                       )
+lumiera = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, install=True)
+          + config
+          )
 
 # building Lumiera Plugins
-artifacts['plugins'] = [] # currently none 
+plugins = [] # currently none 
 
 
 # the Lumiera GTK GUI
@@ -33,10 +33,10 @@ envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','xext','sm'
 envGtk.Append(LIBS=core)
 
 guimodule = envGtk.LumieraPlugin('gtk_gui', srcSubtree('gui'), install=True)
-artifacts['gui'] = ( guimodule
-                   + [env.GuiResource(f) for f in env.Glob('gui/*.rc')]
-                   + artifacts['icons']
-                   )
+gui       = ( guimodule
+            + icons
+            + [env.GuiResource(f) for f in env.Glob('gui/*.rc')]
+            )
 
 
-Export('core')
+Export('lumiera core core_lib support_lib plugins gui')
diff --git a/src/tool/SConscript b/src/tool/SConscript
index 49f03addf..85a858d5e 100644
--- a/src/tool/SConscript
+++ b/src/tool/SConscript
@@ -3,9 +3,8 @@
 ## SConscript  -  SCons buildscript for tool subdirectory (called by SConstruct)
 ##
 
-Import('env','artifacts','core')
+Import('env core support_lib icons')
 
-support_lib = artifacts['support']
 
 envSvg = env.Clone()
 envSvg.mergeConf(['librsvg-2.0'])
@@ -16,11 +15,12 @@ luidgen =    env.Program('luidgen', ['luidgen.c'] + support_lib, install=True)
 rsvg    = envSvg.Program('rsvg-convert','rsvg-convert.c')                        ## for rendering SVG icons (uses librsvg) 
 
 # build additional test and administrative tools....
-artifacts['tools'] = [ env.Program('hello-world','hello.c', install=True)      #### hello world (checks C build)      
-                     + luidgen
-                     + rsvg
-                     ]
+tools = [ env.Program('hello-world','hello.c', install=True)                   #### hello world (checks C build)      
+        + luidgen
+        + rsvg
+        ]
+Export('tools')
 
 # Rendering the SVG Icons depends on rsvg-convert
-env.Depends(artifacts['icons'], rsvg)
+env.Depends(icons, rsvg)
 
diff --git a/tests/SConscript b/tests/SConscript
index abbe86d35..12672cd79 100644
--- a/tests/SConscript
+++ b/tests/SConscript
@@ -12,7 +12,7 @@ from Buildhelper import scanSubtree
 from Buildhelper import globRootdirs
 from Buildhelper import createPlugins
 
-Import('env','artifacts','core')
+Import('env core tools config')
 env = env.Clone()
 env.Append(CPPPATH='include')  # additional headers for tests
 
@@ -56,27 +56,28 @@ moduledirs = globRootdirs('*')
 
 
 
-artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in ['lib','components'] ]
-                              + [ testCollection(env, dir) for dir in moduledirs if not dir in specials]
-                              + createPlugins(env, 'plugin')
-                              + env.File(glob('*.tests'))     # depending on the test definition files for test.sh
-                              + artifacts['config']
-                              )
+testsuite = ( [ testExecutable(env, dir) for dir in ['lib','components'] ]
+            + [ testCollection(env, dir) for dir in moduledirs if not dir in specials]
+            + createPlugins(env, 'plugin')
+            + env.File(glob('*.tests'))     # depending on the test definition files for test.sh
+            + config
+            )
+Export('testsuite')
 
 
 
 
 # for creating a Valgrind-Suppression file
 vgsuppr = env.Program('vgsuppression','tool/vgsuppression.c', LIBS=core)   ## for suppressing false valgrind alarms
-artifacts['tools'] += [vgsuppr]
-Depends(ts,vgsuppr)
+tools  += [vgsuppr]
+Depends(testsuite,vgsuppr)
 
 
 #
 # actually run the Testsuite
 #
 #  - the product of running the Testsuite is the ",testlog"
-#  - it depends on all artifacts defined as "ts" above
+#  - it depends on all artifacts defined as "testsuite" above
 #  - including the tests/*.tests (suite definition files)
 #  - if not set via options switch, the environment variables
 #    TESTSUITES and VALGRINDFLAGS are explicitly propagated to test.sh
@@ -106,7 +107,7 @@ testEnv['ENV']['TEST_CONF'] = env.File("test.conf").abspath
 testDir = env.Dir('#$TARGDIR')
 runTest = env.File("test.sh").abspath
 
-runTs = testEnv.Command('#$TARGDIR/,testlog', ts, runTest,  chdir=testDir)
+runTests = testEnv.Command('#$TARGDIR/,testlog', testsuite, runTest,  chdir=testDir)
 
 
 
@@ -115,8 +116,8 @@ runTs = testEnv.Command('#$TARGDIR/,testlog', ts, runTest,  chdir=testDir)
 #  - 'scons testcode' triggers building of the Testsuite
 #  - 'scons check' triggers building and running
 #
-env.Alias('testcode', ts )
-env.Alias('check', runTs )
+env.Alias('testcode', testsuite )
+env.Alias('check',    runTests )
 
 # allow tempfiles of test.sh to be cleaned  
 env.Clean ('check', [',testlog',',testlog.pre',',expect_stdout',',stdout',',stderr',',testtmp','.libs'])

From b3c7d90e413cf772d425e11bb89fa152ab57b682 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 9 Jan 2012 04:10:00 +0100
Subject: [PATCH 73/87] Move parts from main SConstruct into dedicated Python
 modules

---
 SConstruct              |   4 +
 admin/scons/Options.py  | 411 ++++++++++++++++++++++++++++++++++++++++
 admin/scons/Platform.py | 411 ++++++++++++++++++++++++++++++++++++++++
 admin/scons/Setup.py    | 411 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1237 insertions(+)
 create mode 100644 admin/scons/Options.py
 create mode 100644 admin/scons/Platform.py
 create mode 100644 admin/scons/Setup.py

diff --git a/SConstruct b/SConstruct
index 1170195d5..cd8165eae 100644
--- a/SConstruct
+++ b/SConstruct
@@ -68,6 +68,10 @@ from Buildhelper import *
 from LumieraEnvironment import *
 
 
+import Setup
+import Options
+import Platform
+
 #####################################################################
 
 def setupBasicEnvironment(localDefinitions):
diff --git a/admin/scons/Options.py b/admin/scons/Options.py
new file mode 100644
index 000000000..f919995de
--- /dev/null
+++ b/admin/scons/Options.py
@@ -0,0 +1,411 @@
+# -*- python -*-
+##
+## Options.py  -  SCons build: command line options and help
+##
+
+#  Copyright (C)         Lumiera.org
+#    2012,               Hermann Vosseler 
+#
+#  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.
+#####################################################################
+
+
+# NOTE: scons -h for help.
+# Read more about the SCons build system at: http://www.scons.org
+# Basically, this script just /defines/ the components and how they
+# fit together. SCons will derive the necessary build steps.
+
+
+#-----------------------------------Configuration
+TARGDIR      = 'target'
+VERSION      = '0.pre.01'
+TOOLDIR      = './admin/scons'    # SCons plugins
+SCRIPTDIR    = './admin'
+OPTCACHE     = 'optcache' 
+CUSTOPTFILE  = 'custom-options'
+
+# these are accessible via env.path.xxxx
+srcIcon      = 'icons'
+srcConf      = 'data/config'
+buildExe     = '#$TARGDIR'
+buildLib     = '#$TARGDIR/modules'
+buildPlug    = '#$TARGDIR/modules'
+buildIcon    = '#$TARGDIR/gui/icons'
+buildUIRes   = '#$TARGDIR/'
+buildConf    = '#$TARGDIR/config'
+installExe   = '#$DESTDIR/lib/lumiera'
+installLib   = '#$DESTDIR/lib/lumiera/modules'
+installPlug  = '#$DESTDIR/lib/lumiera/modules'
+installIcon  = '#$DESTDIR/share/lumiera/icons'
+installUIRes = '#$DESTDIR/share/lumiera/'
+installConf  = '#$DESTDIR/lib/lumiera/config'
+
+#-----------------------------------Configuration
+localDefinitions = locals()
+
+
+
+
+import os
+import sys
+
+sys.path.append(TOOLDIR)
+sys.path.append(SCRIPTDIR)
+
+from Buildhelper import *
+from LumieraEnvironment import *
+
+
+#####################################################################
+
+def setupBasicEnvironment(localDefinitions):
+    """ define cmdline options, build type decisions
+    """
+    EnsurePythonVersion(2,4)
+    EnsureSConsVersion(1,0)
+    
+    Decider('MD5-timestamp') # detect changed files by timestamp, then do a MD5
+    
+    vars = defineCmdlineVariables() 
+    env = LumieraEnvironment(variables=vars
+                            ,toolpath = [TOOLDIR]
+                            ,pathConfig = extract_localPathDefs(localDefinitions) # e.g. buildExe -> env.path.buildExe
+                            ,TARGDIR  = TARGDIR
+                            ,DESTDIR = '$INSTALLDIR/$PREFIX'
+                            ,VERSION = VERSION
+                            )
+    handleVerboseMessages(env)
+    
+    env.Replace( CPPPATH   =["#src"]    # used to find includes, "#" means always absolute to build-root
+               , CPPDEFINES=['LUMIERA_VERSION='+VERSION ]    # note: it's a list to append further defines
+               , CCFLAGS='-Wall -Wextra '
+               , CFLAGS='-std=gnu99' 
+               )
+    handleNoBugSwitches(env)
+    
+    env.Append(CPPDEFINES = '_GNU_SOURCE')
+    appendCppDefine(env,'DEBUG','DEBUG', 'NDEBUG')
+#   appendCppDefine(env,'OPENGL','USE_OPENGL')
+    appendVal(env,'ARCHFLAGS','CCFLAGS')   # for both C and C++
+    appendVal(env,'OPTIMIZE', 'CCFLAGS',   val=' -O3')
+    appendVal(env,'DEBUG',    'CCFLAGS',   val=' -ggdb')
+    
+    # setup search path for Lumiera plugins
+    appendCppDefine(env,'PKGLIBDIR','LUMIERA_PLUGIN_PATH=\\"$PKGLIBDIR/:ORIGIN/modules\\"'
+                                   ,'LUMIERA_PLUGIN_PATH=\\"ORIGIN/modules\\"') 
+    appendCppDefine(env,'PKGDATADIR','LUMIERA_CONFIG_PATH=\\"$PKGLIBDIR/:.\\"'
+                                    ,'LUMIERA_CONFIG_PATH=\\"$DESTDIR/share/lumiera/:.\\"') 
+    
+    prepareOptionsHelp(vars,env)
+    vars.Save(OPTCACHE, env)
+    return env
+
+def appendCppDefine(env,var,cppVar, elseVal=''):
+    if env[var]:
+        env.Append(CPPDEFINES = env.subst(cppVar) )
+    elif elseVal:
+        env.Append(CPPDEFINES = env.subst(elseVal))
+
+def appendVal(env,var,targetVar,val=None):
+    if env[var]:
+        env.Append( **{targetVar: env.subst(val) or env[var]})
+
+
+def handleNoBugSwitches(env):
+    """ set the build level for NoBug. 
+        Release builds imply no DEBUG
+        whereas ALPHA and BETA require DEBUG
+    """
+    level = env['BUILDLEVEL']
+    if level in ['ALPHA', 'BETA']:
+        if not env['DEBUG']:
+            print 'Warning: NoBug ALPHA or BETA builds requires DEBUG=yes, switching DEBUG on!'
+        env.Replace( DEBUG = 1 )
+        env.Append(CPPDEFINES = 'EBUG_'+level)
+    elif level == 'RELEASE':
+        env.Replace( DEBUG = 0 )
+
+def handleVerboseMessages(env):
+    """ toggle verbose build output """
+    if not env['VERBOSE']:
+       # SetOption('silent', True)
+       env['CCCOMSTR'] = env['SHCCCOMSTR']   = "  Compiling    $SOURCE"
+       env['CXXCOMSTR'] = env['SHCXXCOMSTR'] = "  Compiling++  $SOURCE"
+       env['LINKCOMSTR']                     = "  Linking -->  $TARGET"
+       env['LDMODULECOMSTR']                 = "  creating module [ $TARGET ]"
+
+
+
+
+def defineCmdlineVariables():
+    """ several toggles and configuration variables can be set on the commandline,
+        current settings will be persisted in a options cache file.
+        you may define custom variable settings in a separate file. 
+        Commandline will override both.
+    """
+    vars = Variables([OPTCACHE, CUSTOPTFILE])
+    vars.AddVariables(
+         ('ARCHFLAGS', 'Set architecture-specific compilation flags (passed literally to gcc)','')
+        ,('CC', 'Set the C compiler to use.', 'gcc')
+        ,('CXX', 'Set the C++ compiler to use.', 'g++')
+        ,PathVariable('CCACHE', 'Integrate with CCache', '', PathVariable.PathAccept)
+        ,PathVariable('DISTCC', 'Invoke C/C++ compiler commands through DistCC', '', PathVariable.PathAccept)
+        ,EnumVariable('BUILDLEVEL', 'NoBug build level for debugging', 'ALPHA', allowed_values=('ALPHA', 'BETA', 'RELEASE'))
+        ,BoolVariable('DEBUG', 'Build with debugging information and no optimisations', False)
+        ,BoolVariable('OPTIMIZE', 'Build with strong optimisation (-O3)', False)
+        ,BoolVariable('VALGRIND', 'Run Testsuite under valgrind control', True)
+        ,BoolVariable('VERBOSE',  'Print full build commands', False)
+        ,('TESTSUITES', 'Run only Testsuites matching the given pattern', '')
+#       ,BoolVariable('OPENGL', 'Include support for OpenGL preview rendering', False)
+#       ,EnumVariable('DIST_TARGET', 'Build target architecture', 'auto', 
+#                   allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2)
+        ,PathVariable('PREFIX', 'Installation dir prefix', 'usr/local', PathVariable.PathAccept)
+        ,PathVariable('INSTALLDIR', 'Root output directory for install. Final installation will happen in INSTALLDIR/PREFIX/... ', '/', PathVariable.PathIsDir)
+        ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept)
+        ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept)
+     )
+    
+    return vars
+
+
+
+def prepareOptionsHelp(vars,env):
+    prelude = """
+USAGE:   scons [-c] [OPTS] [key=val [key=val...]] [TARGETS]
+     Build and optionally install Lumiera.
+     Without specifying any target, just the (re)build target will run.
+     Add -c to the commandline to clean up anything a given target would produce
+
+Special Targets:
+     build   : just compile and link
+     research: build experimental code (might fail)
+     testcode: additionally compile the Testsuite
+     check   : build and run the Testsuite
+     doc     : generate documentation (Doxygen)
+     all     : build and testcode and doc
+     install : install created artifacts at PREFIX
+
+Configuration Options:
+"""
+    Help(prelude + vars.GenerateHelpText(env))
+
+
+
+
+def configurePlatform(env):
+    """ locate required libs.
+        setup platform specific options.
+        Abort build in case of failure.
+    """
+    conf = env.Configure()
+    # run all configuration checks in the given env
+    
+    # Perform checks for prerequisites --------------------------------------------
+    problems = []
+    if not conf.TryAction('pkg-config --version > $TARGET')[0]:
+        problems.append('We need pkg-config for including library configurations, exiting.')
+    
+    if not conf.CheckLibWithHeader('m', 'math.h','C'):
+        problems.append('Did not find math.h / libm.')
+    
+    if not conf.CheckLibWithHeader('dl', 'dlfcn.h', 'C'):
+        problems.append('Functions for runtime dynamic loading not available.')
+    
+    if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
+        problems.append('Did not find the pthread lib or pthread.h.')
+    else:
+       conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD')
+       conf.env.Append(CCFLAGS = ' -pthread')
+    
+    if conf.CheckCHeader('execinfo.h'):
+       conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H')
+    
+    if conf.CheckCHeader('valgrind/valgrind.h'):
+        conf.env.Append(CPPFLAGS = ' -DHAVE_VALGRIND_H')
+    else:
+        print 'Valgrind not found. The use of Valgrind is optional; building without.'
+    
+    if not conf.CheckPkgConfig('nobugmt', 201006.1):
+        problems.append('Did not find NoBug [http://www.lumiera.org/nobug_manual.html].')
+    else:
+        conf.env.mergeConf('nobugmt')
+    
+    if not conf.CheckCXXHeader('tr1/memory'):
+        problems.append('We rely on the std::tr1 standard C++ extension for shared_ptr.')
+    
+    if not conf.CheckCXXHeader('boost/config.hpp'):
+        problems.append('We need the C++ boost-libraries.')
+    else:
+        if not conf.CheckCXXHeader('boost/scoped_ptr.hpp'):
+            problems.append('We need boost::scoped_ptr (scoped_ptr.hpp).')
+        if not conf.CheckCXXHeader('boost/format.hpp'):
+            problems.append('We need boost::format (header).')
+        if not conf.CheckLibWithHeader('boost_program_options-mt','boost/program_options.hpp','C++'):
+            problems.append('We need boost::program_options (including binary lib for linking).')
+        if not conf.CheckLibWithHeader('boost_system-mt','boost/system/error_code.hpp','C++'):
+            problems.append('We need the boost::system support library (including binary lib).')
+        if not conf.CheckLibWithHeader('boost_filesystem-mt','boost/filesystem.hpp','C++'):
+            problems.append('We need the boost::filesystem lib (including binary lib for linking).')
+        if not conf.CheckLibWithHeader('boost_regex-mt','boost/regex.hpp','C++'):
+            problems.append('We need the boost regular expression lib (incl. binary lib for linking).')
+    
+    
+    if conf.CheckLib(symbol='clock_gettime'):
+        print 'Using function clock_gettime() as defined in the C-lib...'
+    else:
+        if not conf.CheckLib(symbol='clock_gettime', library='rt'):
+            problems.append('No library known to provide the clock_gettime() function.')
+    
+    if not conf.CheckPkgConfig('gavl', 1.0):
+        problems.append('Did not find Gmerlin Audio Video Lib [http://gmerlin.sourceforge.net/gavl.html].')
+    else:
+        conf.env.mergeConf('gavl')
+    
+    if not conf.CheckPkgConfig('gtkmm-2.4', 2.8):
+        problems.append('Unable to configure GTK--')
+        
+    if not conf.CheckPkgConfig('glibmm-2.4', '2.16'):
+        problems.append('Unable to configure Lib glib--')
+    
+    if not conf.CheckPkgConfig('gthread-2.0', '2.12.4'):
+        problems.append('Need gthread support lib for glib-- based thread handling.')
+    
+    if not conf.CheckPkgConfig('cairomm-1.0', 0.6):
+        problems.append('Unable to configure Cairo--')
+    
+    verGDL = '2.27.1'
+    if not conf.CheckPkgConfig('gdl-1.0', verGDL, alias='gdl'):
+        print 'No sufficiently recent (>=%s) version of GDL found. Maybe use custom package gdl-lum?' % verGDL
+        if not conf.CheckPkgConfig('gdl-lum', verGDL, alias='gdl'):
+            problems.append('GNOME Docking Library not found. We either need a sufficiently recent GDL '
+                            'version (>=%s), or the custom package "gdl-lum" from Lumiera.org.' % verGDL)
+    
+    if not conf.CheckPkgConfig('librsvg-2.0', '2.18.1'):
+        problems.append('Need rsvg Library for rendering icons.')
+        
+    if not conf.CheckCHeader(['X11/Xutil.h', 'X11/Xlib.h'],'<>'):
+        problems.append('Xlib.h and Xutil.h required. Please install libx11-dev.')
+    
+    if not conf.CheckPkgConfig('xv')  : problems.append('Need libXv...')
+    if not conf.CheckPkgConfig('xext'): problems.append('Need libXext.')
+    
+    
+    # report missing dependencies
+    if problems:
+        print "*** unable to build due to the following problems:"
+        for isue in problems:
+            print " *  %s" % isue
+        print
+        print "build aborted."
+        Exit(1)
+    
+    print "** Gathered Library Info: %s" % conf.env.libInfo.keys()
+    
+    
+    # create new env containing the finished configuration
+    return conf.Finish()
+
+
+
+def defineSetupTargets(env):
+    """ build operations and targets to be done /before/ compiling.
+        things like creating a source tarball or preparing a version header.
+    """
+    pass    ## currently none
+
+
+
+def defineBuildTargets(env):
+    """ define the source file/dirs comprising each artifact to be built.
+        setup sub-environments with special build options if necessary.
+        We use a custom function to declare a whole tree of srcfiles. 
+    """
+    
+    # define Icons to render and install
+    vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
+    prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
+    icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
+              + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
+              )
+    
+    #define Configuration files to install
+    config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
+              + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
+              )
+    
+    # call subdir SConscript(s) for independent components
+    SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
+
+
+
+def definePostBuildTargets(env):
+    """ define further actions after the core build (e.g. Documentation).
+        define alias targets to trigger the installing.
+    """
+    Import('lumiera plugins tools gui testsuite')
+    build = env.Alias('build', lumiera + plugins + tools +gui)
+    
+    # additional files to be cleaned when cleaning 'build'
+    env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
+    env.Clean ('build', [ 'src/pre.gch' ])
+    
+    doxydoc = env.Doxygen('doc/devel/Doxyfile')
+    env.Alias ('doc', doxydoc)
+    env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
+    
+    env.Alias ('all', build + testsuite + doxydoc)
+    env.Default('build')
+    # SCons default target
+
+
+def defineInstallTargets(env):
+    """ define additional artifacts to be installed into target locations.
+        @note: we use customised SCons builders defining install targets 
+               for all executables automatically. see LumieraEnvironment.py
+    """
+    Import('lumiera plugins tools gui testsuite')
+    
+    env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
+#   env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
+    
+    env.Alias('install', gui)
+    env.Alias('install', '$DESTDIR')
+
+#####################################################################
+
+
+
+
+
+### === MAIN === ####################################################
+
+env = setupBasicEnvironment(localDefinitions)
+
+if not (isCleanupOperation(env) or isHelpRequest()):
+    env = configurePlatform(env)
+    
+# the various things we build. 
+# Each entry actually is a SCons-Node list.
+# Passing these entries to other builders defines dependencies.
+# 'lumiera'     : the App
+# 'gui'         : the GTK UI (plugin)
+# 'plugins'     : plugin shared lib
+# 'tools'       : small tool applications (e.g mpegtoc)
+
+defineSetupTargets(env)
+defineBuildTargets(env)
+definePostBuildTargets(env)
+defineInstallTargets(env)
+
diff --git a/admin/scons/Platform.py b/admin/scons/Platform.py
new file mode 100644
index 000000000..e8f9d050b
--- /dev/null
+++ b/admin/scons/Platform.py
@@ -0,0 +1,411 @@
+# -*- python -*-
+##
+## Platform.py  -  SCons build: platform configuration and library detection
+##
+
+#  Copyright (C)         Lumiera.org
+#    2012,               Hermann Vosseler 
+#
+#  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.
+#####################################################################
+
+
+# NOTE: scons -h for help.
+# Read more about the SCons build system at: http://www.scons.org
+# Basically, this script just /defines/ the components and how they
+# fit together. SCons will derive the necessary build steps.
+
+
+#-----------------------------------Configuration
+TARGDIR      = 'target'
+VERSION      = '0.pre.01'
+TOOLDIR      = './admin/scons'    # SCons plugins
+SCRIPTDIR    = './admin'
+OPTCACHE     = 'optcache' 
+CUSTOPTFILE  = 'custom-options'
+
+# these are accessible via env.path.xxxx
+srcIcon      = 'icons'
+srcConf      = 'data/config'
+buildExe     = '#$TARGDIR'
+buildLib     = '#$TARGDIR/modules'
+buildPlug    = '#$TARGDIR/modules'
+buildIcon    = '#$TARGDIR/gui/icons'
+buildUIRes   = '#$TARGDIR/'
+buildConf    = '#$TARGDIR/config'
+installExe   = '#$DESTDIR/lib/lumiera'
+installLib   = '#$DESTDIR/lib/lumiera/modules'
+installPlug  = '#$DESTDIR/lib/lumiera/modules'
+installIcon  = '#$DESTDIR/share/lumiera/icons'
+installUIRes = '#$DESTDIR/share/lumiera/'
+installConf  = '#$DESTDIR/lib/lumiera/config'
+
+#-----------------------------------Configuration
+localDefinitions = locals()
+
+
+
+
+import os
+import sys
+
+sys.path.append(TOOLDIR)
+sys.path.append(SCRIPTDIR)
+
+from Buildhelper import *
+from LumieraEnvironment import *
+
+
+#####################################################################
+
+def setupBasicEnvironment(localDefinitions):
+    """ define cmdline options, build type decisions
+    """
+    EnsurePythonVersion(2,4)
+    EnsureSConsVersion(1,0)
+    
+    Decider('MD5-timestamp') # detect changed files by timestamp, then do a MD5
+    
+    vars = defineCmdlineVariables() 
+    env = LumieraEnvironment(variables=vars
+                            ,toolpath = [TOOLDIR]
+                            ,pathConfig = extract_localPathDefs(localDefinitions) # e.g. buildExe -> env.path.buildExe
+                            ,TARGDIR  = TARGDIR
+                            ,DESTDIR = '$INSTALLDIR/$PREFIX'
+                            ,VERSION = VERSION
+                            )
+    handleVerboseMessages(env)
+    
+    env.Replace( CPPPATH   =["#src"]    # used to find includes, "#" means always absolute to build-root
+               , CPPDEFINES=['LUMIERA_VERSION='+VERSION ]    # note: it's a list to append further defines
+               , CCFLAGS='-Wall -Wextra '
+               , CFLAGS='-std=gnu99' 
+               )
+    handleNoBugSwitches(env)
+    
+    env.Append(CPPDEFINES = '_GNU_SOURCE')
+    appendCppDefine(env,'DEBUG','DEBUG', 'NDEBUG')
+#   appendCppDefine(env,'OPENGL','USE_OPENGL')
+    appendVal(env,'ARCHFLAGS','CCFLAGS')   # for both C and C++
+    appendVal(env,'OPTIMIZE', 'CCFLAGS',   val=' -O3')
+    appendVal(env,'DEBUG',    'CCFLAGS',   val=' -ggdb')
+    
+    # setup search path for Lumiera plugins
+    appendCppDefine(env,'PKGLIBDIR','LUMIERA_PLUGIN_PATH=\\"$PKGLIBDIR/:ORIGIN/modules\\"'
+                                   ,'LUMIERA_PLUGIN_PATH=\\"ORIGIN/modules\\"') 
+    appendCppDefine(env,'PKGDATADIR','LUMIERA_CONFIG_PATH=\\"$PKGLIBDIR/:.\\"'
+                                    ,'LUMIERA_CONFIG_PATH=\\"$DESTDIR/share/lumiera/:.\\"') 
+    
+    prepareOptionsHelp(vars,env)
+    vars.Save(OPTCACHE, env)
+    return env
+
+def appendCppDefine(env,var,cppVar, elseVal=''):
+    if env[var]:
+        env.Append(CPPDEFINES = env.subst(cppVar) )
+    elif elseVal:
+        env.Append(CPPDEFINES = env.subst(elseVal))
+
+def appendVal(env,var,targetVar,val=None):
+    if env[var]:
+        env.Append( **{targetVar: env.subst(val) or env[var]})
+
+
+def handleNoBugSwitches(env):
+    """ set the build level for NoBug. 
+        Release builds imply no DEBUG
+        whereas ALPHA and BETA require DEBUG
+    """
+    level = env['BUILDLEVEL']
+    if level in ['ALPHA', 'BETA']:
+        if not env['DEBUG']:
+            print 'Warning: NoBug ALPHA or BETA builds requires DEBUG=yes, switching DEBUG on!'
+        env.Replace( DEBUG = 1 )
+        env.Append(CPPDEFINES = 'EBUG_'+level)
+    elif level == 'RELEASE':
+        env.Replace( DEBUG = 0 )
+
+def handleVerboseMessages(env):
+    """ toggle verbose build output """
+    if not env['VERBOSE']:
+       # SetOption('silent', True)
+       env['CCCOMSTR'] = env['SHCCCOMSTR']   = "  Compiling    $SOURCE"
+       env['CXXCOMSTR'] = env['SHCXXCOMSTR'] = "  Compiling++  $SOURCE"
+       env['LINKCOMSTR']                     = "  Linking -->  $TARGET"
+       env['LDMODULECOMSTR']                 = "  creating module [ $TARGET ]"
+
+
+
+
+def defineCmdlineVariables():
+    """ several toggles and configuration variables can be set on the commandline,
+        current settings will be persisted in a options cache file.
+        you may define custom variable settings in a separate file. 
+        Commandline will override both.
+    """
+    vars = Variables([OPTCACHE, CUSTOPTFILE])
+    vars.AddVariables(
+         ('ARCHFLAGS', 'Set architecture-specific compilation flags (passed literally to gcc)','')
+        ,('CC', 'Set the C compiler to use.', 'gcc')
+        ,('CXX', 'Set the C++ compiler to use.', 'g++')
+        ,PathVariable('CCACHE', 'Integrate with CCache', '', PathVariable.PathAccept)
+        ,PathVariable('DISTCC', 'Invoke C/C++ compiler commands through DistCC', '', PathVariable.PathAccept)
+        ,EnumVariable('BUILDLEVEL', 'NoBug build level for debugging', 'ALPHA', allowed_values=('ALPHA', 'BETA', 'RELEASE'))
+        ,BoolVariable('DEBUG', 'Build with debugging information and no optimisations', False)
+        ,BoolVariable('OPTIMIZE', 'Build with strong optimisation (-O3)', False)
+        ,BoolVariable('VALGRIND', 'Run Testsuite under valgrind control', True)
+        ,BoolVariable('VERBOSE',  'Print full build commands', False)
+        ,('TESTSUITES', 'Run only Testsuites matching the given pattern', '')
+#       ,BoolVariable('OPENGL', 'Include support for OpenGL preview rendering', False)
+#       ,EnumVariable('DIST_TARGET', 'Build target architecture', 'auto', 
+#                   allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2)
+        ,PathVariable('PREFIX', 'Installation dir prefix', 'usr/local', PathVariable.PathAccept)
+        ,PathVariable('INSTALLDIR', 'Root output directory for install. Final installation will happen in INSTALLDIR/PREFIX/... ', '/', PathVariable.PathIsDir)
+        ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept)
+        ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept)
+     )
+    
+    return vars
+
+
+
+def prepareOptionsHelp(vars,env):
+    prelude = """
+USAGE:   scons [-c] [OPTS] [key=val [key=val...]] [TARGETS]
+     Build and optionally install Lumiera.
+     Without specifying any target, just the (re)build target will run.
+     Add -c to the commandline to clean up anything a given target would produce
+
+Special Targets:
+     build   : just compile and link
+     research: build experimental code (might fail)
+     testcode: additionally compile the Testsuite
+     check   : build and run the Testsuite
+     doc     : generate documentation (Doxygen)
+     all     : build and testcode and doc
+     install : install created artifacts at PREFIX
+
+Configuration Options:
+"""
+    Help(prelude + vars.GenerateHelpText(env))
+
+
+
+
+def configurePlatform(env):
+    """ locate required libs.
+        setup platform specific options.
+        Abort build in case of failure.
+    """
+    conf = env.Configure()
+    # run all configuration checks in the given env
+    
+    # Perform checks for prerequisites --------------------------------------------
+    problems = []
+    if not conf.TryAction('pkg-config --version > $TARGET')[0]:
+        problems.append('We need pkg-config for including library configurations, exiting.')
+    
+    if not conf.CheckLibWithHeader('m', 'math.h','C'):
+        problems.append('Did not find math.h / libm.')
+    
+    if not conf.CheckLibWithHeader('dl', 'dlfcn.h', 'C'):
+        problems.append('Functions for runtime dynamic loading not available.')
+    
+    if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
+        problems.append('Did not find the pthread lib or pthread.h.')
+    else:
+       conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD')
+       conf.env.Append(CCFLAGS = ' -pthread')
+    
+    if conf.CheckCHeader('execinfo.h'):
+       conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H')
+    
+    if conf.CheckCHeader('valgrind/valgrind.h'):
+        conf.env.Append(CPPFLAGS = ' -DHAVE_VALGRIND_H')
+    else:
+        print 'Valgrind not found. The use of Valgrind is optional; building without.'
+    
+    if not conf.CheckPkgConfig('nobugmt', 201006.1):
+        problems.append('Did not find NoBug [http://www.lumiera.org/nobug_manual.html].')
+    else:
+        conf.env.mergeConf('nobugmt')
+    
+    if not conf.CheckCXXHeader('tr1/memory'):
+        problems.append('We rely on the std::tr1 standard C++ extension for shared_ptr.')
+    
+    if not conf.CheckCXXHeader('boost/config.hpp'):
+        problems.append('We need the C++ boost-libraries.')
+    else:
+        if not conf.CheckCXXHeader('boost/scoped_ptr.hpp'):
+            problems.append('We need boost::scoped_ptr (scoped_ptr.hpp).')
+        if not conf.CheckCXXHeader('boost/format.hpp'):
+            problems.append('We need boost::format (header).')
+        if not conf.CheckLibWithHeader('boost_program_options-mt','boost/program_options.hpp','C++'):
+            problems.append('We need boost::program_options (including binary lib for linking).')
+        if not conf.CheckLibWithHeader('boost_system-mt','boost/system/error_code.hpp','C++'):
+            problems.append('We need the boost::system support library (including binary lib).')
+        if not conf.CheckLibWithHeader('boost_filesystem-mt','boost/filesystem.hpp','C++'):
+            problems.append('We need the boost::filesystem lib (including binary lib for linking).')
+        if not conf.CheckLibWithHeader('boost_regex-mt','boost/regex.hpp','C++'):
+            problems.append('We need the boost regular expression lib (incl. binary lib for linking).')
+    
+    
+    if conf.CheckLib(symbol='clock_gettime'):
+        print 'Using function clock_gettime() as defined in the C-lib...'
+    else:
+        if not conf.CheckLib(symbol='clock_gettime', library='rt'):
+            problems.append('No library known to provide the clock_gettime() function.')
+    
+    if not conf.CheckPkgConfig('gavl', 1.0):
+        problems.append('Did not find Gmerlin Audio Video Lib [http://gmerlin.sourceforge.net/gavl.html].')
+    else:
+        conf.env.mergeConf('gavl')
+    
+    if not conf.CheckPkgConfig('gtkmm-2.4', 2.8):
+        problems.append('Unable to configure GTK--')
+        
+    if not conf.CheckPkgConfig('glibmm-2.4', '2.16'):
+        problems.append('Unable to configure Lib glib--')
+    
+    if not conf.CheckPkgConfig('gthread-2.0', '2.12.4'):
+        problems.append('Need gthread support lib for glib-- based thread handling.')
+    
+    if not conf.CheckPkgConfig('cairomm-1.0', 0.6):
+        problems.append('Unable to configure Cairo--')
+    
+    verGDL = '2.27.1'
+    if not conf.CheckPkgConfig('gdl-1.0', verGDL, alias='gdl'):
+        print 'No sufficiently recent (>=%s) version of GDL found. Maybe use custom package gdl-lum?' % verGDL
+        if not conf.CheckPkgConfig('gdl-lum', verGDL, alias='gdl'):
+            problems.append('GNOME Docking Library not found. We either need a sufficiently recent GDL '
+                            'version (>=%s), or the custom package "gdl-lum" from Lumiera.org.' % verGDL)
+    
+    if not conf.CheckPkgConfig('librsvg-2.0', '2.18.1'):
+        problems.append('Need rsvg Library for rendering icons.')
+        
+    if not conf.CheckCHeader(['X11/Xutil.h', 'X11/Xlib.h'],'<>'):
+        problems.append('Xlib.h and Xutil.h required. Please install libx11-dev.')
+    
+    if not conf.CheckPkgConfig('xv')  : problems.append('Need libXv...')
+    if not conf.CheckPkgConfig('xext'): problems.append('Need libXext.')
+    
+    
+    # report missing dependencies
+    if problems:
+        print "*** unable to build due to the following problems:"
+        for isue in problems:
+            print " *  %s" % isue
+        print
+        print "build aborted."
+        Exit(1)
+    
+    print "** Gathered Library Info: %s" % conf.env.libInfo.keys()
+    
+    
+    # create new env containing the finished configuration
+    return conf.Finish()
+
+
+
+def defineSetupTargets(env):
+    """ build operations and targets to be done /before/ compiling.
+        things like creating a source tarball or preparing a version header.
+    """
+    pass    ## currently none
+
+
+
+def defineBuildTargets(env):
+    """ define the source file/dirs comprising each artifact to be built.
+        setup sub-environments with special build options if necessary.
+        We use a custom function to declare a whole tree of srcfiles. 
+    """
+    
+    # define Icons to render and install
+    vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
+    prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
+    icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
+              + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
+              )
+    
+    #define Configuration files to install
+    config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
+              + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
+              )
+    
+    # call subdir SConscript(s) for independent components
+    SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
+
+
+
+def definePostBuildTargets(env):
+    """ define further actions after the core build (e.g. Documentation).
+        define alias targets to trigger the installing.
+    """
+    Import('lumiera plugins tools gui testsuite')
+    build = env.Alias('build', lumiera + plugins + tools +gui)
+    
+    # additional files to be cleaned when cleaning 'build'
+    env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
+    env.Clean ('build', [ 'src/pre.gch' ])
+    
+    doxydoc = env.Doxygen('doc/devel/Doxyfile')
+    env.Alias ('doc', doxydoc)
+    env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
+    
+    env.Alias ('all', build + testsuite + doxydoc)
+    env.Default('build')
+    # SCons default target
+
+
+def defineInstallTargets(env):
+    """ define additional artifacts to be installed into target locations.
+        @note: we use customised SCons builders defining install targets 
+               for all executables automatically. see LumieraEnvironment.py
+    """
+    Import('lumiera plugins tools gui testsuite')
+    
+    env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
+#   env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
+    
+    env.Alias('install', gui)
+    env.Alias('install', '$DESTDIR')
+
+#####################################################################
+
+
+
+
+
+### === MAIN === ####################################################
+
+env = setupBasicEnvironment(localDefinitions)
+
+if not (isCleanupOperation(env) or isHelpRequest()):
+    env = configurePlatform(env)
+    
+# the various things we build. 
+# Each entry actually is a SCons-Node list.
+# Passing these entries to other builders defines dependencies.
+# 'lumiera'     : the App
+# 'gui'         : the GTK UI (plugin)
+# 'plugins'     : plugin shared lib
+# 'tools'       : small tool applications (e.g mpegtoc)
+
+defineSetupTargets(env)
+defineBuildTargets(env)
+definePostBuildTargets(env)
+defineInstallTargets(env)
+
diff --git a/admin/scons/Setup.py b/admin/scons/Setup.py
new file mode 100644
index 000000000..d910b04de
--- /dev/null
+++ b/admin/scons/Setup.py
@@ -0,0 +1,411 @@
+# -*- python -*-
+##
+## Setup.py  -  SCons build: setup, definitions and compiler flags
+##
+
+#  Copyright (C)         Lumiera.org
+#    2012,               Hermann Vosseler 
+#
+#  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.
+#####################################################################
+
+
+# NOTE: scons -h for help.
+# Read more about the SCons build system at: http://www.scons.org
+# Basically, this script just /defines/ the components and how they
+# fit together. SCons will derive the necessary build steps.
+
+
+#-----------------------------------Configuration
+TARGDIR      = 'target'
+VERSION      = '0.pre.01'
+TOOLDIR      = './admin/scons'    # SCons plugins
+SCRIPTDIR    = './admin'
+OPTCACHE     = 'optcache' 
+CUSTOPTFILE  = 'custom-options'
+
+# these are accessible via env.path.xxxx
+srcIcon      = 'icons'
+srcConf      = 'data/config'
+buildExe     = '#$TARGDIR'
+buildLib     = '#$TARGDIR/modules'
+buildPlug    = '#$TARGDIR/modules'
+buildIcon    = '#$TARGDIR/gui/icons'
+buildUIRes   = '#$TARGDIR/'
+buildConf    = '#$TARGDIR/config'
+installExe   = '#$DESTDIR/lib/lumiera'
+installLib   = '#$DESTDIR/lib/lumiera/modules'
+installPlug  = '#$DESTDIR/lib/lumiera/modules'
+installIcon  = '#$DESTDIR/share/lumiera/icons'
+installUIRes = '#$DESTDIR/share/lumiera/'
+installConf  = '#$DESTDIR/lib/lumiera/config'
+
+#-----------------------------------Configuration
+localDefinitions = locals()
+
+
+
+
+import os
+import sys
+
+sys.path.append(TOOLDIR)
+sys.path.append(SCRIPTDIR)
+
+from Buildhelper import *
+from LumieraEnvironment import *
+
+
+#####################################################################
+
+def setupBasicEnvironment(localDefinitions):
+    """ define cmdline options, build type decisions
+    """
+    EnsurePythonVersion(2,4)
+    EnsureSConsVersion(1,0)
+    
+    Decider('MD5-timestamp') # detect changed files by timestamp, then do a MD5
+    
+    vars = defineCmdlineVariables() 
+    env = LumieraEnvironment(variables=vars
+                            ,toolpath = [TOOLDIR]
+                            ,pathConfig = extract_localPathDefs(localDefinitions) # e.g. buildExe -> env.path.buildExe
+                            ,TARGDIR  = TARGDIR
+                            ,DESTDIR = '$INSTALLDIR/$PREFIX'
+                            ,VERSION = VERSION
+                            )
+    handleVerboseMessages(env)
+    
+    env.Replace( CPPPATH   =["#src"]    # used to find includes, "#" means always absolute to build-root
+               , CPPDEFINES=['LUMIERA_VERSION='+VERSION ]    # note: it's a list to append further defines
+               , CCFLAGS='-Wall -Wextra '
+               , CFLAGS='-std=gnu99' 
+               )
+    handleNoBugSwitches(env)
+    
+    env.Append(CPPDEFINES = '_GNU_SOURCE')
+    appendCppDefine(env,'DEBUG','DEBUG', 'NDEBUG')
+#   appendCppDefine(env,'OPENGL','USE_OPENGL')
+    appendVal(env,'ARCHFLAGS','CCFLAGS')   # for both C and C++
+    appendVal(env,'OPTIMIZE', 'CCFLAGS',   val=' -O3')
+    appendVal(env,'DEBUG',    'CCFLAGS',   val=' -ggdb')
+    
+    # setup search path for Lumiera plugins
+    appendCppDefine(env,'PKGLIBDIR','LUMIERA_PLUGIN_PATH=\\"$PKGLIBDIR/:ORIGIN/modules\\"'
+                                   ,'LUMIERA_PLUGIN_PATH=\\"ORIGIN/modules\\"') 
+    appendCppDefine(env,'PKGDATADIR','LUMIERA_CONFIG_PATH=\\"$PKGLIBDIR/:.\\"'
+                                    ,'LUMIERA_CONFIG_PATH=\\"$DESTDIR/share/lumiera/:.\\"') 
+    
+    prepareOptionsHelp(vars,env)
+    vars.Save(OPTCACHE, env)
+    return env
+
+def appendCppDefine(env,var,cppVar, elseVal=''):
+    if env[var]:
+        env.Append(CPPDEFINES = env.subst(cppVar) )
+    elif elseVal:
+        env.Append(CPPDEFINES = env.subst(elseVal))
+
+def appendVal(env,var,targetVar,val=None):
+    if env[var]:
+        env.Append( **{targetVar: env.subst(val) or env[var]})
+
+
+def handleNoBugSwitches(env):
+    """ set the build level for NoBug. 
+        Release builds imply no DEBUG
+        whereas ALPHA and BETA require DEBUG
+    """
+    level = env['BUILDLEVEL']
+    if level in ['ALPHA', 'BETA']:
+        if not env['DEBUG']:
+            print 'Warning: NoBug ALPHA or BETA builds requires DEBUG=yes, switching DEBUG on!'
+        env.Replace( DEBUG = 1 )
+        env.Append(CPPDEFINES = 'EBUG_'+level)
+    elif level == 'RELEASE':
+        env.Replace( DEBUG = 0 )
+
+def handleVerboseMessages(env):
+    """ toggle verbose build output """
+    if not env['VERBOSE']:
+       # SetOption('silent', True)
+       env['CCCOMSTR'] = env['SHCCCOMSTR']   = "  Compiling    $SOURCE"
+       env['CXXCOMSTR'] = env['SHCXXCOMSTR'] = "  Compiling++  $SOURCE"
+       env['LINKCOMSTR']                     = "  Linking -->  $TARGET"
+       env['LDMODULECOMSTR']                 = "  creating module [ $TARGET ]"
+
+
+
+
+def defineCmdlineVariables():
+    """ several toggles and configuration variables can be set on the commandline,
+        current settings will be persisted in a options cache file.
+        you may define custom variable settings in a separate file. 
+        Commandline will override both.
+    """
+    vars = Variables([OPTCACHE, CUSTOPTFILE])
+    vars.AddVariables(
+         ('ARCHFLAGS', 'Set architecture-specific compilation flags (passed literally to gcc)','')
+        ,('CC', 'Set the C compiler to use.', 'gcc')
+        ,('CXX', 'Set the C++ compiler to use.', 'g++')
+        ,PathVariable('CCACHE', 'Integrate with CCache', '', PathVariable.PathAccept)
+        ,PathVariable('DISTCC', 'Invoke C/C++ compiler commands through DistCC', '', PathVariable.PathAccept)
+        ,EnumVariable('BUILDLEVEL', 'NoBug build level for debugging', 'ALPHA', allowed_values=('ALPHA', 'BETA', 'RELEASE'))
+        ,BoolVariable('DEBUG', 'Build with debugging information and no optimisations', False)
+        ,BoolVariable('OPTIMIZE', 'Build with strong optimisation (-O3)', False)
+        ,BoolVariable('VALGRIND', 'Run Testsuite under valgrind control', True)
+        ,BoolVariable('VERBOSE',  'Print full build commands', False)
+        ,('TESTSUITES', 'Run only Testsuites matching the given pattern', '')
+#       ,BoolVariable('OPENGL', 'Include support for OpenGL preview rendering', False)
+#       ,EnumVariable('DIST_TARGET', 'Build target architecture', 'auto', 
+#                   allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2)
+        ,PathVariable('PREFIX', 'Installation dir prefix', 'usr/local', PathVariable.PathAccept)
+        ,PathVariable('INSTALLDIR', 'Root output directory for install. Final installation will happen in INSTALLDIR/PREFIX/... ', '/', PathVariable.PathIsDir)
+        ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept)
+        ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept)
+     )
+    
+    return vars
+
+
+
+def prepareOptionsHelp(vars,env):
+    prelude = """
+USAGE:   scons [-c] [OPTS] [key=val [key=val...]] [TARGETS]
+     Build and optionally install Lumiera.
+     Without specifying any target, just the (re)build target will run.
+     Add -c to the commandline to clean up anything a given target would produce
+
+Special Targets:
+     build   : just compile and link
+     research: build experimental code (might fail)
+     testcode: additionally compile the Testsuite
+     check   : build and run the Testsuite
+     doc     : generate documentation (Doxygen)
+     all     : build and testcode and doc
+     install : install created artifacts at PREFIX
+
+Configuration Options:
+"""
+    Help(prelude + vars.GenerateHelpText(env))
+
+
+
+
+def configurePlatform(env):
+    """ locate required libs.
+        setup platform specific options.
+        Abort build in case of failure.
+    """
+    conf = env.Configure()
+    # run all configuration checks in the given env
+    
+    # Perform checks for prerequisites --------------------------------------------
+    problems = []
+    if not conf.TryAction('pkg-config --version > $TARGET')[0]:
+        problems.append('We need pkg-config for including library configurations, exiting.')
+    
+    if not conf.CheckLibWithHeader('m', 'math.h','C'):
+        problems.append('Did not find math.h / libm.')
+    
+    if not conf.CheckLibWithHeader('dl', 'dlfcn.h', 'C'):
+        problems.append('Functions for runtime dynamic loading not available.')
+    
+    if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
+        problems.append('Did not find the pthread lib or pthread.h.')
+    else:
+       conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD')
+       conf.env.Append(CCFLAGS = ' -pthread')
+    
+    if conf.CheckCHeader('execinfo.h'):
+       conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H')
+    
+    if conf.CheckCHeader('valgrind/valgrind.h'):
+        conf.env.Append(CPPFLAGS = ' -DHAVE_VALGRIND_H')
+    else:
+        print 'Valgrind not found. The use of Valgrind is optional; building without.'
+    
+    if not conf.CheckPkgConfig('nobugmt', 201006.1):
+        problems.append('Did not find NoBug [http://www.lumiera.org/nobug_manual.html].')
+    else:
+        conf.env.mergeConf('nobugmt')
+    
+    if not conf.CheckCXXHeader('tr1/memory'):
+        problems.append('We rely on the std::tr1 standard C++ extension for shared_ptr.')
+    
+    if not conf.CheckCXXHeader('boost/config.hpp'):
+        problems.append('We need the C++ boost-libraries.')
+    else:
+        if not conf.CheckCXXHeader('boost/scoped_ptr.hpp'):
+            problems.append('We need boost::scoped_ptr (scoped_ptr.hpp).')
+        if not conf.CheckCXXHeader('boost/format.hpp'):
+            problems.append('We need boost::format (header).')
+        if not conf.CheckLibWithHeader('boost_program_options-mt','boost/program_options.hpp','C++'):
+            problems.append('We need boost::program_options (including binary lib for linking).')
+        if not conf.CheckLibWithHeader('boost_system-mt','boost/system/error_code.hpp','C++'):
+            problems.append('We need the boost::system support library (including binary lib).')
+        if not conf.CheckLibWithHeader('boost_filesystem-mt','boost/filesystem.hpp','C++'):
+            problems.append('We need the boost::filesystem lib (including binary lib for linking).')
+        if not conf.CheckLibWithHeader('boost_regex-mt','boost/regex.hpp','C++'):
+            problems.append('We need the boost regular expression lib (incl. binary lib for linking).')
+    
+    
+    if conf.CheckLib(symbol='clock_gettime'):
+        print 'Using function clock_gettime() as defined in the C-lib...'
+    else:
+        if not conf.CheckLib(symbol='clock_gettime', library='rt'):
+            problems.append('No library known to provide the clock_gettime() function.')
+    
+    if not conf.CheckPkgConfig('gavl', 1.0):
+        problems.append('Did not find Gmerlin Audio Video Lib [http://gmerlin.sourceforge.net/gavl.html].')
+    else:
+        conf.env.mergeConf('gavl')
+    
+    if not conf.CheckPkgConfig('gtkmm-2.4', 2.8):
+        problems.append('Unable to configure GTK--')
+        
+    if not conf.CheckPkgConfig('glibmm-2.4', '2.16'):
+        problems.append('Unable to configure Lib glib--')
+    
+    if not conf.CheckPkgConfig('gthread-2.0', '2.12.4'):
+        problems.append('Need gthread support lib for glib-- based thread handling.')
+    
+    if not conf.CheckPkgConfig('cairomm-1.0', 0.6):
+        problems.append('Unable to configure Cairo--')
+    
+    verGDL = '2.27.1'
+    if not conf.CheckPkgConfig('gdl-1.0', verGDL, alias='gdl'):
+        print 'No sufficiently recent (>=%s) version of GDL found. Maybe use custom package gdl-lum?' % verGDL
+        if not conf.CheckPkgConfig('gdl-lum', verGDL, alias='gdl'):
+            problems.append('GNOME Docking Library not found. We either need a sufficiently recent GDL '
+                            'version (>=%s), or the custom package "gdl-lum" from Lumiera.org.' % verGDL)
+    
+    if not conf.CheckPkgConfig('librsvg-2.0', '2.18.1'):
+        problems.append('Need rsvg Library for rendering icons.')
+        
+    if not conf.CheckCHeader(['X11/Xutil.h', 'X11/Xlib.h'],'<>'):
+        problems.append('Xlib.h and Xutil.h required. Please install libx11-dev.')
+    
+    if not conf.CheckPkgConfig('xv')  : problems.append('Need libXv...')
+    if not conf.CheckPkgConfig('xext'): problems.append('Need libXext.')
+    
+    
+    # report missing dependencies
+    if problems:
+        print "*** unable to build due to the following problems:"
+        for isue in problems:
+            print " *  %s" % isue
+        print
+        print "build aborted."
+        Exit(1)
+    
+    print "** Gathered Library Info: %s" % conf.env.libInfo.keys()
+    
+    
+    # create new env containing the finished configuration
+    return conf.Finish()
+
+
+
+def defineSetupTargets(env):
+    """ build operations and targets to be done /before/ compiling.
+        things like creating a source tarball or preparing a version header.
+    """
+    pass    ## currently none
+
+
+
+def defineBuildTargets(env):
+    """ define the source file/dirs comprising each artifact to be built.
+        setup sub-environments with special build options if necessary.
+        We use a custom function to declare a whole tree of srcfiles. 
+    """
+    
+    # define Icons to render and install
+    vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
+    prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
+    icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
+              + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
+              )
+    
+    #define Configuration files to install
+    config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
+              + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
+              )
+    
+    # call subdir SConscript(s) for independent components
+    SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
+
+
+
+def definePostBuildTargets(env):
+    """ define further actions after the core build (e.g. Documentation).
+        define alias targets to trigger the installing.
+    """
+    Import('lumiera plugins tools gui testsuite')
+    build = env.Alias('build', lumiera + plugins + tools +gui)
+    
+    # additional files to be cleaned when cleaning 'build'
+    env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
+    env.Clean ('build', [ 'src/pre.gch' ])
+    
+    doxydoc = env.Doxygen('doc/devel/Doxyfile')
+    env.Alias ('doc', doxydoc)
+    env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
+    
+    env.Alias ('all', build + testsuite + doxydoc)
+    env.Default('build')
+    # SCons default target
+
+
+def defineInstallTargets(env):
+    """ define additional artifacts to be installed into target locations.
+        @note: we use customised SCons builders defining install targets 
+               for all executables automatically. see LumieraEnvironment.py
+    """
+    Import('lumiera plugins tools gui testsuite')
+    
+    env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
+#   env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
+    
+    env.Alias('install', gui)
+    env.Alias('install', '$DESTDIR')
+
+#####################################################################
+
+
+
+
+
+### === MAIN === ####################################################
+
+env = setupBasicEnvironment(localDefinitions)
+
+if not (isCleanupOperation(env) or isHelpRequest()):
+    env = configurePlatform(env)
+    
+# the various things we build. 
+# Each entry actually is a SCons-Node list.
+# Passing these entries to other builders defines dependencies.
+# 'lumiera'     : the App
+# 'gui'         : the GTK UI (plugin)
+# 'plugins'     : plugin shared lib
+# 'tools'       : small tool applications (e.g mpegtoc)
+
+defineSetupTargets(env)
+defineBuildTargets(env)
+definePostBuildTargets(env)
+defineInstallTargets(env)
+

From 795217b542a764f92a170794707786f08f8ff5f8 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 9 Jan 2012 04:58:21 +0100
Subject: [PATCH 74/87] actually switch to using those extracted modules from
 main build

---
 SConstruct              | 284 +----------------------------------
 admin/scons/Options.py  | 323 +---------------------------------------
 admin/scons/Platform.py | 257 +-------------------------------
 admin/scons/Setup.py    | 282 ++---------------------------------
 4 files changed, 18 insertions(+), 1128 deletions(-)

diff --git a/SConstruct b/SConstruct
index cd8165eae..ccb0a73a7 100644
--- a/SConstruct
+++ b/SConstruct
@@ -29,31 +29,9 @@
 
 
 #-----------------------------------Configuration
-TARGDIR      = 'target'
-VERSION      = '0.pre.01'
 TOOLDIR      = './admin/scons'    # SCons plugins
 SCRIPTDIR    = './admin'
-OPTCACHE     = 'optcache' 
-CUSTOPTFILE  = 'custom-options'
-
-# these are accessible via env.path.xxxx
-srcIcon      = 'icons'
-srcConf      = 'data/config'
-buildExe     = '#$TARGDIR'
-buildLib     = '#$TARGDIR/modules'
-buildPlug    = '#$TARGDIR/modules'
-buildIcon    = '#$TARGDIR/gui/icons'
-buildUIRes   = '#$TARGDIR/'
-buildConf    = '#$TARGDIR/config'
-installExe   = '#$DESTDIR/lib/lumiera'
-installLib   = '#$DESTDIR/lib/lumiera/modules'
-installPlug  = '#$DESTDIR/lib/lumiera/modules'
-installIcon  = '#$DESTDIR/share/lumiera/icons'
-installUIRes = '#$DESTDIR/share/lumiera/'
-installConf  = '#$DESTDIR/lib/lumiera/config'
-
 #-----------------------------------Configuration
-localDefinitions = locals()
 
 
 
@@ -72,264 +50,9 @@ import Setup
 import Options
 import Platform
 
+
 #####################################################################
 
-def setupBasicEnvironment(localDefinitions):
-    """ define cmdline options, build type decisions
-    """
-    EnsurePythonVersion(2,4)
-    EnsureSConsVersion(1,0)
-    
-    Decider('MD5-timestamp') # detect changed files by timestamp, then do a MD5
-    
-    vars = defineCmdlineVariables() 
-    env = LumieraEnvironment(variables=vars
-                            ,toolpath = [TOOLDIR]
-                            ,pathConfig = extract_localPathDefs(localDefinitions) # e.g. buildExe -> env.path.buildExe
-                            ,TARGDIR  = TARGDIR
-                            ,DESTDIR = '$INSTALLDIR/$PREFIX'
-                            ,VERSION = VERSION
-                            )
-    handleVerboseMessages(env)
-    
-    env.Replace( CPPPATH   =["#src"]    # used to find includes, "#" means always absolute to build-root
-               , CPPDEFINES=['LUMIERA_VERSION='+VERSION ]    # note: it's a list to append further defines
-               , CCFLAGS='-Wall -Wextra '
-               , CFLAGS='-std=gnu99' 
-               )
-    handleNoBugSwitches(env)
-    
-    env.Append(CPPDEFINES = '_GNU_SOURCE')
-    appendCppDefine(env,'DEBUG','DEBUG', 'NDEBUG')
-#   appendCppDefine(env,'OPENGL','USE_OPENGL')
-    appendVal(env,'ARCHFLAGS','CCFLAGS')   # for both C and C++
-    appendVal(env,'OPTIMIZE', 'CCFLAGS',   val=' -O3')
-    appendVal(env,'DEBUG',    'CCFLAGS',   val=' -ggdb')
-    
-    # setup search path for Lumiera plugins
-    appendCppDefine(env,'PKGLIBDIR','LUMIERA_PLUGIN_PATH=\\"$PKGLIBDIR/:ORIGIN/modules\\"'
-                                   ,'LUMIERA_PLUGIN_PATH=\\"ORIGIN/modules\\"') 
-    appendCppDefine(env,'PKGDATADIR','LUMIERA_CONFIG_PATH=\\"$PKGLIBDIR/:.\\"'
-                                    ,'LUMIERA_CONFIG_PATH=\\"$DESTDIR/share/lumiera/:.\\"') 
-    
-    prepareOptionsHelp(vars,env)
-    vars.Save(OPTCACHE, env)
-    return env
-
-def appendCppDefine(env,var,cppVar, elseVal=''):
-    if env[var]:
-        env.Append(CPPDEFINES = env.subst(cppVar) )
-    elif elseVal:
-        env.Append(CPPDEFINES = env.subst(elseVal))
-
-def appendVal(env,var,targetVar,val=None):
-    if env[var]:
-        env.Append( **{targetVar: env.subst(val) or env[var]})
-
-
-def handleNoBugSwitches(env):
-    """ set the build level for NoBug. 
-        Release builds imply no DEBUG
-        whereas ALPHA and BETA require DEBUG
-    """
-    level = env['BUILDLEVEL']
-    if level in ['ALPHA', 'BETA']:
-        if not env['DEBUG']:
-            print 'Warning: NoBug ALPHA or BETA builds requires DEBUG=yes, switching DEBUG on!'
-        env.Replace( DEBUG = 1 )
-        env.Append(CPPDEFINES = 'EBUG_'+level)
-    elif level == 'RELEASE':
-        env.Replace( DEBUG = 0 )
-
-def handleVerboseMessages(env):
-    """ toggle verbose build output """
-    if not env['VERBOSE']:
-       # SetOption('silent', True)
-       env['CCCOMSTR'] = env['SHCCCOMSTR']   = "  Compiling    $SOURCE"
-       env['CXXCOMSTR'] = env['SHCXXCOMSTR'] = "  Compiling++  $SOURCE"
-       env['LINKCOMSTR']                     = "  Linking -->  $TARGET"
-       env['LDMODULECOMSTR']                 = "  creating module [ $TARGET ]"
-
-
-
-
-def defineCmdlineVariables():
-    """ several toggles and configuration variables can be set on the commandline,
-        current settings will be persisted in a options cache file.
-        you may define custom variable settings in a separate file. 
-        Commandline will override both.
-    """
-    vars = Variables([OPTCACHE, CUSTOPTFILE])
-    vars.AddVariables(
-         ('ARCHFLAGS', 'Set architecture-specific compilation flags (passed literally to gcc)','')
-        ,('CC', 'Set the C compiler to use.', 'gcc')
-        ,('CXX', 'Set the C++ compiler to use.', 'g++')
-        ,PathVariable('CCACHE', 'Integrate with CCache', '', PathVariable.PathAccept)
-        ,PathVariable('DISTCC', 'Invoke C/C++ compiler commands through DistCC', '', PathVariable.PathAccept)
-        ,EnumVariable('BUILDLEVEL', 'NoBug build level for debugging', 'ALPHA', allowed_values=('ALPHA', 'BETA', 'RELEASE'))
-        ,BoolVariable('DEBUG', 'Build with debugging information and no optimisations', False)
-        ,BoolVariable('OPTIMIZE', 'Build with strong optimisation (-O3)', False)
-        ,BoolVariable('VALGRIND', 'Run Testsuite under valgrind control', True)
-        ,BoolVariable('VERBOSE',  'Print full build commands', False)
-        ,('TESTSUITES', 'Run only Testsuites matching the given pattern', '')
-#       ,BoolVariable('OPENGL', 'Include support for OpenGL preview rendering', False)
-#       ,EnumVariable('DIST_TARGET', 'Build target architecture', 'auto', 
-#                   allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2)
-        ,PathVariable('PREFIX', 'Installation dir prefix', 'usr/local', PathVariable.PathAccept)
-        ,PathVariable('INSTALLDIR', 'Root output directory for install. Final installation will happen in INSTALLDIR/PREFIX/... ', '/', PathVariable.PathIsDir)
-        ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept)
-        ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept)
-     )
-    
-    return vars
-
-
-
-def prepareOptionsHelp(vars,env):
-    prelude = """
-USAGE:   scons [-c] [OPTS] [key=val [key=val...]] [TARGETS]
-     Build and optionally install Lumiera.
-     Without specifying any target, just the (re)build target will run.
-     Add -c to the commandline to clean up anything a given target would produce
-
-Special Targets:
-     build   : just compile and link
-     research: build experimental code (might fail)
-     testcode: additionally compile the Testsuite
-     check   : build and run the Testsuite
-     doc     : generate documentation (Doxygen)
-     all     : build and testcode and doc
-     install : install created artifacts at PREFIX
-
-Configuration Options:
-"""
-    Help(prelude + vars.GenerateHelpText(env))
-
-
-
-
-def configurePlatform(env):
-    """ locate required libs.
-        setup platform specific options.
-        Abort build in case of failure.
-    """
-    conf = env.Configure()
-    # run all configuration checks in the given env
-    
-    # Perform checks for prerequisites --------------------------------------------
-    problems = []
-    if not conf.TryAction('pkg-config --version > $TARGET')[0]:
-        problems.append('We need pkg-config for including library configurations, exiting.')
-    
-    if not conf.CheckLibWithHeader('m', 'math.h','C'):
-        problems.append('Did not find math.h / libm.')
-    
-    if not conf.CheckLibWithHeader('dl', 'dlfcn.h', 'C'):
-        problems.append('Functions for runtime dynamic loading not available.')
-    
-    if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
-        problems.append('Did not find the pthread lib or pthread.h.')
-    else:
-       conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD')
-       conf.env.Append(CCFLAGS = ' -pthread')
-    
-    if conf.CheckCHeader('execinfo.h'):
-       conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H')
-    
-    if conf.CheckCHeader('valgrind/valgrind.h'):
-        conf.env.Append(CPPFLAGS = ' -DHAVE_VALGRIND_H')
-    else:
-        print 'Valgrind not found. The use of Valgrind is optional; building without.'
-    
-    if not conf.CheckPkgConfig('nobugmt', 201006.1):
-        problems.append('Did not find NoBug [http://www.lumiera.org/nobug_manual.html].')
-    else:
-        conf.env.mergeConf('nobugmt')
-    
-    if not conf.CheckCXXHeader('tr1/memory'):
-        problems.append('We rely on the std::tr1 standard C++ extension for shared_ptr.')
-    
-    if not conf.CheckCXXHeader('boost/config.hpp'):
-        problems.append('We need the C++ boost-libraries.')
-    else:
-        if not conf.CheckCXXHeader('boost/scoped_ptr.hpp'):
-            problems.append('We need boost::scoped_ptr (scoped_ptr.hpp).')
-        if not conf.CheckCXXHeader('boost/format.hpp'):
-            problems.append('We need boost::format (header).')
-        if not conf.CheckLibWithHeader('boost_program_options-mt','boost/program_options.hpp','C++'):
-            problems.append('We need boost::program_options (including binary lib for linking).')
-        if not conf.CheckLibWithHeader('boost_system-mt','boost/system/error_code.hpp','C++'):
-            problems.append('We need the boost::system support library (including binary lib).')
-        if not conf.CheckLibWithHeader('boost_filesystem-mt','boost/filesystem.hpp','C++'):
-            problems.append('We need the boost::filesystem lib (including binary lib for linking).')
-        if not conf.CheckLibWithHeader('boost_regex-mt','boost/regex.hpp','C++'):
-            problems.append('We need the boost regular expression lib (incl. binary lib for linking).')
-    
-    
-    if conf.CheckLib(symbol='clock_gettime'):
-        print 'Using function clock_gettime() as defined in the C-lib...'
-    else:
-        if not conf.CheckLib(symbol='clock_gettime', library='rt'):
-            problems.append('No library known to provide the clock_gettime() function.')
-    
-    if not conf.CheckPkgConfig('gavl', 1.0):
-        problems.append('Did not find Gmerlin Audio Video Lib [http://gmerlin.sourceforge.net/gavl.html].')
-    else:
-        conf.env.mergeConf('gavl')
-    
-    if not conf.CheckPkgConfig('gtkmm-2.4', 2.8):
-        problems.append('Unable to configure GTK--')
-        
-    if not conf.CheckPkgConfig('glibmm-2.4', '2.16'):
-        problems.append('Unable to configure Lib glib--')
-    
-    if not conf.CheckPkgConfig('gthread-2.0', '2.12.4'):
-        problems.append('Need gthread support lib for glib-- based thread handling.')
-    
-    if not conf.CheckPkgConfig('cairomm-1.0', 0.6):
-        problems.append('Unable to configure Cairo--')
-    
-    verGDL = '2.27.1'
-    if not conf.CheckPkgConfig('gdl-1.0', verGDL, alias='gdl'):
-        print 'No sufficiently recent (>=%s) version of GDL found. Maybe use custom package gdl-lum?' % verGDL
-        if not conf.CheckPkgConfig('gdl-lum', verGDL, alias='gdl'):
-            problems.append('GNOME Docking Library not found. We either need a sufficiently recent GDL '
-                            'version (>=%s), or the custom package "gdl-lum" from Lumiera.org.' % verGDL)
-    
-    if not conf.CheckPkgConfig('librsvg-2.0', '2.18.1'):
-        problems.append('Need rsvg Library for rendering icons.')
-        
-    if not conf.CheckCHeader(['X11/Xutil.h', 'X11/Xlib.h'],'<>'):
-        problems.append('Xlib.h and Xutil.h required. Please install libx11-dev.')
-    
-    if not conf.CheckPkgConfig('xv')  : problems.append('Need libXv...')
-    if not conf.CheckPkgConfig('xext'): problems.append('Need libXext.')
-    
-    
-    # report missing dependencies
-    if problems:
-        print "*** unable to build due to the following problems:"
-        for isue in problems:
-            print " *  %s" % isue
-        print
-        print "build aborted."
-        Exit(1)
-    
-    print "** Gathered Library Info: %s" % conf.env.libInfo.keys()
-    
-    
-    # create new env containing the finished configuration
-    return conf.Finish()
-
-
-
-def defineSetupTargets(env):
-    """ build operations and targets to be done /before/ compiling.
-        things like creating a source tarball or preparing a version header.
-    """
-    pass    ## currently none
-
-
 
 def defineBuildTargets(env):
     """ define the source file/dirs comprising each artifact to be built.
@@ -395,10 +118,10 @@ def defineInstallTargets(env):
 
 ### === MAIN === ####################################################
 
-env = setupBasicEnvironment(localDefinitions)
+env = Setup.setupBasicEnvironment()
 
 if not (isCleanupOperation(env) or isHelpRequest()):
-    env = configurePlatform(env)
+    env = Platform.configurePlatform(env)
     
 # the various things we build. 
 # Each entry actually is a SCons-Node list.
@@ -408,7 +131,6 @@ if not (isCleanupOperation(env) or isHelpRequest()):
 # 'plugins'     : plugin shared lib
 # 'tools'       : small tool applications (e.g mpegtoc)
 
-defineSetupTargets(env)
 defineBuildTargets(env)
 definePostBuildTargets(env)
 defineInstallTargets(env)
diff --git a/admin/scons/Options.py b/admin/scons/Options.py
index f919995de..ed1c8bb93 100644
--- a/admin/scons/Options.py
+++ b/admin/scons/Options.py
@@ -22,47 +22,11 @@
 #####################################################################
 
 
-# NOTE: scons -h for help.
-# Read more about the SCons build system at: http://www.scons.org
-# Basically, this script just /defines/ the components and how they
-# fit together. SCons will derive the necessary build steps.
-
-
-#-----------------------------------Configuration
-TARGDIR      = 'target'
-VERSION      = '0.pre.01'
-TOOLDIR      = './admin/scons'    # SCons plugins
-SCRIPTDIR    = './admin'
-OPTCACHE     = 'optcache' 
-CUSTOPTFILE  = 'custom-options'
-
-# these are accessible via env.path.xxxx
-srcIcon      = 'icons'
-srcConf      = 'data/config'
-buildExe     = '#$TARGDIR'
-buildLib     = '#$TARGDIR/modules'
-buildPlug    = '#$TARGDIR/modules'
-buildIcon    = '#$TARGDIR/gui/icons'
-buildUIRes   = '#$TARGDIR/'
-buildConf    = '#$TARGDIR/config'
-installExe   = '#$DESTDIR/lib/lumiera'
-installLib   = '#$DESTDIR/lib/lumiera/modules'
-installPlug  = '#$DESTDIR/lib/lumiera/modules'
-installIcon  = '#$DESTDIR/share/lumiera/icons'
-installUIRes = '#$DESTDIR/share/lumiera/'
-installConf  = '#$DESTDIR/lib/lumiera/config'
-
-#-----------------------------------Configuration
-localDefinitions = locals()
-
-
-
 
 import os
 import sys
 
-sys.path.append(TOOLDIR)
-sys.path.append(SCRIPTDIR)
+from SCons.Script import *
 
 from Buildhelper import *
 from LumieraEnvironment import *
@@ -70,92 +34,15 @@ from LumieraEnvironment import *
 
 #####################################################################
 
-def setupBasicEnvironment(localDefinitions):
-    """ define cmdline options, build type decisions
-    """
-    EnsurePythonVersion(2,4)
-    EnsureSConsVersion(1,0)
-    
-    Decider('MD5-timestamp') # detect changed files by timestamp, then do a MD5
-    
-    vars = defineCmdlineVariables() 
-    env = LumieraEnvironment(variables=vars
-                            ,toolpath = [TOOLDIR]
-                            ,pathConfig = extract_localPathDefs(localDefinitions) # e.g. buildExe -> env.path.buildExe
-                            ,TARGDIR  = TARGDIR
-                            ,DESTDIR = '$INSTALLDIR/$PREFIX'
-                            ,VERSION = VERSION
-                            )
-    handleVerboseMessages(env)
-    
-    env.Replace( CPPPATH   =["#src"]    # used to find includes, "#" means always absolute to build-root
-               , CPPDEFINES=['LUMIERA_VERSION='+VERSION ]    # note: it's a list to append further defines
-               , CCFLAGS='-Wall -Wextra '
-               , CFLAGS='-std=gnu99' 
-               )
-    handleNoBugSwitches(env)
-    
-    env.Append(CPPDEFINES = '_GNU_SOURCE')
-    appendCppDefine(env,'DEBUG','DEBUG', 'NDEBUG')
-#   appendCppDefine(env,'OPENGL','USE_OPENGL')
-    appendVal(env,'ARCHFLAGS','CCFLAGS')   # for both C and C++
-    appendVal(env,'OPTIMIZE', 'CCFLAGS',   val=' -O3')
-    appendVal(env,'DEBUG',    'CCFLAGS',   val=' -ggdb')
-    
-    # setup search path for Lumiera plugins
-    appendCppDefine(env,'PKGLIBDIR','LUMIERA_PLUGIN_PATH=\\"$PKGLIBDIR/:ORIGIN/modules\\"'
-                                   ,'LUMIERA_PLUGIN_PATH=\\"ORIGIN/modules\\"') 
-    appendCppDefine(env,'PKGDATADIR','LUMIERA_CONFIG_PATH=\\"$PKGLIBDIR/:.\\"'
-                                    ,'LUMIERA_CONFIG_PATH=\\"$DESTDIR/share/lumiera/:.\\"') 
-    
-    prepareOptionsHelp(vars,env)
-    vars.Save(OPTCACHE, env)
-    return env
-
-def appendCppDefine(env,var,cppVar, elseVal=''):
-    if env[var]:
-        env.Append(CPPDEFINES = env.subst(cppVar) )
-    elif elseVal:
-        env.Append(CPPDEFINES = env.subst(elseVal))
-
-def appendVal(env,var,targetVar,val=None):
-    if env[var]:
-        env.Append( **{targetVar: env.subst(val) or env[var]})
-
-
-def handleNoBugSwitches(env):
-    """ set the build level for NoBug. 
-        Release builds imply no DEBUG
-        whereas ALPHA and BETA require DEBUG
-    """
-    level = env['BUILDLEVEL']
-    if level in ['ALPHA', 'BETA']:
-        if not env['DEBUG']:
-            print 'Warning: NoBug ALPHA or BETA builds requires DEBUG=yes, switching DEBUG on!'
-        env.Replace( DEBUG = 1 )
-        env.Append(CPPDEFINES = 'EBUG_'+level)
-    elif level == 'RELEASE':
-        env.Replace( DEBUG = 0 )
-
-def handleVerboseMessages(env):
-    """ toggle verbose build output """
-    if not env['VERBOSE']:
-       # SetOption('silent', True)
-       env['CCCOMSTR'] = env['SHCCCOMSTR']   = "  Compiling    $SOURCE"
-       env['CXXCOMSTR'] = env['SHCXXCOMSTR'] = "  Compiling++  $SOURCE"
-       env['LINKCOMSTR']                     = "  Linking -->  $TARGET"
-       env['LDMODULECOMSTR']                 = "  creating module [ $TARGET ]"
 
 
 
-
-def defineCmdlineVariables():
+def defineCmdlineVariables(vars):
     """ several toggles and configuration variables can be set on the commandline,
         current settings will be persisted in a options cache file.
         you may define custom variable settings in a separate file. 
         Commandline will override both.
     """
-    vars = Variables([OPTCACHE, CUSTOPTFILE])
     vars.AddVariables(
          ('ARCHFLAGS', 'Set architecture-specific compilation flags (passed literally to gcc)','')
         ,('CC', 'Set the C compiler to use.', 'gcc')
@@ -203,209 +90,3 @@ Configuration Options:
 
 
 
-
-def configurePlatform(env):
-    """ locate required libs.
-        setup platform specific options.
-        Abort build in case of failure.
-    """
-    conf = env.Configure()
-    # run all configuration checks in the given env
-    
-    # Perform checks for prerequisites --------------------------------------------
-    problems = []
-    if not conf.TryAction('pkg-config --version > $TARGET')[0]:
-        problems.append('We need pkg-config for including library configurations, exiting.')
-    
-    if not conf.CheckLibWithHeader('m', 'math.h','C'):
-        problems.append('Did not find math.h / libm.')
-    
-    if not conf.CheckLibWithHeader('dl', 'dlfcn.h', 'C'):
-        problems.append('Functions for runtime dynamic loading not available.')
-    
-    if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
-        problems.append('Did not find the pthread lib or pthread.h.')
-    else:
-       conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD')
-       conf.env.Append(CCFLAGS = ' -pthread')
-    
-    if conf.CheckCHeader('execinfo.h'):
-       conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H')
-    
-    if conf.CheckCHeader('valgrind/valgrind.h'):
-        conf.env.Append(CPPFLAGS = ' -DHAVE_VALGRIND_H')
-    else:
-        print 'Valgrind not found. The use of Valgrind is optional; building without.'
-    
-    if not conf.CheckPkgConfig('nobugmt', 201006.1):
-        problems.append('Did not find NoBug [http://www.lumiera.org/nobug_manual.html].')
-    else:
-        conf.env.mergeConf('nobugmt')
-    
-    if not conf.CheckCXXHeader('tr1/memory'):
-        problems.append('We rely on the std::tr1 standard C++ extension for shared_ptr.')
-    
-    if not conf.CheckCXXHeader('boost/config.hpp'):
-        problems.append('We need the C++ boost-libraries.')
-    else:
-        if not conf.CheckCXXHeader('boost/scoped_ptr.hpp'):
-            problems.append('We need boost::scoped_ptr (scoped_ptr.hpp).')
-        if not conf.CheckCXXHeader('boost/format.hpp'):
-            problems.append('We need boost::format (header).')
-        if not conf.CheckLibWithHeader('boost_program_options-mt','boost/program_options.hpp','C++'):
-            problems.append('We need boost::program_options (including binary lib for linking).')
-        if not conf.CheckLibWithHeader('boost_system-mt','boost/system/error_code.hpp','C++'):
-            problems.append('We need the boost::system support library (including binary lib).')
-        if not conf.CheckLibWithHeader('boost_filesystem-mt','boost/filesystem.hpp','C++'):
-            problems.append('We need the boost::filesystem lib (including binary lib for linking).')
-        if not conf.CheckLibWithHeader('boost_regex-mt','boost/regex.hpp','C++'):
-            problems.append('We need the boost regular expression lib (incl. binary lib for linking).')
-    
-    
-    if conf.CheckLib(symbol='clock_gettime'):
-        print 'Using function clock_gettime() as defined in the C-lib...'
-    else:
-        if not conf.CheckLib(symbol='clock_gettime', library='rt'):
-            problems.append('No library known to provide the clock_gettime() function.')
-    
-    if not conf.CheckPkgConfig('gavl', 1.0):
-        problems.append('Did not find Gmerlin Audio Video Lib [http://gmerlin.sourceforge.net/gavl.html].')
-    else:
-        conf.env.mergeConf('gavl')
-    
-    if not conf.CheckPkgConfig('gtkmm-2.4', 2.8):
-        problems.append('Unable to configure GTK--')
-        
-    if not conf.CheckPkgConfig('glibmm-2.4', '2.16'):
-        problems.append('Unable to configure Lib glib--')
-    
-    if not conf.CheckPkgConfig('gthread-2.0', '2.12.4'):
-        problems.append('Need gthread support lib for glib-- based thread handling.')
-    
-    if not conf.CheckPkgConfig('cairomm-1.0', 0.6):
-        problems.append('Unable to configure Cairo--')
-    
-    verGDL = '2.27.1'
-    if not conf.CheckPkgConfig('gdl-1.0', verGDL, alias='gdl'):
-        print 'No sufficiently recent (>=%s) version of GDL found. Maybe use custom package gdl-lum?' % verGDL
-        if not conf.CheckPkgConfig('gdl-lum', verGDL, alias='gdl'):
-            problems.append('GNOME Docking Library not found. We either need a sufficiently recent GDL '
-                            'version (>=%s), or the custom package "gdl-lum" from Lumiera.org.' % verGDL)
-    
-    if not conf.CheckPkgConfig('librsvg-2.0', '2.18.1'):
-        problems.append('Need rsvg Library for rendering icons.')
-        
-    if not conf.CheckCHeader(['X11/Xutil.h', 'X11/Xlib.h'],'<>'):
-        problems.append('Xlib.h and Xutil.h required. Please install libx11-dev.')
-    
-    if not conf.CheckPkgConfig('xv')  : problems.append('Need libXv...')
-    if not conf.CheckPkgConfig('xext'): problems.append('Need libXext.')
-    
-    
-    # report missing dependencies
-    if problems:
-        print "*** unable to build due to the following problems:"
-        for isue in problems:
-            print " *  %s" % isue
-        print
-        print "build aborted."
-        Exit(1)
-    
-    print "** Gathered Library Info: %s" % conf.env.libInfo.keys()
-    
-    
-    # create new env containing the finished configuration
-    return conf.Finish()
-
-
-
-def defineSetupTargets(env):
-    """ build operations and targets to be done /before/ compiling.
-        things like creating a source tarball or preparing a version header.
-    """
-    pass    ## currently none
-
-
-
-def defineBuildTargets(env):
-    """ define the source file/dirs comprising each artifact to be built.
-        setup sub-environments with special build options if necessary.
-        We use a custom function to declare a whole tree of srcfiles. 
-    """
-    
-    # define Icons to render and install
-    vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
-    prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
-    icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
-              + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
-              )
-    
-    #define Configuration files to install
-    config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
-              + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
-              )
-    
-    # call subdir SConscript(s) for independent components
-    SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
-
-
-
-def definePostBuildTargets(env):
-    """ define further actions after the core build (e.g. Documentation).
-        define alias targets to trigger the installing.
-    """
-    Import('lumiera plugins tools gui testsuite')
-    build = env.Alias('build', lumiera + plugins + tools +gui)
-    
-    # additional files to be cleaned when cleaning 'build'
-    env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
-    env.Clean ('build', [ 'src/pre.gch' ])
-    
-    doxydoc = env.Doxygen('doc/devel/Doxyfile')
-    env.Alias ('doc', doxydoc)
-    env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
-    
-    env.Alias ('all', build + testsuite + doxydoc)
-    env.Default('build')
-    # SCons default target
-
-
-def defineInstallTargets(env):
-    """ define additional artifacts to be installed into target locations.
-        @note: we use customised SCons builders defining install targets 
-               for all executables automatically. see LumieraEnvironment.py
-    """
-    Import('lumiera plugins tools gui testsuite')
-    
-    env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
-#   env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
-    
-    env.Alias('install', gui)
-    env.Alias('install', '$DESTDIR')
-
-#####################################################################
-
-
-
-
-
-### === MAIN === ####################################################
-
-env = setupBasicEnvironment(localDefinitions)
-
-if not (isCleanupOperation(env) or isHelpRequest()):
-    env = configurePlatform(env)
-    
-# the various things we build. 
-# Each entry actually is a SCons-Node list.
-# Passing these entries to other builders defines dependencies.
-# 'lumiera'     : the App
-# 'gui'         : the GTK UI (plugin)
-# 'plugins'     : plugin shared lib
-# 'tools'       : small tool applications (e.g mpegtoc)
-
-defineSetupTargets(env)
-defineBuildTargets(env)
-definePostBuildTargets(env)
-defineInstallTargets(env)
-
diff --git a/admin/scons/Platform.py b/admin/scons/Platform.py
index e8f9d050b..4d5d12e7b 100644
--- a/admin/scons/Platform.py
+++ b/admin/scons/Platform.py
@@ -28,179 +28,16 @@
 # fit together. SCons will derive the necessary build steps.
 
 
-#-----------------------------------Configuration
-TARGDIR      = 'target'
-VERSION      = '0.pre.01'
-TOOLDIR      = './admin/scons'    # SCons plugins
-SCRIPTDIR    = './admin'
-OPTCACHE     = 'optcache' 
-CUSTOPTFILE  = 'custom-options'
-
-# these are accessible via env.path.xxxx
-srcIcon      = 'icons'
-srcConf      = 'data/config'
-buildExe     = '#$TARGDIR'
-buildLib     = '#$TARGDIR/modules'
-buildPlug    = '#$TARGDIR/modules'
-buildIcon    = '#$TARGDIR/gui/icons'
-buildUIRes   = '#$TARGDIR/'
-buildConf    = '#$TARGDIR/config'
-installExe   = '#$DESTDIR/lib/lumiera'
-installLib   = '#$DESTDIR/lib/lumiera/modules'
-installPlug  = '#$DESTDIR/lib/lumiera/modules'
-installIcon  = '#$DESTDIR/share/lumiera/icons'
-installUIRes = '#$DESTDIR/share/lumiera/'
-installConf  = '#$DESTDIR/lib/lumiera/config'
-
-#-----------------------------------Configuration
-localDefinitions = locals()
-
-
-
 
 import os
 import sys
 
-sys.path.append(TOOLDIR)
-sys.path.append(SCRIPTDIR)
+from SCons.Script import Exit
 
 from Buildhelper import *
 from LumieraEnvironment import *
 
 
-#####################################################################
-
-def setupBasicEnvironment(localDefinitions):
-    """ define cmdline options, build type decisions
-    """
-    EnsurePythonVersion(2,4)
-    EnsureSConsVersion(1,0)
-    
-    Decider('MD5-timestamp') # detect changed files by timestamp, then do a MD5
-    
-    vars = defineCmdlineVariables() 
-    env = LumieraEnvironment(variables=vars
-                            ,toolpath = [TOOLDIR]
-                            ,pathConfig = extract_localPathDefs(localDefinitions) # e.g. buildExe -> env.path.buildExe
-                            ,TARGDIR  = TARGDIR
-                            ,DESTDIR = '$INSTALLDIR/$PREFIX'
-                            ,VERSION = VERSION
-                            )
-    handleVerboseMessages(env)
-    
-    env.Replace( CPPPATH   =["#src"]    # used to find includes, "#" means always absolute to build-root
-               , CPPDEFINES=['LUMIERA_VERSION='+VERSION ]    # note: it's a list to append further defines
-               , CCFLAGS='-Wall -Wextra '
-               , CFLAGS='-std=gnu99' 
-               )
-    handleNoBugSwitches(env)
-    
-    env.Append(CPPDEFINES = '_GNU_SOURCE')
-    appendCppDefine(env,'DEBUG','DEBUG', 'NDEBUG')
-#   appendCppDefine(env,'OPENGL','USE_OPENGL')
-    appendVal(env,'ARCHFLAGS','CCFLAGS')   # for both C and C++
-    appendVal(env,'OPTIMIZE', 'CCFLAGS',   val=' -O3')
-    appendVal(env,'DEBUG',    'CCFLAGS',   val=' -ggdb')
-    
-    # setup search path for Lumiera plugins
-    appendCppDefine(env,'PKGLIBDIR','LUMIERA_PLUGIN_PATH=\\"$PKGLIBDIR/:ORIGIN/modules\\"'
-                                   ,'LUMIERA_PLUGIN_PATH=\\"ORIGIN/modules\\"') 
-    appendCppDefine(env,'PKGDATADIR','LUMIERA_CONFIG_PATH=\\"$PKGLIBDIR/:.\\"'
-                                    ,'LUMIERA_CONFIG_PATH=\\"$DESTDIR/share/lumiera/:.\\"') 
-    
-    prepareOptionsHelp(vars,env)
-    vars.Save(OPTCACHE, env)
-    return env
-
-def appendCppDefine(env,var,cppVar, elseVal=''):
-    if env[var]:
-        env.Append(CPPDEFINES = env.subst(cppVar) )
-    elif elseVal:
-        env.Append(CPPDEFINES = env.subst(elseVal))
-
-def appendVal(env,var,targetVar,val=None):
-    if env[var]:
-        env.Append( **{targetVar: env.subst(val) or env[var]})
-
-
-def handleNoBugSwitches(env):
-    """ set the build level for NoBug. 
-        Release builds imply no DEBUG
-        whereas ALPHA and BETA require DEBUG
-    """
-    level = env['BUILDLEVEL']
-    if level in ['ALPHA', 'BETA']:
-        if not env['DEBUG']:
-            print 'Warning: NoBug ALPHA or BETA builds requires DEBUG=yes, switching DEBUG on!'
-        env.Replace( DEBUG = 1 )
-        env.Append(CPPDEFINES = 'EBUG_'+level)
-    elif level == 'RELEASE':
-        env.Replace( DEBUG = 0 )
-
-def handleVerboseMessages(env):
-    """ toggle verbose build output """
-    if not env['VERBOSE']:
-       # SetOption('silent', True)
-       env['CCCOMSTR'] = env['SHCCCOMSTR']   = "  Compiling    $SOURCE"
-       env['CXXCOMSTR'] = env['SHCXXCOMSTR'] = "  Compiling++  $SOURCE"
-       env['LINKCOMSTR']                     = "  Linking -->  $TARGET"
-       env['LDMODULECOMSTR']                 = "  creating module [ $TARGET ]"
-
-
-
-
-def defineCmdlineVariables():
-    """ several toggles and configuration variables can be set on the commandline,
-        current settings will be persisted in a options cache file.
-        you may define custom variable settings in a separate file. 
-        Commandline will override both.
-    """
-    vars = Variables([OPTCACHE, CUSTOPTFILE])
-    vars.AddVariables(
-         ('ARCHFLAGS', 'Set architecture-specific compilation flags (passed literally to gcc)','')
-        ,('CC', 'Set the C compiler to use.', 'gcc')
-        ,('CXX', 'Set the C++ compiler to use.', 'g++')
-        ,PathVariable('CCACHE', 'Integrate with CCache', '', PathVariable.PathAccept)
-        ,PathVariable('DISTCC', 'Invoke C/C++ compiler commands through DistCC', '', PathVariable.PathAccept)
-        ,EnumVariable('BUILDLEVEL', 'NoBug build level for debugging', 'ALPHA', allowed_values=('ALPHA', 'BETA', 'RELEASE'))
-        ,BoolVariable('DEBUG', 'Build with debugging information and no optimisations', False)
-        ,BoolVariable('OPTIMIZE', 'Build with strong optimisation (-O3)', False)
-        ,BoolVariable('VALGRIND', 'Run Testsuite under valgrind control', True)
-        ,BoolVariable('VERBOSE',  'Print full build commands', False)
-        ,('TESTSUITES', 'Run only Testsuites matching the given pattern', '')
-#       ,BoolVariable('OPENGL', 'Include support for OpenGL preview rendering', False)
-#       ,EnumVariable('DIST_TARGET', 'Build target architecture', 'auto', 
-#                   allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2)
-        ,PathVariable('PREFIX', 'Installation dir prefix', 'usr/local', PathVariable.PathAccept)
-        ,PathVariable('INSTALLDIR', 'Root output directory for install. Final installation will happen in INSTALLDIR/PREFIX/... ', '/', PathVariable.PathIsDir)
-        ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept)
-        ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept)
-     )
-    
-    return vars
-
-
-
-def prepareOptionsHelp(vars,env):
-    prelude = """
-USAGE:   scons [-c] [OPTS] [key=val [key=val...]] [TARGETS]
-     Build and optionally install Lumiera.
-     Without specifying any target, just the (re)build target will run.
-     Add -c to the commandline to clean up anything a given target would produce
-
-Special Targets:
-     build   : just compile and link
-     research: build experimental code (might fail)
-     testcode: additionally compile the Testsuite
-     check   : build and run the Testsuite
-     doc     : generate documentation (Doxygen)
-     all     : build and testcode and doc
-     install : install created artifacts at PREFIX
-
-Configuration Options:
-"""
-    Help(prelude + vars.GenerateHelpText(env))
-
 
 
 
@@ -317,95 +154,3 @@ def configurePlatform(env):
     # create new env containing the finished configuration
     return conf.Finish()
 
-
-
-def defineSetupTargets(env):
-    """ build operations and targets to be done /before/ compiling.
-        things like creating a source tarball or preparing a version header.
-    """
-    pass    ## currently none
-
-
-
-def defineBuildTargets(env):
-    """ define the source file/dirs comprising each artifact to be built.
-        setup sub-environments with special build options if necessary.
-        We use a custom function to declare a whole tree of srcfiles. 
-    """
-    
-    # define Icons to render and install
-    vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
-    prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
-    icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
-              + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
-              )
-    
-    #define Configuration files to install
-    config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
-              + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
-              )
-    
-    # call subdir SConscript(s) for independent components
-    SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
-
-
-
-def definePostBuildTargets(env):
-    """ define further actions after the core build (e.g. Documentation).
-        define alias targets to trigger the installing.
-    """
-    Import('lumiera plugins tools gui testsuite')
-    build = env.Alias('build', lumiera + plugins + tools +gui)
-    
-    # additional files to be cleaned when cleaning 'build'
-    env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
-    env.Clean ('build', [ 'src/pre.gch' ])
-    
-    doxydoc = env.Doxygen('doc/devel/Doxyfile')
-    env.Alias ('doc', doxydoc)
-    env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
-    
-    env.Alias ('all', build + testsuite + doxydoc)
-    env.Default('build')
-    # SCons default target
-
-
-def defineInstallTargets(env):
-    """ define additional artifacts to be installed into target locations.
-        @note: we use customised SCons builders defining install targets 
-               for all executables automatically. see LumieraEnvironment.py
-    """
-    Import('lumiera plugins tools gui testsuite')
-    
-    env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
-#   env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
-    
-    env.Alias('install', gui)
-    env.Alias('install', '$DESTDIR')
-
-#####################################################################
-
-
-
-
-
-### === MAIN === ####################################################
-
-env = setupBasicEnvironment(localDefinitions)
-
-if not (isCleanupOperation(env) or isHelpRequest()):
-    env = configurePlatform(env)
-    
-# the various things we build. 
-# Each entry actually is a SCons-Node list.
-# Passing these entries to other builders defines dependencies.
-# 'lumiera'     : the App
-# 'gui'         : the GTK UI (plugin)
-# 'plugins'     : plugin shared lib
-# 'tools'       : small tool applications (e.g mpegtoc)
-
-defineSetupTargets(env)
-defineBuildTargets(env)
-definePostBuildTargets(env)
-defineInstallTargets(env)
-
diff --git a/admin/scons/Setup.py b/admin/scons/Setup.py
index d910b04de..23112a09b 100644
--- a/admin/scons/Setup.py
+++ b/admin/scons/Setup.py
@@ -61,8 +61,9 @@ localDefinitions = locals()
 import os
 import sys
 
-sys.path.append(TOOLDIR)
-sys.path.append(SCRIPTDIR)
+from SCons.Script import *
+
+from Options import *
 
 from Buildhelper import *
 from LumieraEnvironment import *
@@ -70,7 +71,7 @@ from LumieraEnvironment import *
 
 #####################################################################
 
-def setupBasicEnvironment(localDefinitions):
+def setupBasicEnvironment():
     """ define cmdline options, build type decisions
     """
     EnsurePythonVersion(2,4)
@@ -78,7 +79,9 @@ def setupBasicEnvironment(localDefinitions):
     
     Decider('MD5-timestamp') # detect changed files by timestamp, then do a MD5
     
-    vars = defineCmdlineVariables() 
+    vars = Variables([OPTCACHE, CUSTOPTFILE])
+    vars = defineCmdlineVariables(vars)
+    
     env = LumieraEnvironment(variables=vars
                             ,toolpath = [TOOLDIR]
                             ,pathConfig = extract_localPathDefs(localDefinitions) # e.g. buildExe -> env.path.buildExe
@@ -140,272 +143,11 @@ def handleNoBugSwitches(env):
 def handleVerboseMessages(env):
     """ toggle verbose build output """
     if not env['VERBOSE']:
-       # SetOption('silent', True)
-       env['CCCOMSTR'] = env['SHCCCOMSTR']   = "  Compiling    $SOURCE"
-       env['CXXCOMSTR'] = env['SHCXXCOMSTR'] = "  Compiling++  $SOURCE"
-       env['LINKCOMSTR']                     = "  Linking -->  $TARGET"
-       env['LDMODULECOMSTR']                 = "  creating module [ $TARGET ]"
+        # SetOption('silent', True)
+        env['CCCOMSTR'] = env['SHCCCOMSTR']   = "  Compiling    $SOURCE"
+        env['CXXCOMSTR'] = env['SHCXXCOMSTR'] = "  Compiling++  $SOURCE"
+        env['LINKCOMSTR']                     = "  Linking -->  $TARGET"
+        env['LDMODULECOMSTR']                 = "  creating module [ $TARGET ]"
 
 
 
-
-def defineCmdlineVariables():
-    """ several toggles and configuration variables can be set on the commandline,
-        current settings will be persisted in a options cache file.
-        you may define custom variable settings in a separate file. 
-        Commandline will override both.
-    """
-    vars = Variables([OPTCACHE, CUSTOPTFILE])
-    vars.AddVariables(
-         ('ARCHFLAGS', 'Set architecture-specific compilation flags (passed literally to gcc)','')
-        ,('CC', 'Set the C compiler to use.', 'gcc')
-        ,('CXX', 'Set the C++ compiler to use.', 'g++')
-        ,PathVariable('CCACHE', 'Integrate with CCache', '', PathVariable.PathAccept)
-        ,PathVariable('DISTCC', 'Invoke C/C++ compiler commands through DistCC', '', PathVariable.PathAccept)
-        ,EnumVariable('BUILDLEVEL', 'NoBug build level for debugging', 'ALPHA', allowed_values=('ALPHA', 'BETA', 'RELEASE'))
-        ,BoolVariable('DEBUG', 'Build with debugging information and no optimisations', False)
-        ,BoolVariable('OPTIMIZE', 'Build with strong optimisation (-O3)', False)
-        ,BoolVariable('VALGRIND', 'Run Testsuite under valgrind control', True)
-        ,BoolVariable('VERBOSE',  'Print full build commands', False)
-        ,('TESTSUITES', 'Run only Testsuites matching the given pattern', '')
-#       ,BoolVariable('OPENGL', 'Include support for OpenGL preview rendering', False)
-#       ,EnumVariable('DIST_TARGET', 'Build target architecture', 'auto', 
-#                   allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2)
-        ,PathVariable('PREFIX', 'Installation dir prefix', 'usr/local', PathVariable.PathAccept)
-        ,PathVariable('INSTALLDIR', 'Root output directory for install. Final installation will happen in INSTALLDIR/PREFIX/... ', '/', PathVariable.PathIsDir)
-        ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept)
-        ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept)
-     )
-    
-    return vars
-
-
-
-def prepareOptionsHelp(vars,env):
-    prelude = """
-USAGE:   scons [-c] [OPTS] [key=val [key=val...]] [TARGETS]
-     Build and optionally install Lumiera.
-     Without specifying any target, just the (re)build target will run.
-     Add -c to the commandline to clean up anything a given target would produce
-
-Special Targets:
-     build   : just compile and link
-     research: build experimental code (might fail)
-     testcode: additionally compile the Testsuite
-     check   : build and run the Testsuite
-     doc     : generate documentation (Doxygen)
-     all     : build and testcode and doc
-     install : install created artifacts at PREFIX
-
-Configuration Options:
-"""
-    Help(prelude + vars.GenerateHelpText(env))
-
-
-
-
-def configurePlatform(env):
-    """ locate required libs.
-        setup platform specific options.
-        Abort build in case of failure.
-    """
-    conf = env.Configure()
-    # run all configuration checks in the given env
-    
-    # Perform checks for prerequisites --------------------------------------------
-    problems = []
-    if not conf.TryAction('pkg-config --version > $TARGET')[0]:
-        problems.append('We need pkg-config for including library configurations, exiting.')
-    
-    if not conf.CheckLibWithHeader('m', 'math.h','C'):
-        problems.append('Did not find math.h / libm.')
-    
-    if not conf.CheckLibWithHeader('dl', 'dlfcn.h', 'C'):
-        problems.append('Functions for runtime dynamic loading not available.')
-    
-    if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
-        problems.append('Did not find the pthread lib or pthread.h.')
-    else:
-       conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD')
-       conf.env.Append(CCFLAGS = ' -pthread')
-    
-    if conf.CheckCHeader('execinfo.h'):
-       conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H')
-    
-    if conf.CheckCHeader('valgrind/valgrind.h'):
-        conf.env.Append(CPPFLAGS = ' -DHAVE_VALGRIND_H')
-    else:
-        print 'Valgrind not found. The use of Valgrind is optional; building without.'
-    
-    if not conf.CheckPkgConfig('nobugmt', 201006.1):
-        problems.append('Did not find NoBug [http://www.lumiera.org/nobug_manual.html].')
-    else:
-        conf.env.mergeConf('nobugmt')
-    
-    if not conf.CheckCXXHeader('tr1/memory'):
-        problems.append('We rely on the std::tr1 standard C++ extension for shared_ptr.')
-    
-    if not conf.CheckCXXHeader('boost/config.hpp'):
-        problems.append('We need the C++ boost-libraries.')
-    else:
-        if not conf.CheckCXXHeader('boost/scoped_ptr.hpp'):
-            problems.append('We need boost::scoped_ptr (scoped_ptr.hpp).')
-        if not conf.CheckCXXHeader('boost/format.hpp'):
-            problems.append('We need boost::format (header).')
-        if not conf.CheckLibWithHeader('boost_program_options-mt','boost/program_options.hpp','C++'):
-            problems.append('We need boost::program_options (including binary lib for linking).')
-        if not conf.CheckLibWithHeader('boost_system-mt','boost/system/error_code.hpp','C++'):
-            problems.append('We need the boost::system support library (including binary lib).')
-        if not conf.CheckLibWithHeader('boost_filesystem-mt','boost/filesystem.hpp','C++'):
-            problems.append('We need the boost::filesystem lib (including binary lib for linking).')
-        if not conf.CheckLibWithHeader('boost_regex-mt','boost/regex.hpp','C++'):
-            problems.append('We need the boost regular expression lib (incl. binary lib for linking).')
-    
-    
-    if conf.CheckLib(symbol='clock_gettime'):
-        print 'Using function clock_gettime() as defined in the C-lib...'
-    else:
-        if not conf.CheckLib(symbol='clock_gettime', library='rt'):
-            problems.append('No library known to provide the clock_gettime() function.')
-    
-    if not conf.CheckPkgConfig('gavl', 1.0):
-        problems.append('Did not find Gmerlin Audio Video Lib [http://gmerlin.sourceforge.net/gavl.html].')
-    else:
-        conf.env.mergeConf('gavl')
-    
-    if not conf.CheckPkgConfig('gtkmm-2.4', 2.8):
-        problems.append('Unable to configure GTK--')
-        
-    if not conf.CheckPkgConfig('glibmm-2.4', '2.16'):
-        problems.append('Unable to configure Lib glib--')
-    
-    if not conf.CheckPkgConfig('gthread-2.0', '2.12.4'):
-        problems.append('Need gthread support lib for glib-- based thread handling.')
-    
-    if not conf.CheckPkgConfig('cairomm-1.0', 0.6):
-        problems.append('Unable to configure Cairo--')
-    
-    verGDL = '2.27.1'
-    if not conf.CheckPkgConfig('gdl-1.0', verGDL, alias='gdl'):
-        print 'No sufficiently recent (>=%s) version of GDL found. Maybe use custom package gdl-lum?' % verGDL
-        if not conf.CheckPkgConfig('gdl-lum', verGDL, alias='gdl'):
-            problems.append('GNOME Docking Library not found. We either need a sufficiently recent GDL '
-                            'version (>=%s), or the custom package "gdl-lum" from Lumiera.org.' % verGDL)
-    
-    if not conf.CheckPkgConfig('librsvg-2.0', '2.18.1'):
-        problems.append('Need rsvg Library for rendering icons.')
-        
-    if not conf.CheckCHeader(['X11/Xutil.h', 'X11/Xlib.h'],'<>'):
-        problems.append('Xlib.h and Xutil.h required. Please install libx11-dev.')
-    
-    if not conf.CheckPkgConfig('xv')  : problems.append('Need libXv...')
-    if not conf.CheckPkgConfig('xext'): problems.append('Need libXext.')
-    
-    
-    # report missing dependencies
-    if problems:
-        print "*** unable to build due to the following problems:"
-        for isue in problems:
-            print " *  %s" % isue
-        print
-        print "build aborted."
-        Exit(1)
-    
-    print "** Gathered Library Info: %s" % conf.env.libInfo.keys()
-    
-    
-    # create new env containing the finished configuration
-    return conf.Finish()
-
-
-
-def defineSetupTargets(env):
-    """ build operations and targets to be done /before/ compiling.
-        things like creating a source tarball or preparing a version header.
-    """
-    pass    ## currently none
-
-
-
-def defineBuildTargets(env):
-    """ define the source file/dirs comprising each artifact to be built.
-        setup sub-environments with special build options if necessary.
-        We use a custom function to declare a whole tree of srcfiles. 
-    """
-    
-    # define Icons to render and install
-    vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
-    prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
-    icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
-              + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
-              )
-    
-    #define Configuration files to install
-    config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
-              + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
-              )
-    
-    # call subdir SConscript(s) for independent components
-    SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
-
-
-
-def definePostBuildTargets(env):
-    """ define further actions after the core build (e.g. Documentation).
-        define alias targets to trigger the installing.
-    """
-    Import('lumiera plugins tools gui testsuite')
-    build = env.Alias('build', lumiera + plugins + tools +gui)
-    
-    # additional files to be cleaned when cleaning 'build'
-    env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
-    env.Clean ('build', [ 'src/pre.gch' ])
-    
-    doxydoc = env.Doxygen('doc/devel/Doxyfile')
-    env.Alias ('doc', doxydoc)
-    env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
-    
-    env.Alias ('all', build + testsuite + doxydoc)
-    env.Default('build')
-    # SCons default target
-
-
-def defineInstallTargets(env):
-    """ define additional artifacts to be installed into target locations.
-        @note: we use customised SCons builders defining install targets 
-               for all executables automatically. see LumieraEnvironment.py
-    """
-    Import('lumiera plugins tools gui testsuite')
-    
-    env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
-#   env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
-    
-    env.Alias('install', gui)
-    env.Alias('install', '$DESTDIR')
-
-#####################################################################
-
-
-
-
-
-### === MAIN === ####################################################
-
-env = setupBasicEnvironment(localDefinitions)
-
-if not (isCleanupOperation(env) or isHelpRequest()):
-    env = configurePlatform(env)
-    
-# the various things we build. 
-# Each entry actually is a SCons-Node list.
-# Passing these entries to other builders defines dependencies.
-# 'lumiera'     : the App
-# 'gui'         : the GTK UI (plugin)
-# 'plugins'     : plugin shared lib
-# 'tools'       : small tool applications (e.g mpegtoc)
-
-defineSetupTargets(env)
-defineBuildTargets(env)
-definePostBuildTargets(env)
-defineInstallTargets(env)
-

From e64a17d1ba394d80c060261c1d65dea4bd74b81b Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 9 Jan 2012 05:13:15 +0100
Subject: [PATCH 75/87] SConstruct: reduce the remaining defs

no need to use functions anymore, since
only the clean and phony targets are left
---
 SConstruct     | 125 +++++++++++++++++++------------------------------
 src/SConscript |   6 +++
 2 files changed, 55 insertions(+), 76 deletions(-)

diff --git a/SConstruct b/SConstruct
index ccb0a73a7..e081d9144 100644
--- a/SConstruct
+++ b/SConstruct
@@ -53,85 +53,58 @@ import Platform
 
 #####################################################################
 
-
-def defineBuildTargets(env):
-    """ define the source file/dirs comprising each artifact to be built.
-        setup sub-environments with special build options if necessary.
-        We use a custom function to declare a whole tree of srcfiles. 
-    """
-    
-    # define Icons to render and install
-    vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
-    prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
-    icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
-              + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
-              )
-    
-    #define Configuration files to install
-    config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
-              + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
-              )
-    
-    # call subdir SConscript(s) for independent components
-    SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
-
-
-
-def definePostBuildTargets(env):
-    """ define further actions after the core build (e.g. Documentation).
-        define alias targets to trigger the installing.
-    """
-    Import('lumiera plugins tools gui testsuite')
-    build = env.Alias('build', lumiera + plugins + tools +gui)
-    
-    # additional files to be cleaned when cleaning 'build'
-    env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
-    env.Clean ('build', [ 'src/pre.gch' ])
-    
-    doxydoc = env.Doxygen('doc/devel/Doxyfile')
-    env.Alias ('doc', doxydoc)
-    env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
-    
-    env.Alias ('all', build + testsuite + doxydoc)
-    env.Default('build')
-    # SCons default target
-
-
-def defineInstallTargets(env):
-    """ define additional artifacts to be installed into target locations.
-        @note: we use customised SCons builders defining install targets 
-               for all executables automatically. see LumieraEnvironment.py
-    """
-    Import('lumiera plugins tools gui testsuite')
-    
-    env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
-#   env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
-    
-    env.Alias('install', gui)
-    env.Alias('install', '$DESTDIR')
-
-#####################################################################
-
-
-
-
-
-### === MAIN === ####################################################
-
 env = Setup.setupBasicEnvironment()
 
 if not (isCleanupOperation(env) or isHelpRequest()):
     env = Platform.configurePlatform(env)
-    
-# the various things we build. 
-# Each entry actually is a SCons-Node list.
-# Passing these entries to other builders defines dependencies.
-# 'lumiera'     : the App
-# 'gui'         : the GTK UI (plugin)
-# 'plugins'     : plugin shared lib
-# 'tools'       : small tool applications (e.g mpegtoc)
 
-defineBuildTargets(env)
-definePostBuildTargets(env)
-defineInstallTargets(env)
 
+#####################################################################
+
+# define Icons to render and install
+vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
+prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
+icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
+          + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
+          )
+
+#define Configuration files to install
+config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
+          + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
+          )
+
+doxydoc = env.Doxygen('doc/devel/Doxyfile')
+env.Alias ('doc', doxydoc)
+env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
+#  env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
+
+
+
+### === MAIN BUILD === ##############################################
+
+# call subdir SConscript(s) for to define the actual build targets
+SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
+
+# artifacts defined by the build targets
+Import('lumiera plugins tools gui testsuite')
+
+
+
+# additional files to be cleaned when cleaning 'build'
+env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
+env.Clean ('build', [ 'src/pre.gch' ])
+
+
+
+### === Alias Targets === ###########################################
+
+build = env.Alias('build', lumiera + plugins + tools +gui)
+
+env.Alias ('all', build + testsuite + doxydoc)
+env.Default('build')
+# SCons default target
+
+env.Alias('install', gui)
+env.Alias('install', '$DESTDIR')
+
+#####################################################################
diff --git a/src/SConscript b/src/SConscript
index c0718205d..3127af3ec 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -9,6 +9,7 @@ from Buildhelper import scanSubtree
 
 Import('env icons config')
 
+# define the source file/dirs comprising each artifact to be built.
 
 lLib  = env.SharedLibrary('lumiera',        srcSubtree('lib'),    install=True)
 lApp  = env.SharedLibrary('lumieracommon',  srcSubtree('common'), install=True, LIBS=lLib)
@@ -23,6 +24,11 @@ lumiera = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, install=True)
           + config
           )
 
+# Install the lumiera application:
+# symlink the executable into the bin dir
+env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
+
+
 # building Lumiera Plugins
 plugins = [] # currently none 
 

From 117851a94a503f6d4fa305932b62495f944096d7 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 10 Jan 2012 04:02:29 +0100
Subject: [PATCH 76/87] get rid of the additional scripts dir in pythonpath

---
 SConstruct                                         | 1 -
 admin/{render_icon.py => scons/IconSvgRenderer.py} | 7 ++++---
 admin/scons/LumieraEnvironment.py                  | 2 +-
 admin/scons/Setup.py                               | 1 -
 4 files changed, 5 insertions(+), 6 deletions(-)
 rename admin/{render_icon.py => scons/IconSvgRenderer.py} (99%)

diff --git a/SConstruct b/SConstruct
index e081d9144..1f30f54f9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -30,7 +30,6 @@
 
 #-----------------------------------Configuration
 TOOLDIR      = './admin/scons'    # SCons plugins
-SCRIPTDIR    = './admin'
 #-----------------------------------Configuration
 
 
diff --git a/admin/render_icon.py b/admin/scons/IconSvgRenderer.py
similarity index 99%
rename from admin/render_icon.py
rename to admin/scons/IconSvgRenderer.py
index 63bacbf37..363b696ac 100755
--- a/admin/render_icon.py
+++ b/admin/scons/IconSvgRenderer.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 #
-# render_icons.py  -  Icon rendering utility script
+# IconSvgRenderer.py  -  Icon rendering utility script
 #
 #  Copyright (C)         Lumiera.org
 #    2008,               Joel Holdsworth 
@@ -19,11 +19,12 @@
 #  along with this program; if not, write to the Free Software
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+import os
 import sys
 import getopt
-from xml.dom import minidom
-import os
 import shutil
+from xml.dom import minidom
+
 
 #svgDir = "svg"
 #prerenderedDir = "prerendered"
diff --git a/admin/scons/LumieraEnvironment.py b/admin/scons/LumieraEnvironment.py
index 1c314401b..100c83ca8 100644
--- a/admin/scons/LumieraEnvironment.py
+++ b/admin/scons/LumieraEnvironment.py
@@ -123,7 +123,7 @@ def register_LumieraResourceBuilder(env):
         used to generate png from the svg source using librsvg. 
     """
     
-    import render_icon as renderer  # load Joel's python script for invoking the rsvg-convert (SVG render)
+    import IconSvgRenderer as renderer  # load Joel's python script for invoking the rsvg-convert (SVG render)
     renderer.rsvgPath = env.subst("$TARGDIR/rsvg-convert")
     
     def invokeRenderer(target, source, env):
diff --git a/admin/scons/Setup.py b/admin/scons/Setup.py
index 23112a09b..976232198 100644
--- a/admin/scons/Setup.py
+++ b/admin/scons/Setup.py
@@ -32,7 +32,6 @@
 TARGDIR      = 'target'
 VERSION      = '0.pre.01'
 TOOLDIR      = './admin/scons'    # SCons plugins
-SCRIPTDIR    = './admin'
 OPTCACHE     = 'optcache' 
 CUSTOPTFILE  = 'custom-options'
 

From 4d466a2c2e8450b8ca6ca7f3f0ee277889464f89 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 10 Jan 2012 05:09:32 +0100
Subject: [PATCH 77/87] reorganise the initial setup calls

---
 SConstruct                        |  7 +---
 admin/scons/LumieraEnvironment.py | 14 +++++--
 admin/scons/Options.py            | 23 +++---------
 admin/scons/Platform.py           | 30 +++++----------
 admin/scons/Setup.py              | 61 ++++++++++++-------------------
 5 files changed, 52 insertions(+), 83 deletions(-)

diff --git a/SConstruct b/SConstruct
index 1f30f54f9..20788c040 100644
--- a/SConstruct
+++ b/SConstruct
@@ -39,7 +39,6 @@ import os
 import sys
 
 sys.path.append(TOOLDIR)
-sys.path.append(SCRIPTDIR)
 
 from Buildhelper import *
 from LumieraEnvironment import *
@@ -52,10 +51,8 @@ import Platform
 
 #####################################################################
 
-env = Setup.setupBasicEnvironment()
-
-if not (isCleanupOperation(env) or isHelpRequest()):
-    env = Platform.configurePlatform(env)
+env = Setup.defineBuildEnvironment()
+env = Platform.configure(env)
 
 
 #####################################################################
diff --git a/admin/scons/LumieraEnvironment.py b/admin/scons/LumieraEnvironment.py
index 100c83ca8..2acb071d9 100644
--- a/admin/scons/LumieraEnvironment.py
+++ b/admin/scons/LumieraEnvironment.py
@@ -22,7 +22,6 @@
 #####################################################################
 
 
-import os
 from os import path
 
 import SCons
@@ -38,9 +37,15 @@ class LumieraEnvironment(Environment):
         This allows us to carry structured config data without
         using global vars. Idea inspired by Ardour. 
     """
-    def __init__(self, pathConfig, **kw):
-        Environment.__init__ (self,**kw)
-        self.path = Record (pathConfig)
+    def __init__(self, buildSetup, buildVars, **kw):
+        kw.update(VERSION = buildSetup.VERSION
+                 ,TARGDIR = buildSetup.TARGDIR
+                 ,DESTDIR = '$INSTALLDIR/$PREFIX'
+                 ,toolpath = [buildSetup.TOOLDIR ]
+                 ,variables = buildVars
+                 )
+        Environment.__init__ (self, **kw)
+        self.path = Record (extract_localPathDefs(buildSetup))    # e.g. buildExe -> env.path.buildExe
         self.libInfo = {}
         self.Tool("BuilderGCH")
         self.Tool("BuilderDoxygen")
@@ -49,6 +54,7 @@ class LumieraEnvironment(Environment):
         register_LumieraResourceBuilder(self)
         register_LumieraCustomBuilders(self)
     
+    
     def Configure (self, *args, **kw):
         kw['env'] = self
         return apply(LumieraConfigContext, args, kw)
diff --git a/admin/scons/Options.py b/admin/scons/Options.py
index ed1c8bb93..bbccb20bd 100644
--- a/admin/scons/Options.py
+++ b/admin/scons/Options.py
@@ -22,28 +22,19 @@
 #####################################################################
 
 
-
-import os
-import sys
-
-from SCons.Script import *
-
-from Buildhelper import *
-from LumieraEnvironment import *
-
-
-#####################################################################
+from SCons.Script import PathVariable, EnumVariable, BoolVariable, Help
 
 
 
 
-def defineCmdlineVariables(vars):
+
+def defineCmdlineVariables(buildVars):
     """ several toggles and configuration variables can be set on the commandline,
         current settings will be persisted in a options cache file.
         you may define custom variable settings in a separate file. 
         Commandline will override both.
     """
-    vars.AddVariables(
+    buildVars.AddVariables(
          ('ARCHFLAGS', 'Set architecture-specific compilation flags (passed literally to gcc)','')
         ,('CC', 'Set the C compiler to use.', 'gcc')
         ,('CXX', 'Set the C++ compiler to use.', 'g++')
@@ -63,12 +54,10 @@ def defineCmdlineVariables(vars):
         ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept)
         ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept)
      )
-    
-    return vars
 
 
 
-def prepareOptionsHelp(vars,env):
+def prepareOptionsHelp(buildVars,env):
     prelude = """
 USAGE:   scons [-c] [OPTS] [key=val [key=val...]] [TARGETS]
      Build and optionally install Lumiera.
@@ -86,7 +75,7 @@ Special Targets:
 
 Configuration Options:
 """
-    Help(prelude + vars.GenerateHelpText(env))
+    Help(prelude + buildVars.GenerateHelpText(env))
 
 
 
diff --git a/admin/scons/Platform.py b/admin/scons/Platform.py
index 4d5d12e7b..4a102b040 100644
--- a/admin/scons/Platform.py
+++ b/admin/scons/Platform.py
@@ -22,32 +22,22 @@
 #####################################################################
 
 
-# NOTE: scons -h for help.
-# Read more about the SCons build system at: http://www.scons.org
-# Basically, this script just /defines/ the components and how they
-# fit together. SCons will derive the necessary build steps.
-
-
-
-import os
-import sys
-
 from SCons.Script import Exit
-
-from Buildhelper import *
-from LumieraEnvironment import *
+from Buildhelper import isCleanupOperation, isHelpRequest
 
 
 
 
-
-def configurePlatform(env):
-    """ locate required libs.
+def configure(env):
+    """ locate required libraries.
         setup platform specific options.
         Abort build in case of failure.
     """
+    if isCleanupOperation(env) or isHelpRequest():
+        return env # skip configure in these cases
+    
     conf = env.Configure()
-    # run all configuration checks in the given env
+    # run all configuration checks in the build environment defined thus far
     
     # Perform checks for prerequisites --------------------------------------------
     problems = []
@@ -63,11 +53,11 @@ def configurePlatform(env):
     if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
         problems.append('Did not find the pthread lib or pthread.h.')
     else:
-       conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD')
-       conf.env.Append(CCFLAGS = ' -pthread')
+        conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD')
+        conf.env.Append(CCFLAGS = ' -pthread')
     
     if conf.CheckCHeader('execinfo.h'):
-       conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H')
+        conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H')
     
     if conf.CheckCHeader('valgrind/valgrind.h'):
         conf.env.Append(CPPFLAGS = ' -DHAVE_VALGRIND_H')
diff --git a/admin/scons/Setup.py b/admin/scons/Setup.py
index 976232198..530ebdb91 100644
--- a/admin/scons/Setup.py
+++ b/admin/scons/Setup.py
@@ -21,14 +21,15 @@
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #####################################################################
 
+from SCons.Script import EnsurePythonVersion, EnsureSConsVersion, Variables, Decider
 
-# NOTE: scons -h for help.
-# Read more about the SCons build system at: http://www.scons.org
-# Basically, this script just /defines/ the components and how they
-# fit together. SCons will derive the necessary build steps.
+from LumieraEnvironment import *
+from Buildhelper import *
+import Options
 
 
-#-----------------------------------Configuration
+
+#-------------------------------------------------------Configuration
 TARGDIR      = 'target'
 VERSION      = '0.pre.01'
 TOOLDIR      = './admin/scons'    # SCons plugins
@@ -51,50 +52,33 @@ installIcon  = '#$DESTDIR/share/lumiera/icons'
 installUIRes = '#$DESTDIR/share/lumiera/'
 installConf  = '#$DESTDIR/lib/lumiera/config'
 
-#-----------------------------------Configuration
-localDefinitions = locals()
+#-------------------------------------------------------Configuration
+buildSetup = Record(locals())
 
 
 
 
-import os
-import sys
 
-from SCons.Script import *
-
-from Options import *
-
-from Buildhelper import *
-from LumieraEnvironment import *
-
-
-#####################################################################
-
-def setupBasicEnvironment():
-    """ define cmdline options, build type decisions
+def defineBuildEnvironment():
+    """ create a custom build environment,
+        define the basic compiler and linker flags,
+        define locations in source and target tree,
+        parse the commandline and pick up options
     """
-    EnsurePythonVersion(2,4)
     EnsureSConsVersion(1,0)
+    EnsurePythonVersion(2,4)
+    Decider('MD5-timestamp')  # detect changed files by timestamp, then do a MD5
     
-    Decider('MD5-timestamp') # detect changed files by timestamp, then do a MD5
-    
-    vars = Variables([OPTCACHE, CUSTOPTFILE])
-    vars = defineCmdlineVariables(vars)
-    
-    env = LumieraEnvironment(variables=vars
-                            ,toolpath = [TOOLDIR]
-                            ,pathConfig = extract_localPathDefs(localDefinitions) # e.g. buildExe -> env.path.buildExe
-                            ,TARGDIR  = TARGDIR
-                            ,DESTDIR = '$INSTALLDIR/$PREFIX'
-                            ,VERSION = VERSION
-                            )
-    handleVerboseMessages(env)
+    buildVars = Variables([OPTCACHE, CUSTOPTFILE])
+    Options.defineCmdlineVariables(buildVars)
+    env = LumieraEnvironment(buildSetup, buildVars)
     
     env.Replace( CPPPATH   =["#src"]    # used to find includes, "#" means always absolute to build-root
                , CPPDEFINES=['LUMIERA_VERSION='+VERSION ]    # note: it's a list to append further defines
                , CCFLAGS='-Wall -Wextra '
                , CFLAGS='-std=gnu99' 
                )
+    handleVerboseMessages(env)
     handleNoBugSwitches(env)
     
     env.Append(CPPDEFINES = '_GNU_SOURCE')
@@ -110,10 +94,12 @@ def setupBasicEnvironment():
     appendCppDefine(env,'PKGDATADIR','LUMIERA_CONFIG_PATH=\\"$PKGLIBDIR/:.\\"'
                                     ,'LUMIERA_CONFIG_PATH=\\"$DESTDIR/share/lumiera/:.\\"') 
     
-    prepareOptionsHelp(vars,env)
-    vars.Save(OPTCACHE, env)
+    Options.prepareOptionsHelp(buildVars,env)
+    buildVars.Save(OPTCACHE, env)
     return env
 
+
+
 def appendCppDefine(env,var,cppVar, elseVal=''):
     if env[var]:
         env.Append(CPPDEFINES = env.subst(cppVar) )
@@ -139,6 +125,7 @@ def handleNoBugSwitches(env):
     elif level == 'RELEASE':
         env.Replace( DEBUG = 0 )
 
+
 def handleVerboseMessages(env):
     """ toggle verbose build output """
     if not env['VERBOSE']:

From d793a070371c38d76de3e65770c6025bfb8120ef Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 10 Jan 2012 05:15:45 +0100
Subject: [PATCH 78/87] Icon-Rendering: Inkscape is not really required

the icon rendering script from Joel had a function
to invoke Inkscape; it seems this was a leftover
from earlier attempts to render the icons.

Now, we seem to rely on lib Cairor solely
---
 admin/scons/IconSvgRenderer.py | 33 +--------------------------------
 1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/admin/scons/IconSvgRenderer.py b/admin/scons/IconSvgRenderer.py
index 363b696ac..2e50d652b 100755
--- a/admin/scons/IconSvgRenderer.py
+++ b/admin/scons/IconSvgRenderer.py
@@ -26,9 +26,6 @@ import shutil
 from xml.dom import minidom
 
 
-#svgDir = "svg"
-#prerenderedDir = "prerendered"
-inkscapePath = "/usr/bin/inkscape"
 rsvgPath = "./rsvg-convert"
 artworkLayerPrefix = "artwork:"
 
@@ -38,7 +35,7 @@ artworkLayerPrefix = "artwork:"
 # - to parse a SVG
 # - to invoke Inkscape to render this SVG into a raster image (icon)
 # 
-# For the actual call into Incscape we rely on an executable 'rsvg-convert',
+# For the actual Cairo based SVG rendering we rely on an executable 'rsvg-convert',
 # which is built during the Lumiera build process.
 # 
 # Judging from the code and the actual SVGs, this seems to work as follows:
@@ -116,22 +113,6 @@ def parseSVG( file_path ):
               return artwork_name, size, parsePlateLayer( plate )
   return None
 
-def renderSvgInkscape(file_path, out_dir, artwork_name, rectangle, doc_size):
-
-  # Calculate the rendering rectangle
-  x1 = rectangle[0]
-  y1 = doc_size[1] - rectangle[1] - rectangle[3]
-  x2 = x1 + rectangle[2]
-  y2 = y1 + rectangle[3]
-  
-  # Call Inkscape to do the render
-  os.spawnlp(os.P_WAIT, inkscapePath, inkscapePath,
-    file_path,
-    "-z",
-    "-a %g:%g:%g:%g" % (x1, y1, x2, y2),
-    "-w %g" % (rectangle[2]), "-h %g" % (rectangle[3]),
-    "--export-png=" + os.path.join(out_dir, "%gx%g/%s.png" % (rectangle[2], rectangle[3], artwork_name)))
-
 def renderSvgRsvg(file_path, out_dir, artwork_name, rectangle, doc_size):
   # Prepare a Cairo context
   width = int(rectangle[2])
@@ -157,18 +138,6 @@ def getTargetNames(file_path):
   artwork_name, _ , rectangles = parseSVG(file_path)
   return ["%gx%g/%s.png" % (rectangle[2], rectangle[3], artwork_name) for rectangle in rectangles ]
 
-#def renderSvgIcons():
-#  listing = os.listdir(svgDir)
-#  for file_path in listing:
-#    [root, extension] = os.path.splitext(file_path)
-#    if extension.lower() == ".svg":
-#      renderSvgIcon(os.path.join(svgDir, file_path))
-
-#def copyPrerenderedIcons():
-#  listing = os.listdir(prerenderedDir)
-#  for list_item in listing:
-#    src_dir = os.path.join(prerenderedDir, list_item)
-#    copyMergeDirectory(src_dir, list_item)
 
 def printHelp():
   print "render-icon.py SRCFILE.svg TARGETDIR"

From 27db94a64c3a4d4a7eb41bc980021f7316ab320d Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 10 Jan 2012 05:52:00 +0100
Subject: [PATCH 79/87] adjust code / indentation style

no functional change
---
 admin/scons/Buildhelper.py        |  47 +++--
 admin/scons/IconSvgRenderer.py    | 221 ++++++++++-----------
 admin/scons/LumieraEnvironment.py |  68 +++----
 src/tool/rsvg-convert.c           | 312 ++++++++++++++++--------------
 4 files changed, 332 insertions(+), 316 deletions(-)

diff --git a/admin/scons/Buildhelper.py b/admin/scons/Buildhelper.py
index 990fa5921..9460defaf 100644
--- a/admin/scons/Buildhelper.py
+++ b/admin/scons/Buildhelper.py
@@ -25,11 +25,8 @@ import os
 import sys
 import glob
 import fnmatch
-import re
-import tarfile
 
 from SCons import Util
-from SCons.Action import Action
 
 
 
@@ -65,12 +62,12 @@ def scanSubtree(roots, patterns=SRCPATTERNS):
         (python generator function)
     """
     for root in globRootdirs(roots):
-        for (dir,_,files) in os.walk(root):
-            if dir.startswith('./'):
-                dir = dir[2:]
+        for (d,_,files) in os.walk(root):
+            if d.startswith('./'):
+                d = d[2:]
             for p in patterns:
                 for f in fnmatch.filter(files, p):
-                    yield os.path.join(dir,f)
+                    yield os.path.join(d,f)
 
 
 
@@ -78,16 +75,16 @@ def globRootdirs(roots):
     """ helper: expand shell wildcards and filter the resulting list,
         so that it only contains existing directories
     """
-    filter = lambda f: os.path.isdir(f) and os.path.exists(f)
+    isDirectory = lambda f: os.path.isdir(f) and os.path.exists(f)
     roots = glob.glob(roots)
-    return (dir for dir in roots if filter(dir) )
+    return (d for d in roots if isDirectory(d) )
 
 
 
 def findSrcTrees(location, patterns=SRCPATTERNS):
     """ find possible source tree roots, starting with the given location.
         When delving down from the initial location(s), a source tree is defined
-        as a directory containing source files and possibly further sub directories.
+        as a directory containidsource files and possibly further sub directories.
         After having initially expanded the given location with #globRootdirs, each
         directory is examined depth first, until encountering a directory containing
         source files, which then yields a result. Especially, this can be used to traverse
@@ -95,11 +92,11 @@ def findSrcTrees(location, patterns=SRCPATTERNS):
         to be built into packages, plugins, individual tool executables etc.
         @return: the relative path names of all source root dirs found (generator function).
     """
-    for dir in globRootdirs(location):
-        if isSrcDir(dir,patterns):
-            yield dir
+    for directory in globRootdirs(location):
+        if isSrcDir (directory,patterns):
+            yield directory
         else:
-            for result in findSrcTrees(str(dir)+'/*'):
+            for result in findSrcTrees (str(directory)+'/*'):
                 yield result
 
 
@@ -109,7 +106,7 @@ def isSrcDir(path, patterns=SRCPATTERNS):
         @return: True if it's a directory containing any source file
     """
     if not os.path.isdir(path):
-         return False
+        return False
     else:
         for p in patterns:
             if glob.glob(path+'/'+p):
@@ -124,30 +121,30 @@ def filterNodes(nlist, removeName=None):
     if removeName:
         predicate = lambda n : not fnmatch.fnmatch(os.path.basename(str(n[0])), removeName)
     else:
-        predicate = lambda n : True;
+        predicate = lambda n : True
     
     return filter(predicate, nlist)
 
 
 
-def getDirname(dir, basePrefix=None):
+def getDirname (d, basePrefix=None):
     """ extract directory name without leading path,
         or without the explicitly given basePrefix
     """
-    dir = os.path.realpath(dir)
-    if not os.path.isdir(dir):
-        dir,_ = os.path.split(dir)
+    d = os.path.realpath(d)
+    if not os.path.isdir(d):
+        d,_ = os.path.split(d)
     if basePrefix:
         basePrefix = os.path.realpath(basePrefix)
-        if str(dir).startswith(basePrefix):
-           name = str(dir)[len(basePrefix):]
+        if str(d).startswith(basePrefix):
+            name = str(d)[len(basePrefix):]
     else:
-        _, name = os.path.split(dir)
+        _, name = os.path.split(d)
     return name
 
 
 
-def createPlugins(env, dir, **kw):
+def createPlugins(env, directory, **kw):
     """ investigate the given source directory to identify all contained source trees.
         @return: a list of build nodes defining a plugin for each of these source trees.
     """
@@ -155,7 +152,7 @@ def createPlugins(env, dir, **kw):
                              , srcSubtree(tree)
                              , **kw
                              )
-            for tree in findSrcTrees(dir)
+            for tree in findSrcTrees(directory)
            ]
 
 
diff --git a/admin/scons/IconSvgRenderer.py b/admin/scons/IconSvgRenderer.py
index 2e50d652b..9de758100 100755
--- a/admin/scons/IconSvgRenderer.py
+++ b/admin/scons/IconSvgRenderer.py
@@ -54,130 +54,133 @@ artworkLayerPrefix = "artwork:"
 #
 
 
-def createDirectory( name ):
-  try:
-    if os.path.isfile(name):
-      os.remove(name)
-    if not os.path.exists(name):
-      os.mkdir(name)
-  except:
-    print 'WARNING: createDirectory("%s") failed. Permission problems?' % name
+def createDirectory (name):
+    try:
+        if os.path.isfile (name):
+            os.remove (name)
+        if not os.path.exists (name):
+            os.mkdir (name)
+    except:
+        print 'WARNING: createDirectory("%s") failed. Permission problems?' % name
 
 
-def copyMergeDirectory( src, dst ):
-  listing = os.listdir(src)
-  for file_name in listing:
-    src_file_path = os.path.join(src, file_name)
-    dst_file_path = os.path.join(dst, file_name)   
-    shutil.copyfile(src_file_path, dst_file_path)
+def copyMergeDirectory (src, dst):
+    listing = os.listdir (src)
+    for file_name in listing:
+        src_file_path = os.path.join (src, file_name)
+        dst_file_path = os.path.join (dst, file_name)   
+        shutil.copyfile (src_file_path, dst_file_path)
 
-def getDocumentSize( svg_element ):
-  width = float(svg_element.getAttribute("width"))
-  height = float(svg_element.getAttribute("height"))
-  return [width, height]
+def getDocumentSize (svg_element):
+    width =  float(svg_element.getAttribute("width"))
+    height = float(svg_element.getAttribute("height"))
+    return [width, height]
 
-def findChildLayerElement( parent_element ):
-  for node in parent_element.childNodes:
-    if node.nodeType == minidom.Node.ELEMENT_NODE:
-      if node.tagName == "g":
-        if node.getAttribute("inkscape:groupmode") == "layer":
-          return node
-  return None
- 
-def parsePlateLayer( layer ):
-  rectangles = []
-  for node in layer.childNodes:
-    if node.nodeType == minidom.Node.ELEMENT_NODE:
-      if node.tagName == "rect":
-        x = float(node.getAttribute("x"))
-        y = float(node.getAttribute("y"))
-        width = float(node.getAttribute("width"))
-        height = float(node.getAttribute("height"))
-        rectangles.append([x, y, width, height])
-  return rectangles
+def findChildLayerElement (parent_element):
+    for node in parent_element.childNodes:
+        if node.nodeType == minidom.Node.ELEMENT_NODE:
+            if node.tagName == "g":
+                if node.getAttribute("inkscape:groupmode") == "layer":
+                    return node
+    return None
 
-def parseSVG( file_path ):
-  print "Parsing " + file_path
-  svgdoc = minidom.parse(file_path)
-  for root_node in svgdoc.childNodes:
-    if root_node.nodeType == minidom.Node.ELEMENT_NODE:
-      if root_node.tagName == "svg":
-        size = getDocumentSize( root_node )
-        layer = findChildLayerElement( root_node )
-        if layer != None:
-          layer_name = layer.getAttribute("inkscape:label")
-          if layer_name[:len(artworkLayerPrefix)] == artworkLayerPrefix:
-            artwork_name = layer_name[len(artworkLayerPrefix):]
-            plate = findChildLayerElement( layer )
-            if plate != None:
-              return artwork_name, size, parsePlateLayer( plate )
-  return None
+def parsePlateLayer (layer):
+    rectangles = []
+    for node in layer.childNodes:
+        if node.nodeType == minidom.Node.ELEMENT_NODE:
+            if node.tagName == "rect":
+                x = float(node.getAttribute("x"))
+                y = float(node.getAttribute("y"))
+                width = float(node.getAttribute("width"))
+                height = float(node.getAttribute("height"))
+                rectangles.append([x, y, width, height])
+    return rectangles
 
-def renderSvgRsvg(file_path, out_dir, artwork_name, rectangle, doc_size):
-  # Prepare a Cairo context
-  width = int(rectangle[2])
-  height = int(rectangle[3])
-  
-  if not os.path.exists(rsvgPath):
-      print "Error: executable %s not found." % rsvgPath
+
+def parseSVG (file_path):
+    print "Parsing " + file_path
+    svgdoc = minidom.parse (file_path)
+    for root_node in svgdoc.childNodes:
+        if root_node.nodeType == minidom.Node.ELEMENT_NODE:
+            if root_node.tagName == "svg":
+                size = getDocumentSize (root_node)
+                layer = findChildLayerElement (root_node)
+                if layer != None:
+                    layer_name = layer.getAttribute ("inkscape:label")
+                    if layer_name[:len(artworkLayerPrefix)] == artworkLayerPrefix:
+                        artwork_name = layer_name[len(artworkLayerPrefix):]
+                        plate = findChildLayerElement(layer)
+                        if plate != None:
+                            return artwork_name, size, parsePlateLayer(plate)
+    return None
+
+
+def renderSvgRsvg (file_path, out_dir, artwork_name, rectangle, _doc_size):
+    # Prepare a Cairo context
+    width  = int(rectangle[2])
+    height = int(rectangle[3])
     
-  os.spawnlp(os.P_WAIT, rsvgPath, rsvgPath,
-    "--source-rect=%g:%g:%g:%g" % (rectangle[0], rectangle[1], rectangle[2], rectangle[3]),
-  	"--output=" + os.path.join(out_dir, "%gx%g/%s.png" % (rectangle[2], rectangle[3], artwork_name)),
-  	file_path)
+    if not os.path.exists(rsvgPath):
+        print "Error: executable %s not found." % rsvgPath
+    
+    os.spawnlp(os.P_WAIT, rsvgPath, rsvgPath,
+               "--source-rect=%g:%g:%g:%g" % (rectangle[0], rectangle[1], width, height),
+               "--output=" + os.path.join(out_dir, "%gx%g/%s.png" % (width, height, artwork_name)),
+               file_path)
 
-def renderSvgIcon(file_path, out_dir):
-  artwork_name, doc_size, rectangles = parseSVG(file_path)
-  for rectangle in rectangles:
-    renderSvgRsvg(file_path, out_dir, artwork_name, rectangle, doc_size)
+def renderSvgIcon (file_path, out_dir):
+    artwork_name, doc_size, rectangles = parseSVG (file_path)
+    for rectangle in rectangles:
+        renderSvgRsvg(file_path, out_dir, artwork_name, rectangle, doc_size)
 
-def getTargetNames(file_path):
-  """get a list of target names to be rendered from the given source SVG
-     usable to setup the build targets for SCons
-  """ 
-  artwork_name, _ , rectangles = parseSVG(file_path)
-  return ["%gx%g/%s.png" % (rectangle[2], rectangle[3], artwork_name) for rectangle in rectangles ]
+def getTargetNames (file_path):
+    """get a list of target names to be rendered from the given source SVG
+       usable to setup the build targets for SCons
+    """
+    artwork_name, _ , rectangles = parseSVG (file_path)
+    return ["%gx%g/%s.png" % (rectangle[2], rectangle[3], artwork_name) for rectangle in rectangles ]
 
 
 def printHelp():
-  print "render-icon.py SRCFILE.svg TARGETDIR"
-  print "An icon rendering utility script for lumiera"
+    print "render-icon.py SRCFILE.svg TARGETDIR"
+    print "An icon rendering utility script for lumiera"
 
 def parseArguments(argv):
-  optlist, args = getopt.getopt(argv, "")
-  
-  if len(args) == 2:
-    return args[0], args[1]
-  
-  printHelp()
-  return None, None
-
-def main(argv):
-  in_path, out_dir = parseArguments(argv)
-  
-  if not (in_path and out_dir):
-    print "Missing arguments in_path and out_dir."
-    sys.exit(1)
-  
-  if os.path.isfile(out_dir):
-    print "Unable to use '%s' as output directory, because it\'s a file." % out_dir
-    sys.exit(1)
-  if not os.path.isdir(out_dir):
-    print "Output directory '%s' not found." % out_dir
-    sys.exit(1)
-  
-  # Create the icons folders
-  createDirectory(os.path.join(out_dir, "48x48"))
-  createDirectory(os.path.join(out_dir, "32x32"))
-  createDirectory(os.path.join(out_dir, "24x24"))
-  createDirectory(os.path.join(out_dir, "22x22"))
-  createDirectory(os.path.join(out_dir, "16x16"))
-  
-  renderSvgIcon(in_path, out_dir)
+    _optlist, args = getopt.getopt(argv, "")
     
-  # Copy in prerendered icons
-  #copyPrerenderedIcons()
- 
+    if len(args) == 2:
+        return args[0], args[1]
+    
+    printHelp()
+    return None, None
+
+
+def main (argv):
+    in_path, out_dir = parseArguments(argv)
+    
+    if not (in_path and out_dir):
+        print "Missing arguments in_path and out_dir."
+        sys.exit(1)
+    
+    if os.path.isfile(out_dir):
+        print "Unable to use '%s' as output directory, because it\'s a file." % out_dir
+        sys.exit(1)
+    if not os.path.isdir(out_dir):
+        print "Output directory '%s' not found." % out_dir
+        sys.exit(1)
+    
+    # Create the icons folders
+    createDirectory(os.path.join(out_dir, "48x48"))
+    createDirectory(os.path.join(out_dir, "32x32"))
+    createDirectory(os.path.join(out_dir, "24x24"))
+    createDirectory(os.path.join(out_dir, "22x22"))
+    createDirectory(os.path.join(out_dir, "16x16"))
+    
+    renderSvgIcon (in_path, out_dir)
+
+
+
+
 if __name__=="__main__":
     main(sys.argv[1:])
 
diff --git a/admin/scons/LumieraEnvironment.py b/admin/scons/LumieraEnvironment.py
index 2acb071d9..f033f4d64 100644
--- a/admin/scons/LumieraEnvironment.py
+++ b/admin/scons/LumieraEnvironment.py
@@ -24,8 +24,8 @@
 
 from os import path
 
-import SCons
 import SCons.SConf
+from SCons.Action import Action
 from SCons.Environment import Environment
 
 from Buildhelper import *
@@ -157,43 +157,43 @@ def register_LumieraResourceBuilder(env):
         return (generateTargets, source)
     
     def IconResource(env, source):
-         """Copy icon pixmap to corresponding icon dir. """
-         subdir = getDirname(str(source))
-         toBuild = env.path.buildIcon+subdir
-         toInstall = env.path.installIcon+subdir
-         env.Install (toInstall, source)
-         return env.Install(toBuild, source)
+        """Copy icon pixmap to corresponding icon dir. """
+        subdir = getDirname(str(source))
+        toBuild = env.path.buildIcon+subdir
+        toInstall = env.path.installIcon+subdir
+        env.Install (toInstall, source)
+        return env.Install(toBuild, source)
     
     def GuiResource(env, source):
-         subdir = getDirname(str(source))
-         toBuild = env.path.buildUIRes+subdir
-         toInstall = env.path.installUIRes+subdir
-         env.Install (toInstall, source)
-         return env.Install(toBuild, source)
+        subdir = getDirname(str(source))
+        toBuild = env.path.buildUIRes+subdir
+        toInstall = env.path.installUIRes+subdir
+        env.Install (toInstall, source)
+        return env.Install(toBuild, source)
     
     def ConfigData(env, source, targetDir=None):
-         """ install (copy) configuration- and metadata.
-             target dir is either the install location configured (in SConstruct),
-             or an explicitly given absolute or relative path segment, which might refer
-             to the location of the executable through the $ORIGIN token
-         """   
-         subdir = getDirname(str(source), env.path.srcConf) # removes source location path prefix
-         if targetDir:
-             if path.isabs(targetDir):
-                 toBuild = toInstall = path.join(targetDir,subdir)
-             else:
-                 if targetDir.startswith('$ORIGIN'):
-                     targetDir = targetDir[len('$ORIGIN'):]
-                     toBuild = path.join(env.path.buildExe, targetDir, subdir)
-                     toInstall = path.join(env.path.installExe, targetDir, subdir)
-                 else:
-                     toBuild = path.join(env.path.buildConf, targetDir, subdir)
-                     toInstall = path.join(env.path.installConf, targetDir, subdir)
-         else:
-             toBuild = path.join(env.path.buildConf,subdir)
-             toInstall = path.join(env.path.installConf,subdir)
-         env.Install (toInstall, source)
-         return env.Install(toBuild, source)
+        """ install (copy) configuration- and metadata.
+            target dir is either the install location configured (in SConstruct),
+            or an explicitly given absolute or relative path segment, which might refer
+            to the location of the executable through the $ORIGIN token
+        """   
+        subdir = getDirname(str(source), env.path.srcConf) # removes source location path prefix
+        if targetDir:
+            if path.isabs(targetDir):
+                toBuild = toInstall = path.join(targetDir,subdir)
+            else:
+                if targetDir.startswith('$ORIGIN'):
+                    targetDir = targetDir[len('$ORIGIN'):]
+                    toBuild = path.join(env.path.buildExe, targetDir, subdir)
+                    toInstall = path.join(env.path.installExe, targetDir, subdir)
+                else:
+                    toBuild = path.join(env.path.buildConf, targetDir, subdir)
+                    toInstall = path.join(env.path.installConf, targetDir, subdir)
+        else:
+            toBuild = path.join(env.path.buildConf,subdir)
+            toInstall = path.join(env.path.installConf,subdir)
+        env.Install (toInstall, source)
+        return env.Install(toBuild, source)
     
     
     buildIcon = env.Builder( action = Action(invokeRenderer, "rendering Icon: $SOURCE --> $TARGETS")
diff --git a/src/tool/rsvg-convert.c b/src/tool/rsvg-convert.c
index 9fcf67b9c..eee28cc07 100644
--- a/src/tool/rsvg-convert.c
+++ b/src/tool/rsvg-convert.c
@@ -1,32 +1,28 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+/*
+  rsvg-convert.c  -  Command line utility for exercising rsvg with cairo. 
+
+  Copyright (C)      Red Hat, Inc.
+    2005,            Carl Worth 
+                     Caleb Moore 
+                     Dom Lachowicz 
+    2008,            Joel Holdsworth 
+
+  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.
+
+* *****************************************************/
 
-   rsvg-convert.c: Command line utility for exercising rsvg with cairo.
- 
-   Copyright (C) 2005 Red Hat, Inc.
-   Copyright (C) 2005 Dom Lachowicz 
-   Copyright (C) 2005 Caleb Moore 
-   Copyright (C) 2008 Joel Holdsworth 
-  
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library 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
-   Library General Public License for more details.
-  
-   You should have received a copy of the GNU Library General Public
-   License along with this program; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
-  
-   Authors: Carl Worth , 
-            Caleb Moore ,
-            Dom Lachowicz ,
-            Joel Holdsworth 
-*/
 
 #ifndef N_
 #define N_(X) X
@@ -40,183 +36,203 @@
 #include 
 #include 
 
+
 #ifdef CAIRO_HAS_PS_SURFACE
-#include 
+  #include 
 #endif
 
 #ifdef CAIRO_HAS_PDF_SURFACE
-#include 
+  #include 
 #endif
 
 #ifdef CAIRO_HAS_SVG_SURFACE
-#include 
+  #include 
 #endif
 
 #ifndef _
-#define _(X) X
+  #define _(X) X
 #endif
 
-struct RsvgSizeCallbackData {
+
+struct RsvgSizeCallbackData
+  {
     gint width;
     gint height;
-};
+  };
 
-struct RsvgSourceRectangle {
+struct RsvgSourceRectangle 
+  {
     double left;
     double top;
     double width;
     double height;
-};
+  };
+
 
 static void
 display_error (GError * err)
 {
-    if (err) {
-        g_print ("%s\n", err->message);
-        g_error_free (err);
+  if (err) 
+    {
+      g_print ("%s\n", err->message);
+      g_error_free (err);
     }
 }
 
+
 static void
 rsvg_cairo_size_callback (int *width, int *height, gpointer data)
 {
-    RsvgDimensionData *dimensions = data;
-    *width = dimensions->width;
-    *height = dimensions->height;
+  RsvgDimensionData *dimensions = data;
+  *width = dimensions->width;
+  *height = dimensions->height;
 }
 
+
 static cairo_status_t
 rsvg_cairo_write_func (void *closure, const unsigned char *data, unsigned int length)
 {
-    if (fwrite (data, 1, length, (FILE *) closure) == length)
-		return CAIRO_STATUS_SUCCESS;
-	return CAIRO_STATUS_WRITE_ERROR;
+  if (fwrite (data, 1, length, (FILE *) closure) == length)
+      return CAIRO_STATUS_SUCCESS;
+  return CAIRO_STATUS_WRITE_ERROR;
 }
 
+
 int
 main (int argc, char **argv)
 {
-    GOptionContext *g_option_context;
-    int width = -1;
-    int height = -1;
-    char *source_rect_string = NULL;
-    char *output = NULL;
-    GError *error = NULL;
-    char *filename = NULL;
-    
-    char **args = NULL;
-    RsvgHandle *rsvg;
-    cairo_surface_t *surface = NULL;
-    cairo_t *cr = NULL;
-    RsvgDimensionData dimensions;
-    FILE *output_file = stdout;
-    
-    struct RsvgSourceRectangle source_rect = {0, 0, 0, 0};
+  GOptionContext *g_option_context;
+  int width = -1;
+  int height = -1;
+  char *source_rect_string = NULL;
+  char *output = NULL;
+  GError *error = NULL;
+  char *filename = NULL;
+  
+  char **args = NULL;
+  RsvgHandle *rsvg;
+  cairo_surface_t *surface = NULL;
+  cairo_t *cr = NULL;
+  RsvgDimensionData dimensions;
+  FILE *output_file = stdout;
+  
+  struct RsvgSourceRectangle source_rect = {0, 0, 0, 0};
 
-    GOptionEntry options_table[] = {
-        {"width", 'w', 0, G_OPTION_ARG_INT, &width,
-         N_("width [optional; defaults to the SVG's width]"), N_("")},
-        {"height", 'h', 0, G_OPTION_ARG_INT, &height,
-         N_("height [optional; defaults to the SVG's height]"), N_("")},
-        {"source-rect", 'r', 0, G_OPTION_ARG_STRING, &source_rect_string,
-         N_("source rectangle [optional; defaults to rectangle of the SVG document]"), N_("left:top:width:height")},
-        {"output", 'o', 0, G_OPTION_ARG_STRING, &output,
-         N_("output filename"), NULL},
-        {G_OPTION_REMAINING, 0, 0,  G_OPTION_ARG_FILENAME_ARRAY, &args, NULL, N_("FILE")},
-        {NULL}
-    };
+  GOptionEntry options_table[] = {
+      {"width", 'w', 0, G_OPTION_ARG_INT, &width,
+       N_("width [optional; defaults to the SVG's width]"), N_("")},
+      {"height", 'h', 0, G_OPTION_ARG_INT, &height,
+       N_("height [optional; defaults to the SVG's height]"), N_("")},
+      {"source-rect", 'r', 0, G_OPTION_ARG_STRING, &source_rect_string,
+       N_("source rectangle [optional; defaults to rectangle of the SVG document]"), N_("left:top:width:height")},
+      {"output", 'o', 0, G_OPTION_ARG_STRING, &output,
+       N_("output filename"), NULL},
+      {G_OPTION_REMAINING, 0, 0,  G_OPTION_ARG_FILENAME_ARRAY, &args, NULL, N_("FILE")},
+      {NULL}
+  };
 
-	/* Set the locale so that UTF-8 filenames work */
-	setlocale(LC_ALL, "");
+  /* Set the locale so that UTF-8 filenames work */
+  setlocale (LC_ALL, "");
 
-    g_option_context = g_option_context_new (_("- SVG Converter"));
-    g_option_context_add_main_entries (g_option_context, options_table, NULL);
-    g_option_context_set_help_enabled (g_option_context, TRUE);
-    if (!g_option_context_parse (g_option_context, &argc, &argv, &error)) {
-        display_error (error);
-        exit (1);
+  g_option_context = g_option_context_new (_("- SVG Converter"));
+  g_option_context_add_main_entries (g_option_context, options_table, NULL);
+  g_option_context_set_help_enabled (g_option_context, TRUE);
+  if (!g_option_context_parse (g_option_context, &argc, &argv, &error))
+    {
+      display_error (error);
+      exit (1);
     }
 
-    g_option_context_free (g_option_context);
+  g_option_context_free (g_option_context);
 
-    if (output != NULL) {
-        output_file = fopen (output, "wb");
-        if (!output_file) {
-            fprintf (stderr, _("Error saving to file: %s\n"), output);
-            exit (1);
+  if (output != NULL) 
+    {
+      output_file = fopen (output, "wb");
+      if (!output_file) 
+        {
+          fprintf (stderr, _("Error saving to file: %s\n"), output);
+          exit (1);
         }
     }
-    
-    if (args[0] != NULL) {
-    	filename = args[0];
-    }
-   
-    /* Parse the source rect */
-    if(source_rect_string != NULL) {
-    	const int n = sscanf(source_rect_string, "%lg:%lg:%lg:%lg", 
-    		&source_rect.left, &source_rect.top,
-    		&source_rect.width, &source_rect.height);
-    	if(n != 4 || source_rect.width <= 0.0 || source_rect.height < 0.0) {
-    		fprintf (stderr, _("Invalid source rect: %s\n"), source_rect_string);
-    		exit(1);
-    	}
-	}
-
-    rsvg_init ();
-
-    rsvg = rsvg_handle_new_from_file (filename, &error);
-
-    if (!rsvg) {
-        fprintf (stderr, _("Error reading SVG:"));
-        display_error (error);
-        fprintf (stderr, "\n");
-        exit (1);
+  
+  if (args[0] != NULL) 
+      filename = args[0];
+ 
+  /* Parse the source rect */
+  if(source_rect_string != NULL) 
+    {
+      const int n = sscanf(source_rect_string, "%lg:%lg:%lg:%lg", 
+                           &source_rect.left, &source_rect.top,
+                           &source_rect.width, &source_rect.height);
+      if (n != 4 || source_rect.width <= 0.0 || source_rect.height < 0.0)
+        {
+          fprintf (stderr, _("Invalid source rect: %s\n"), source_rect_string);
+          exit(1);
+        }
     }
 
-	/* if the user did not specify a source rectangle, get the page size from the SVG */
-	if(source_rect_string == NULL) {
-    	rsvg_handle_set_size_callback (rsvg, rsvg_cairo_size_callback, &dimensions, NULL);
-    	source_rect.left = 0;
-    	source_rect.top = 0;
-		source_rect.width = dimensions.width;
-		source_rect.height = dimensions.height;
+  rsvg_init ();
+
+  rsvg = rsvg_handle_new_from_file (filename, &error);
+
+  if (!rsvg)
+    {
+      fprintf (stderr, _("Error reading SVG:"));
+      display_error (error);
+      fprintf (stderr, "\n");
+      exit (1);
     }
 
-    rsvg_handle_get_dimensions (rsvg, &dimensions);
-
-	if(width != -1 && height != -1) {
-		dimensions.width = width;
-		dimensions.height = height;
-	} else if(source_rect_string != NULL) {
-		dimensions.width = source_rect.width;
-		dimensions.height = source_rect.height;
-	}
-		            
-    surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
-                                          dimensions.width, dimensions.height);
-
-    cr = cairo_create (surface);
-    
-    cairo_translate(cr, -source_rect.left, -source_rect.top);
-    
-    if(width != -1 && height != -1 && source_rect_string != NULL) {
-    	cairo_scale(cr, (double)dimensions.width / (double)source_rect.width,
-    		(double)dimensions.height / (double)source_rect.height);
+  /* if the user did not specify a source rectangle, get the page size from the SVG */
+  if(source_rect_string == NULL) 
+    {
+      rsvg_handle_set_size_callback (rsvg, rsvg_cairo_size_callback, &dimensions, NULL);
+      source_rect.left = 0;
+      source_rect.top = 0;
+      source_rect.width = dimensions.width;
+      source_rect.height = dimensions.height;
     }
 
-    rsvg_handle_render_cairo (rsvg, cr);
+  rsvg_handle_get_dimensions (rsvg, &dimensions);
 
-    cairo_surface_write_to_png_stream (surface, rsvg_cairo_write_func, output_file);
+  if (width != -1 && height != -1)
+    {
+      dimensions.width = width;
+      dimensions.height = height;
+    }
+  else if(source_rect_string != NULL) 
+    {
+      dimensions.width = source_rect.width;
+      dimensions.height = source_rect.height;
+    }
+                  
+  surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+                                        dimensions.width,
+                                        dimensions.height);
 
-    g_object_unref (G_OBJECT (rsvg));
+  cr = cairo_create (surface);
+  
+  cairo_translate (cr, -source_rect.left, -source_rect.top);
+  
+  if (width != -1 && height != -1 && source_rect_string != NULL)
+    {
+      cairo_scale (cr,
+                   (double)dimensions.width / (double)source_rect.width,
+                   (double)dimensions.height / (double)source_rect.height);
+    }
 
-    cairo_destroy (cr);
-    cairo_surface_destroy (surface);
+  rsvg_handle_render_cairo (rsvg, cr);
 
-    fclose (output_file);
+  cairo_surface_write_to_png_stream (surface, rsvg_cairo_write_func, output_file);
 
-    rsvg_term ();
+  g_object_unref (G_OBJECT (rsvg));
 
-    return 0;
+  cairo_destroy (cr);
+  cairo_surface_destroy (surface);
+
+  fclose (output_file);
+
+  rsvg_term ();
+
+  return 0;
 }
-

From 56ac1afe18384579ffdd5bb9e0bf12329be4c042 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 10 Jan 2012 08:06:09 +0100
Subject: [PATCH 80/87] move Icon building down into separate SConscript

---
 SConstruct                                    |  14 +--
 admin/scons/Buildhelper.py                    |   3 +-
 admin/scons/LumieraEnvironment.py             |   5 +-
 admin/scons/Setup.py                          |   2 -
 data/SConscript                               |  25 +++++
 data/icons/README                             |  26 +++++
 .../icons}/prerendered/16x16/panel-assets.png | Bin
 .../prerendered/16x16/panel-timeline.png      | Bin
 .../icons}/prerendered/16x16/panel-viewer.png | Bin
 .../icons}/prerendered/22x22/panel-assets.png | Bin
 .../icons}/prerendered/22x22/panel-viewer.png | Bin
 .../icons}/prerendered/32x32/panel-assets.png | Bin
 .../icons}/prerendered/32x32/panel-viewer.png | Bin
 {icons => data/icons}/svg/app-icon.svg        |   0
 {icons => data/icons}/svg/tool-arrow.svg      |   0
 {icons => data/icons}/svg/tool-i-beam.svg     |   0
 {icons => data/icons}/svg/track-disabled.svg  |   0
 {icons => data/icons}/svg/track-enabled.svg   |   0
 {icons => data/icons}/svg/track-locked.svg    |   0
 {icons => data/icons}/svg/track-unlocked.svg  |   0
 {icons => data/icons}/timeline-panel.svg      |   0
 icons/Makefile.am                             |  97 ------------------
 src/SConscript                                |   2 +-
 23 files changed, 58 insertions(+), 116 deletions(-)
 create mode 100644 data/SConscript
 create mode 100644 data/icons/README
 rename {icons => data/icons}/prerendered/16x16/panel-assets.png (100%)
 rename {icons => data/icons}/prerendered/16x16/panel-timeline.png (100%)
 rename {icons => data/icons}/prerendered/16x16/panel-viewer.png (100%)
 rename {icons => data/icons}/prerendered/22x22/panel-assets.png (100%)
 rename {icons => data/icons}/prerendered/22x22/panel-viewer.png (100%)
 rename {icons => data/icons}/prerendered/32x32/panel-assets.png (100%)
 rename {icons => data/icons}/prerendered/32x32/panel-viewer.png (100%)
 rename {icons => data/icons}/svg/app-icon.svg (100%)
 rename {icons => data/icons}/svg/tool-arrow.svg (100%)
 rename {icons => data/icons}/svg/tool-i-beam.svg (100%)
 rename {icons => data/icons}/svg/track-disabled.svg (100%)
 rename {icons => data/icons}/svg/track-enabled.svg (100%)
 rename {icons => data/icons}/svg/track-locked.svg (100%)
 rename {icons => data/icons}/svg/track-unlocked.svg (100%)
 rename {icons => data/icons}/timeline-panel.svg (100%)
 delete mode 100644 icons/Makefile.am

diff --git a/SConstruct b/SConstruct
index 20788c040..a82c9060f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -57,18 +57,6 @@ env = Platform.configure(env)
 
 #####################################################################
 
-# define Icons to render and install
-vector_icon_dir      = env.subst(env.path.srcIcon+'svg')
-prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
-icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
-          + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
-          )
-
-#define Configuration files to install
-config  = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
-          + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
-          )
-
 doxydoc = env.Doxygen('doc/devel/Doxyfile')
 env.Alias ('doc', doxydoc)
 env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
@@ -79,7 +67,7 @@ env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
 ### === MAIN BUILD === ##############################################
 
 # call subdir SConscript(s) for to define the actual build targets
-SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
+SConscript(dirs=['data','src','src/tool','research','tests'], exports='env')
 
 # artifacts defined by the build targets
 Import('lumiera plugins tools gui testsuite')
diff --git a/admin/scons/Buildhelper.py b/admin/scons/Buildhelper.py
index 9460defaf..673d050ba 100644
--- a/admin/scons/Buildhelper.py
+++ b/admin/scons/Buildhelper.py
@@ -136,8 +136,9 @@ def getDirname (d, basePrefix=None):
         d,_ = os.path.split(d)
     if basePrefix:
         basePrefix = os.path.realpath(basePrefix)
+        name = str(d)
         if str(d).startswith(basePrefix):
-            name = str(d)[len(basePrefix):]
+            name = name[len(basePrefix):]
     else:
         _, name = os.path.split(d)
     return name
diff --git a/admin/scons/LumieraEnvironment.py b/admin/scons/LumieraEnvironment.py
index f033f4d64..8d2d8db43 100644
--- a/admin/scons/LumieraEnvironment.py
+++ b/admin/scons/LumieraEnvironment.py
@@ -171,13 +171,14 @@ def register_LumieraResourceBuilder(env):
         env.Install (toInstall, source)
         return env.Install(toBuild, source)
     
-    def ConfigData(env, source, targetDir=None):
+    def ConfigData(env, prefix, source, targetDir=None):
         """ install (copy) configuration- and metadata.
             target dir is either the install location configured (in SConstruct),
             or an explicitly given absolute or relative path segment, which might refer
             to the location of the executable through the $ORIGIN token
         """   
-        subdir = getDirname(str(source), env.path.srcConf) # removes source location path prefix
+        source = path.join(prefix,str(source))
+        subdir = getDirname(source, prefix)  # removes source location path prefix
         if targetDir:
             if path.isabs(targetDir):
                 toBuild = toInstall = path.join(targetDir,subdir)
diff --git a/admin/scons/Setup.py b/admin/scons/Setup.py
index 530ebdb91..5a064381d 100644
--- a/admin/scons/Setup.py
+++ b/admin/scons/Setup.py
@@ -37,8 +37,6 @@ OPTCACHE     = 'optcache'
 CUSTOPTFILE  = 'custom-options'
 
 # these are accessible via env.path.xxxx
-srcIcon      = 'icons'
-srcConf      = 'data/config'
 buildExe     = '#$TARGDIR'
 buildLib     = '#$TARGDIR/modules'
 buildPlug    = '#$TARGDIR/modules'
diff --git a/data/SConscript b/data/SConscript
new file mode 100644
index 000000000..d2407b502
--- /dev/null
+++ b/data/SConscript
@@ -0,0 +1,25 @@
+# -*- python -*-
+##
+## SConscript  -  SCons buildscript for Icons and Resources
+##
+
+from Buildhelper import scanSubtree
+
+Import('env')
+
+
+# define Icons to render and install
+vector_icon_dir      = 'icons/svg'
+prerendered_icon_dir = 'icons/prerendered'
+
+icons   = ( [env.IconRender(f)   for f in scanSubtree(vector_icon_dir,      ['*.svg'])]
+          + [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
+          )
+
+#define Configuration files to install (dir-prefix, name)
+config  = ( env.ConfigData('config','setup.ini', targetDir='$ORIGIN')
+          + env.ConfigData('config','dummy_lumiera.ini')
+          )
+
+
+Export('icons config')
diff --git a/data/icons/README b/data/icons/README
new file mode 100644
index 000000000..b56ffe9f2
--- /dev/null
+++ b/data/icons/README
@@ -0,0 +1,26 @@
+#
+# Lumiera Icon Artwork
+#
+#  Copyright (C)         Lumiera.org
+#    2008,               Joel Holdsworth 
+#
+#  Icon Artwork and similar materials accompanying the Lumiera Application
+#  is dual-licensed under the GNU General Public License version 2 or above,
+#  and
+#  Creative Commons Attribution-ShareAlike 3.0 Unported License
+#
+#
+
+
+This directory holds Icons and similar graphics resources for the Lumiera GUI.
+
+- prerendered: Raster image Icons rendered into a selection of sizes
+- svg: Scalable Vector Grahpics Icons, to be rendered into suitable sizes
+       by the build process. Rendering is done with the help of lib Cairo.
+       The build creates an executable from src/tools/rsvg-convert.c
+       The invocation of the icon rendering is done with the help of a
+       Python script IconSvgRenderer.py, which first parses the SVG document
+       and then invokes rsvg-convert to generate the raster images.
+
+
+
diff --git a/icons/prerendered/16x16/panel-assets.png b/data/icons/prerendered/16x16/panel-assets.png
similarity index 100%
rename from icons/prerendered/16x16/panel-assets.png
rename to data/icons/prerendered/16x16/panel-assets.png
diff --git a/icons/prerendered/16x16/panel-timeline.png b/data/icons/prerendered/16x16/panel-timeline.png
similarity index 100%
rename from icons/prerendered/16x16/panel-timeline.png
rename to data/icons/prerendered/16x16/panel-timeline.png
diff --git a/icons/prerendered/16x16/panel-viewer.png b/data/icons/prerendered/16x16/panel-viewer.png
similarity index 100%
rename from icons/prerendered/16x16/panel-viewer.png
rename to data/icons/prerendered/16x16/panel-viewer.png
diff --git a/icons/prerendered/22x22/panel-assets.png b/data/icons/prerendered/22x22/panel-assets.png
similarity index 100%
rename from icons/prerendered/22x22/panel-assets.png
rename to data/icons/prerendered/22x22/panel-assets.png
diff --git a/icons/prerendered/22x22/panel-viewer.png b/data/icons/prerendered/22x22/panel-viewer.png
similarity index 100%
rename from icons/prerendered/22x22/panel-viewer.png
rename to data/icons/prerendered/22x22/panel-viewer.png
diff --git a/icons/prerendered/32x32/panel-assets.png b/data/icons/prerendered/32x32/panel-assets.png
similarity index 100%
rename from icons/prerendered/32x32/panel-assets.png
rename to data/icons/prerendered/32x32/panel-assets.png
diff --git a/icons/prerendered/32x32/panel-viewer.png b/data/icons/prerendered/32x32/panel-viewer.png
similarity index 100%
rename from icons/prerendered/32x32/panel-viewer.png
rename to data/icons/prerendered/32x32/panel-viewer.png
diff --git a/icons/svg/app-icon.svg b/data/icons/svg/app-icon.svg
similarity index 100%
rename from icons/svg/app-icon.svg
rename to data/icons/svg/app-icon.svg
diff --git a/icons/svg/tool-arrow.svg b/data/icons/svg/tool-arrow.svg
similarity index 100%
rename from icons/svg/tool-arrow.svg
rename to data/icons/svg/tool-arrow.svg
diff --git a/icons/svg/tool-i-beam.svg b/data/icons/svg/tool-i-beam.svg
similarity index 100%
rename from icons/svg/tool-i-beam.svg
rename to data/icons/svg/tool-i-beam.svg
diff --git a/icons/svg/track-disabled.svg b/data/icons/svg/track-disabled.svg
similarity index 100%
rename from icons/svg/track-disabled.svg
rename to data/icons/svg/track-disabled.svg
diff --git a/icons/svg/track-enabled.svg b/data/icons/svg/track-enabled.svg
similarity index 100%
rename from icons/svg/track-enabled.svg
rename to data/icons/svg/track-enabled.svg
diff --git a/icons/svg/track-locked.svg b/data/icons/svg/track-locked.svg
similarity index 100%
rename from icons/svg/track-locked.svg
rename to data/icons/svg/track-locked.svg
diff --git a/icons/svg/track-unlocked.svg b/data/icons/svg/track-unlocked.svg
similarity index 100%
rename from icons/svg/track-unlocked.svg
rename to data/icons/svg/track-unlocked.svg
diff --git a/icons/timeline-panel.svg b/data/icons/timeline-panel.svg
similarity index 100%
rename from icons/timeline-panel.svg
rename to data/icons/timeline-panel.svg
diff --git a/icons/Makefile.am b/icons/Makefile.am
deleted file mode 100644
index 0f34d924b..000000000
--- a/icons/Makefile.am
+++ /dev/null
@@ -1,97 +0,0 @@
-#  Copyright (C)         Lumiera.org
-#    2008,               Joel Holdsworth 
-#
-#  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.
-
-svgdir = $(top_srcdir)/icons/svg
-prerendereddir = $(top_srcdir)/icons/prerendered
-icondir = $(top_builddir)
-iconcommand = python $(top_srcdir)/admin/render_icon.py
-
-16x16 = $(icondir)/16x16
-22x22 = $(icondir)/22x22
-24x24 = $(icondir)/24x24
-32x32 = $(icondir)/32x32
-48x48 = $(icondir)/48x48
-
-16x16pre = $(prerendereddir)/16x16
-22x22pre = $(prerendereddir)/22x22
-24x24pre = $(prerendereddir)/24x24
-32x32pre = $(prerendereddir)/32x32
-48x48pre = $(prerendereddir)/48x48
-
-icons =																	\
-	$(16x16)/app-icon.png $(22x22)/app-icon.png $(24x24)/app-icon.png $(32x32)/app-icon.png $(48x48)/app-icon.png			\
-	$(16x16)/tool-arrow.png $(22x22)/tool-arrow.png $(24x24)/tool-arrow.png $(32x32)/tool-arrow.png $(48x48)/tool-arrow.png		\
-	$(16x16)/tool-i-beam.png $(22x22)/tool-i-beam.png $(24x24)/tool-i-beam.png $(32x32)/tool-i-beam.png $(48x48)/tool-i-beam.png	\
-	$(16x16)/track-disabled.png													\
-	$(16x16)/track-enabled.png													\
-	$(16x16)/track-locked.png													\
-	$(16x16)/track-unlocked.png													\
-	$(16x16)/panel-assets.png $(22x22)/panel-assets.png $(32x32)/panel-assets.png						\
-	$(16x16)/panel-timeline.png													\
-	$(16x16)/panel-viewer.png $(22x22)/panel-viewer.png $(32x32)/panel-viewer.png
-
-dist_pkgdata_DATA += $(icons)
-
-all: $(icons)
-
-clean-local:
-	rm -rf $(16x16) $(22x22) $(24x24) $(32x32) $(48x48)
-
-# ========== SVG Icons ==========
-
-# App Icon
-
-$(16x16)/app-icon.png $(22x22)/app-icon.png $(24x24)/app-icon.png $(32x32)/app-icon.png $(48x48)/app-icon.png : $(svgdir)/app-icon.svg $(top_builddir)/rsvg-convert
-	$(iconcommand) $< $(icondir)
-
-# Timeline Tools
-
-$(16x16)/tool-arrow.png $(22x22)/tool-arrow.png $(24x24)/tool-arrow.png $(32x32)/tool-arrow.png $(48x48)/tool-arrow.png : $(svgdir)/tool-arrow.svg $(top_builddir)/rsvg-convert
-	$(iconcommand) $< $(icondir)
-$(16x16)/tool-i-beam.png $(22x22)/tool-i-beam.png $(24x24)/tool-i-beam.png $(32x32)/tool-i-beam.png $(48x48)/tool-i-beam.png : $(svgdir)/tool-i-beam.svg $(top_builddir)/rsvg-convert
-	$(iconcommand) $< $(icondir)
-
-# Timeline Tracks
-$(16x16)/track-disabled.png : $(svgdir)/track-disabled.svg $(top_builddir)/rsvg-convert
-	$(iconcommand) $< $(icondir)
-$(16x16)/track-enabled.png : $(svgdir)/track-enabled.svg $(top_builddir)/rsvg-convert
-	$(iconcommand) $< $(icondir)
-$(16x16)/track-locked.png : $(svgdir)/track-locked.svg $(top_builddir)/rsvg-convert
-	$(iconcommand) $< $(icondir)
-$(16x16)/track-unlocked.png : $(svgdir)/track-unlocked.svg $(top_builddir)/rsvg-convert
-	$(iconcommand) $< $(icondir)
-
-# ========== Prerendered Icons ==========
-
-# Panels
-
-$(16x16)/panel-assets.png: $(16x16pre)/panel-assets.png
-	cp $(16x16pre)/panel-assets.png $(16x16)
-$(22x22)/panel-assets.png: $(22x22pre)/panel-assets.png
-	cp $(22x22pre)/panel-assets.png $(22x22)
-$(32x32)/panel-assets.png: $(32x32pre)/panel-assets.png
-	cp $(32x32pre)/panel-assets.png $(32x32)
-
-$(16x16)/panel-timeline.png: $(16x16pre)/panel-timeline.png
-	cp $(16x16pre)/panel-timeline.png $(16x16)
-
-$(16x16)/panel-viewer.png: $(16x16pre)/panel-viewer.png
-	cp $(16x16pre)/panel-viewer.png $(16x16)
-$(22x22)/panel-viewer.png: $(22x22pre)/panel-viewer.png
-	cp $(22x22pre)/panel-viewer.png $(22x22)
-$(32x32)/panel-viewer.png: $(32x32pre)/panel-viewer.png
-	cp $(32x32pre)/panel-viewer.png $(32x32)
diff --git a/src/SConscript b/src/SConscript
index 3127af3ec..de4d03a91 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -26,7 +26,7 @@ lumiera = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, install=True)
 
 # Install the lumiera application:
 # symlink the executable into the bin dir
-env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
+env.SymLink('#$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
 
 
 # building Lumiera Plugins

From feebd05cbacbf367596adba3bbfda6f5d524661a Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 10 Jan 2012 08:21:27 +0100
Subject: [PATCH 81/87] create separate SConscript for documentation

currently just featuring Doxygen
---
 SConstruct     | 14 ++++----------
 doc/SConscript | 17 +++++++++++++++++
 2 files changed, 21 insertions(+), 10 deletions(-)
 create mode 100644 doc/SConscript

diff --git a/SConstruct b/SConstruct
index a82c9060f..26ecf132f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -55,22 +55,14 @@ env = Setup.defineBuildEnvironment()
 env = Platform.configure(env)
 
 
-#####################################################################
-
-doxydoc = env.Doxygen('doc/devel/Doxyfile')
-env.Alias ('doc', doxydoc)
-env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
-#  env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
-
-
 
 ### === MAIN BUILD === ##############################################
 
 # call subdir SConscript(s) for to define the actual build targets
-SConscript(dirs=['data','src','src/tool','research','tests'], exports='env')
+SConscript(dirs=['data','src','src/tool','research','tests','doc'], exports='env')
 
 # artifacts defined by the build targets
-Import('lumiera plugins tools gui testsuite')
+Import('lumiera plugins tools gui testsuite doxydoc')
 
 
 
@@ -84,6 +76,8 @@ env.Clean ('build', [ 'src/pre.gch' ])
 
 build = env.Alias('build', lumiera + plugins + tools +gui)
 
+env.Alias ('doc', doxydoc)
+
 env.Alias ('all', build + testsuite + doxydoc)
 env.Default('build')
 # SCons default target
diff --git a/doc/SConscript b/doc/SConscript
new file mode 100644
index 000000000..60c0964ab
--- /dev/null
+++ b/doc/SConscript
@@ -0,0 +1,17 @@
+# -*- python -*-
+##
+## SConscript  -  SCons buildscript for Documentation
+##
+
+from Buildhelper import scanSubtree
+
+Import('env')
+
+
+doxydoc = env.Doxygen('devel/Doxyfile')
+
+#  env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=documentation)
+env.Clean (doxydoc, doxydoc + ['devel/,doxylog','devel/warnings.txt'])
+
+
+Export('doxydoc')

From 98717915b26af77df16a614dd4ea10dd37ffd47c Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Tue, 10 Jan 2012 08:37:01 +0100
Subject: [PATCH 82/87] clean up top level SConstruct

---
 SConstruct       | 44 ++++++++++++++++++++------------------------
 tests/SConscript |  2 +-
 2 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/SConstruct b/SConstruct
index 26ecf132f..d2468b374 100644
--- a/SConstruct
+++ b/SConstruct
@@ -23,46 +23,39 @@
 
 
 # NOTE: scons -h for help.
+# This script /defines/ the components and how they fit together.
+# SCons will derive dependencies and the necessary build steps.
 # Read more about the SCons build system at: http://www.scons.org
-# Basically, this script just /defines/ the components and how they
-# fit together. SCons will derive the necessary build steps.
 
 
-#-----------------------------------Configuration
-TOOLDIR      = './admin/scons'    # SCons plugins
-#-----------------------------------Configuration
-
-
-
-
-import os
+# SCons plugins and extension modules
+#------------------------------------------------
 import sys
-
-sys.path.append(TOOLDIR)
-
-from Buildhelper import *
-from LumieraEnvironment import *
+sys.path.append('./admin/scons')
+#------------------------------------------------
 
 
 import Setup
 import Options
 import Platform
 
+from Buildhelper import *
+from LumieraEnvironment import *
+
+
 
 #####################################################################
 
-env = Setup.defineBuildEnvironment()
-env = Platform.configure(env)
+env = Setup.defineBuildEnvironment()         # dirs & compiler flags
+env = Platform.configure(env)                # library dependencies
 
 
 
 ### === MAIN BUILD === ##############################################
 
-# call subdir SConscript(s) for to define the actual build targets
+# call subdir SConscript(s) to define the actual build targets...
 SConscript(dirs=['data','src','src/tool','research','tests','doc'], exports='env')
 
-# artifacts defined by the build targets
-Import('lumiera plugins tools gui testsuite doxydoc')
 
 
 
@@ -74,14 +67,17 @@ env.Clean ('build', [ 'src/pre.gch' ])
 
 ### === Alias Targets === ###########################################
 
+# pick up the targets defined by the sub SConscripts
+Import('lumiera plugins tools gui testsuite doxydoc')
+
 build = env.Alias('build', lumiera + plugins + tools +gui)
-
-env.Alias ('doc', doxydoc)
-
-env.Alias ('all', build + testsuite + doxydoc)
 env.Default('build')
 # SCons default target
 
+
+env.Alias ('all', build + testsuite + doxydoc)
+env.Alias ('doc', doxydoc)
+
 env.Alias('install', gui)
 env.Alias('install', '$DESTDIR')
 
diff --git a/tests/SConscript b/tests/SConscript
index 12672cd79..9c5d5c786 100644
--- a/tests/SConscript
+++ b/tests/SConscript
@@ -50,7 +50,7 @@ def testCollection(env,dir):
 
 
 
-# but have to treat some subdirs individually.
+# have to treat some subdirs individually.
 specials = ['plugin','lib','components']
 moduledirs = globRootdirs('*')
 

From 29394345af5d16bc87903a2a131ba96e2ea06b92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odin=20Omdal=20H=C3=B8rthe?= 
Date: Tue, 13 Sep 2011 02:42:23 +0200
Subject: [PATCH 83/87] ALSA audio output experiment

I think it's smart to rather use ALSA directly instead of PortAudio.
ALSA is push AFAIK, and talking about it here at the hackspace, seems
like the better choice. It's a bit lower level, but anyway everything
speaks ALSA anyway. It's not like there's any reason to use PortAudio
at all. It's just an extra abstraction.

Coding for ALSA it'll also work with Pulseaudio and esd. Do people
really use other sound systems than Pulseaudio, esd or plain ALSA?
I can't think of it.

I really the idea about building a small tool first. I'll do that.

Also thought about making a small blikning cursor/text output, and
syncing a BEEP-sound to that, so that I can test around with throwing
in lots and lots of latency between "me" and the video, and try to
sync it anyway.

I should be able to read back from the sound card (or pulse audio
underneath, it will just work with alsa as the abstraction) how long
it takes for the bytes I'm pushing to reach the speakers, and do some
buffer tuning on that.
---
 src/tool/alsa.c | 148 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/tool/main.c |  27 +++++++++
 2 files changed, 175 insertions(+)
 create mode 100644 src/tool/alsa.c
 create mode 100644 src/tool/main.c

diff --git a/src/tool/alsa.c b/src/tool/alsa.c
new file mode 100644
index 000000000..e6c4afbba
--- /dev/null
+++ b/src/tool/alsa.c
@@ -0,0 +1,148 @@
+#include 
+#include 
+#include 
+
+#include 
+
+static snd_pcm_t* playback_handle = 0;
+static snd_pcm_sw_params_t* sw_params = 0;
+static snd_pcm_hw_params_t* hw_params = 0;
+static snd_pcm_sframes_t buffer_size = 0;
+
+static snd_pcm_sframes_t written = 0;
+static snd_pcm_sframes_t delay = 0;
+
+static unsigned int rate = 44100;
+
+static int audio_initialized = 0;
+
+size_t
+audio_offset()
+{
+  snd_pcm_delay(playback_handle, &delay);
+
+  return written - delay;
+}
+
+void
+audio_init()
+{
+  unsigned int buffer_time = 50000;
+  const char* device;
+  int err;
+
+  if(audio_initialized)
+    return;
+
+  audio_initialized = 1;
+
+  device = getenv("ALSA_DEVICE");
+
+  if(!device)
+    device = "default";
+
+  if(0 > (err = snd_pcm_open(&playback_handle, device,
+                             SND_PCM_STREAM_PLAYBACK, 0/*SND_PCM_NONBLOCK*/)))
+    errx(EXIT_FAILURE, "Audio: Cannot open device %s: %s", device, snd_strerror(err));
+
+  if(0 > (err = snd_pcm_sw_params_malloc(&sw_params)))
+    errx(EXIT_FAILURE, "Audio: Could not allocate software parameter structure: %s",
+         snd_strerror(err));
+
+  if(0 > (err = snd_pcm_hw_params_malloc(&hw_params)))
+    errx(EXIT_FAILURE, "Audio: Could not allocate hardware parameter structure: %s",
+         snd_strerror(err));
+
+  if(0 > (err = snd_pcm_hw_params_any(playback_handle, hw_params)))
+    errx(EXIT_FAILURE, "Audio: Could not initializa hardware parameters: %s",
+         snd_strerror(err));
+
+  if(0 > (err = snd_pcm_hw_params_set_access(playback_handle, hw_params,
+                                             SND_PCM_ACCESS_RW_INTERLEAVED)))
+    errx(EXIT_FAILURE, "Audio: Could not set access type: %s", snd_strerror(err));
+
+  if(0 > (err = snd_pcm_hw_params_set_format(playback_handle, hw_params,
+                                             SND_PCM_FORMAT_S16)))
+    errx(EXIT_FAILURE, "Audio: Could not set sample format to signed 16 bit "
+         "native endian: %s", snd_strerror(err));
+
+  if(0 > (err = snd_pcm_hw_params_set_rate_near(playback_handle, hw_params,
+                                                &rate, 0)))
+    errx(EXIT_FAILURE, "Audio: Could not set sample rate %uHz: %s", rate,
+         snd_strerror(err));
+
+  if(0 > (err = snd_pcm_hw_params_set_channels(playback_handle, hw_params, 2)))
+    errx(EXIT_FAILURE, "Audio: Could not set channel count to %u: %s",
+         2, snd_strerror(err));
+
+  snd_pcm_hw_params_set_buffer_time_near(playback_handle, hw_params, &buffer_time, 0);
+
+  if(0 > (err = snd_pcm_hw_params(playback_handle, hw_params)))
+    errx(EXIT_FAILURE, "Audio: Could not set hardware parameters: %s", snd_strerror(err));
+
+  fprintf(stderr, "Buffer time is %.3f seconds\n", buffer_time / 1.0e6);
+
+  if(0 > (err = snd_pcm_sw_params_current(playback_handle, sw_params)))
+    errx(EXIT_FAILURE, "Audio: Could not initialize software parameters: %s",
+         snd_strerror(err));
+
+  snd_pcm_sw_params_set_start_threshold(playback_handle, sw_params, 0);
+  snd_pcm_sw_params_set_avail_min(playback_handle, sw_params, 1024);
+
+  snd_pcm_uframes_t min;
+  snd_pcm_sw_params_get_avail_min(sw_params, &min);
+  fprintf(stderr, "Minimum %u\n", (unsigned) min);
+
+  if(0 > (err = snd_pcm_sw_params(playback_handle, sw_params)))
+    errx(EXIT_FAILURE, "Audio: Could not set software parameters: %s",
+        snd_strerror(err));
+
+  buffer_size = snd_pcm_avail_update(playback_handle);
+}
+
+size_t
+audio_write(const void* data, size_t amount)
+{
+  int err;
+
+  amount /= 4;
+
+  for(;;)
+    {
+      err = snd_pcm_writei(playback_handle, data, amount);
+
+      if(err == -EAGAIN)
+        return 0;
+
+      if(err < 0)
+        {
+          err = snd_pcm_recover(playback_handle, err, 0);
+
+          if(err < 0)
+            errx(EXIT_FAILURE, "Audio playback failed: %s", strerror(-err));
+        }
+
+
+      break;
+    }
+
+  written += err;
+
+  err *= 4;
+
+  return err;
+}
+
+void
+audio_start(unsigned int rate, unsigned int channel_count)
+{
+  audio_init();
+
+  snd_pcm_prepare(playback_handle);
+}
+
+void
+audio_stop()
+{
+  snd_pcm_drain(playback_handle);
+}
diff --git a/src/tool/main.c b/src/tool/main.c
new file mode 100644
index 000000000..4e6b1adc6
--- /dev/null
+++ b/src/tool/main.c
@@ -0,0 +1,27 @@
+#include 
+#include 
+#include "alsa.c"
+
+#define SAMPLE_RATE 44100
+
+int16_t quiet[SAMPLE_RATE], noisy[SAMPLE_RATE];
+
+void main () {
+
+    for (int i=0; i
Date: Tue, 22 Nov 2011 03:26:43 +0100
Subject: [PATCH 84/87] integrate Odin's ALSA experiments into the Lumiera
 build

requires ALSA as build dependency
note: Debian package is libasound2-dev
---
 src/tool/SConscript |  7 ++++++
 src/tool/alsa.c     | 27 ++++++++++++++++++++---
 src/tool/alsa.h     | 54 +++++++++++++++++++++++++++++++++++++++++++++
 src/tool/main.c     | 28 ++++++++++++++++++++++-
 4 files changed, 112 insertions(+), 4 deletions(-)
 create mode 100644 src/tool/alsa.h

diff --git a/src/tool/SConscript b/src/tool/SConscript
index 85a858d5e..2d326feea 100644
--- a/src/tool/SConscript
+++ b/src/tool/SConscript
@@ -10,12 +10,19 @@ envSvg = env.Clone()
 envSvg.mergeConf(['librsvg-2.0'])
 envSvg.Append(LIBS=support_lib)
 
+envSnd = env.Clone()
+envSnd.mergeConf(['alsa'])
+
+
+outputProbe = envSnd.Program('lumiera-output-probe'
+                            , ['main.c', 'alsa.c'] + core, install=True)         ## Odin's ALSA experiments
 
 luidgen =    env.Program('luidgen', ['luidgen.c'] + support_lib, install=True)   ## for generating Lumiera-UIDs
 rsvg    = envSvg.Program('rsvg-convert','rsvg-convert.c')                        ## for rendering SVG icons (uses librsvg) 
 
 # build additional test and administrative tools....
 tools = [ env.Program('hello-world','hello.c', install=True)                   #### hello world (checks C build)      
+        + outputProbe                                                          #### for output connection tests
         + luidgen
         + rsvg
         ]
diff --git a/src/tool/alsa.c b/src/tool/alsa.c
index e6c4afbba..d210693dd 100644
--- a/src/tool/alsa.c
+++ b/src/tool/alsa.c
@@ -1,6 +1,27 @@
-#include 
-#include 
-#include 
+/*
+  ALSA  -  sound output backend using the Advanced Linux Sound Architecture
+
+  Copyright (C)         Lumiera.org
+    2011,               Odin Omdal Hørthe 
+
+  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 "alsa.h"
 
 #include 
 
diff --git a/src/tool/alsa.h b/src/tool/alsa.h
new file mode 100644
index 000000000..30fdb75f7
--- /dev/null
+++ b/src/tool/alsa.h
@@ -0,0 +1,54 @@
+/*
+  ALSA.h  -  sound output backend using the Advanced Linux Sound Architecture
+
+  Copyright (C)         Lumiera.org
+    2011,               Odin Omdal Hørthe 
+
+  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.
+
+*/
+
+/** @file alsa.h
+ ** Interfacing to ALSA sound output.
+ ** 
+ ** @todo for now this header defines some functions used for experimentation with ALSA 
+ **
+ ** @see output-slot.hpp
+ */
+
+
+#ifndef TOOL_ALSA_H
+#define TOOL_ALSA_H
+
+
+#include 
+
+
+
+size_t audio_offset();
+
+
+void audio_init();
+
+
+size_t audio_write(const void* data, size_t amount);
+
+
+void audio_start(unsigned int rate, unsigned int channel_count);
+
+
+void audio_stop();
+
+#endif // TOOL_ALSA_H
diff --git a/src/tool/main.c b/src/tool/main.c
index 4e6b1adc6..e8a684705 100644
--- a/src/tool/main.c
+++ b/src/tool/main.c
@@ -1,6 +1,32 @@
+/*
+  OutputProbe  -  tool to investigate external output connections
+
+  Copyright (C)         Lumiera.org
+    2011,               Odin Omdal Hørthe 
+
+  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 "alsa.h"
+
 #include 
 #include 
-#include "alsa.c"
+#include 
+
 
 #define SAMPLE_RATE 44100
 

From 3be546a6b8df4dd1d35e689238ec26b09914bcb0 Mon Sep 17 00:00:00 2001
From: Christian Thaeter 
Date: Wed, 11 Jan 2012 22:31:03 +0100
Subject: [PATCH 85/87] RFC: bless scons as offical build system

---
 .../MakeSconsTheOfficialBuildSystem.txt       | 83 +++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 doc/devel/rfc_pending/MakeSconsTheOfficialBuildSystem.txt

diff --git a/doc/devel/rfc_pending/MakeSconsTheOfficialBuildSystem.txt b/doc/devel/rfc_pending/MakeSconsTheOfficialBuildSystem.txt
new file mode 100644
index 000000000..53958c986
--- /dev/null
+++ b/doc/devel/rfc_pending/MakeSconsTheOfficialBuildSystem.txt
@@ -0,0 +1,83 @@
+Make Scons the official build System
+====================================
+
+// please don't remove the //word: comments
+
+[grid="all"]
+`------------`-----------------------
+*State*         _Final_
+*Date*          _Mi 11 Jan 2012 21:45:58 CET_
+*Proposed by*   Christian Thaeter 
+-------------------------------------
+
+********************************************************************************
+.Abstract
+_Bless Scons the default build system for Lumiera._
+********************************************************************************
+
+Description
+-----------
+//description: add a detailed description:
+
+So far we using autotools and scons in parallel. Over time the need arose to have one
+reliable supported build system. This shall be scons.
+
+
+Tasks
+~~~~~
+// List what needs to be done to implement this Proposal:
+// * first step ([green]#✔ done#)
+// * second step [,yellow]#WIP#
+Nothing to do except for releases scons *must* be working and all non functional
+build systems will be stripped from releases (branches?).
+
+
+Discussion
+~~~~~~~~~~
+
+Pros
+^^^^
+// add a fact list/enumeration which make this suitable:
+//  * foo
+//  * bar ...
+
+
+
+Cons
+^^^^
+// fact list of the known/considered bad implications:
+
+
+
+Alternatives
+^^^^^^^^^^^^
+//alternatives: explain alternatives and tell why they are not viable:
+
+
+
+Rationale
+---------
+//rationale: Give a concise summary why it should be done *this* way:
+
+
+
+Conclusion
+----------
+//conclusion: When approbate (this proposal becomes a Final)
+//            write some conclusions about its process:
+
+
+
+Comments
+--------
+//comments: append below
+
+.State -> Final
+//add reason
+Decided on the December 2011 Developer meeting.
+    Mi 11 Jan 2012 22:28:36 CET Christian Thaeter 
+
+//endof_comments:
+
+''''
+Back to link:/documentation/devel/rfc.html[Lumiera Design Process overview]

From 0b2537bb897a6cd5a1f9c7e5760121af962292b9 Mon Sep 17 00:00:00 2001
From: Christian Thaeter 
Date: Wed, 11 Jan 2012 22:32:13 +0100
Subject: [PATCH 86/87] RFC: bless scons as offical build system, final

---
 .../{rfc_pending => rfc}/MakeSconsTheOfficialBuildSystem.txt      | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename doc/devel/{rfc_pending => rfc}/MakeSconsTheOfficialBuildSystem.txt (100%)

diff --git a/doc/devel/rfc_pending/MakeSconsTheOfficialBuildSystem.txt b/doc/devel/rfc/MakeSconsTheOfficialBuildSystem.txt
similarity index 100%
rename from doc/devel/rfc_pending/MakeSconsTheOfficialBuildSystem.txt
rename to doc/devel/rfc/MakeSconsTheOfficialBuildSystem.txt

From 55ff4e349cdfc9b0972fa3753ed6f9f7592df88a Mon Sep 17 00:00:00 2001
From: Christian Thaeter 
Date: Thu, 12 Jan 2012 15:49:40 +0100
Subject: [PATCH 87/87] Meeting summary, January 2012

---
 doc/devel/meeting_summary/2012-01-11.txt | 35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 doc/devel/meeting_summary/2012-01-11.txt

diff --git a/doc/devel/meeting_summary/2012-01-11.txt b/doc/devel/meeting_summary/2012-01-11.txt
new file mode 100644
index 000000000..cce9fbd6a
--- /dev/null
+++ b/doc/devel/meeting_summary/2012-01-11.txt
@@ -0,0 +1,35 @@
+2012-01-11 Lumiera Developers Meeting
+=====================================
+:Author: cehteh
+:Date: 2012-01-11
+
+Jan 11, 2011 on #lumiera 20:00
+
+__Participants__
+
+ * cehteh
+ * ichthyo
+ * benn
+ * raffa
+
+Conclusions
+-----------
+
+. ichthyo removed most of the tiddly wikis, and worked the content into the website
+. cehteh reports that Lumiera got another donation (75Eur), arrangements with
+  the ffis to get access (view) about the donations account are under way. We'll
+  ask donors then if they want to be published or stay anonym and will set up
+  a wiki page listing donations and expenses.
+. ichthy rewrote the SCons build, as discussed last time
+. cehteh writes a very short RfC, to document that we're using SCons for now.
+. possibly no one going to LAC, too far away
+. we discussed a link checker / link resolver for the website.
+  The idea is to have a semi automatic tool, which is used locally when
+  authoring website content to find cross references.
+. benn and ichthyo follow up on the libregraphics magazine and try to get into
+  discussion with them and see what can be done within our limited time.
+  ichthyo respond to the mail, and put you (benn and ct) on CC.
+. when it comes to have a working example for media file output, we stick to the
+  mainstream solutions ffmpeg and or gstreamer, but care not to lock ourselves
+  into a single solution. Concluded that we do this over plugin interfaces and
+  it mostly boils down to support ffmped .. and investigate something simpler too.