From 19dd606f5454d7402b3c9b0ddf6c8be64ed20e21 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 27 Jul 2009 02:38:53 +0200 Subject: [PATCH] WIP some implementation drafting... --- doc/devel/draw/CommandImpl-1.svg | 1587 +++++++++++++++++++++++++++++ src/proc/control/command-impl.cpp | 56 + src/proc/control/command-impl.hpp | 99 ++ src/proc/control/command.cpp | 2 +- src/proc/control/command.hpp | 2 + 5 files changed, 1745 insertions(+), 1 deletion(-) create mode 100644 doc/devel/draw/CommandImpl-1.svg create mode 100644 src/proc/control/command-impl.cpp create mode 100644 src/proc/control/command-impl.hpp diff --git a/doc/devel/draw/CommandImpl-1.svg b/doc/devel/draw/CommandImpl-1.svg new file mode 100644 index 000000000..1ebb5963c --- /dev/null +++ b/doc/devel/draw/CommandImpl-1.svg @@ -0,0 +1,1587 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + AllocationCluster + + + Ichthyostega + + + design sketch: Structure of the AllocationCluster mem manager + 2008 + + + + + + + + + + + + + + + + TickService + doFrame() + CommandDef + + start( slot ) + Player (interface) + play() + yields + GUI (Plugin) + Proc (or Backend?) + Proxy<Player> + + actuallytalks to... + libCommon + + PlayContext + PlayerService + + PlayContext + + start(...) + start(...) + + Command + + + Handle<CommandImpl> + + yields + + + + has_a + + + Display (iface) + Proxy<Display> + + + + CommandImpl + CommandRegistry + + + CommandImpl + CommandImpl + open(...) + + + + CL Interface + + close() + getHandle(slot) + getHandle(slot) + getHandle(slot) + + yields + + has_a + + invokes (periodically triggered) + + periodically + + + + CL Interface + + pause() + stop() + use_display (slot) + + ProcessImpl + + dispatch toGTK main thread... + exec(..) + play(..) + not yet implemented... + + undo(..) + bind(..) + + Index + + + basic def + + + + undo def + + + + Command + + + + Command + + + + Command + + + + + ArgumentHolder + + + + ArgumentHolder + + + + ArgumentHolder + + getHandle(slot) + + + + + + + + + + + CommandImpl + + Command Impl + + + + + + + + + + + diff --git a/src/proc/control/command-impl.cpp b/src/proc/control/command-impl.cpp new file mode 100644 index 000000000..39cb0b290 --- /dev/null +++ b/src/proc/control/command-impl.cpp @@ -0,0 +1,56 @@ +/* + CommandImpl - Proc-Layer command implementation (top level) + + Copyright (C) Lumiera.org + 2009, 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 command-impl.cpp + ** //TODO + ** + ** @see command.hpp + ** @see command-registry.hpp + ** + */ + + +#include "proc/control/command-impl.hpp" +//#include "proc/mobject/mobject-ref.hpp" +//#include "proc/mobject/mobject.hpp" +//#include "proc/mobject/placement.hpp" + +//#include +//using boost::str; + +namespace control { + + + + /** */ + CommandImpl::~CommandImpl() { } + + + /** */ + + + + + + +} // namespace control diff --git a/src/proc/control/command-impl.hpp b/src/proc/control/command-impl.hpp new file mode 100644 index 000000000..97c3add88 --- /dev/null +++ b/src/proc/control/command-impl.hpp @@ -0,0 +1,99 @@ +/* + COMMAND-IMPL.hpp - Proc-Layer command implementation (top level) + + Copyright (C) Lumiera.org + 2009, 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 command-impl.hpp + ** Top level of the command implementation. CommandImpl holds together + ** the various data and sub-objects involved into the inner workings of a + ** Proc-Layer command. It serves to implement a "command definition" (prototype) + ** as well as a concrete command instance. It is a data holder with a well defined + ** identity and usually located within the (pooled) storage managed by the + ** CommandRegistry. Client code gets access to a specific CommandImpl through + ** a Command instance, which is a small (refcounting smart-ptr) handle. + ** + ** //TODO + ** + ** @see Command + ** @see ProcDispatcher + ** + */ + + + +#ifndef CONTROL_COMMAND_IMPL_H +#define CONTROL_COMMAND_IMPL_H + +#include "proc/control/command.hpp" + +//#include + + + +namespace control { + + + + + /** + * @todo Type-comment + */ + class CommandImpl + { + + public: + /* === command registry === */ + + + ~CommandImpl(); + + + /** core operation: invoke the command + * @param execPattern describes the individual steps + * necessary to get this command invoked properly + */ + void exec (HandlingPattern const& execPattern); + + + template + void bindArg (Tuple const&); + + + /* === diagnostics === */ + + bool isValid() const; + bool canExec() const; + bool canUndo() const; + + protected: +// static Command& fetchDef (Symbol cmdID); + +// friend class CommandDef; + + }; + ////////////////TODO currently just fleshing out the API.... + + + + + +} // namespace control +#endif diff --git a/src/proc/control/command.cpp b/src/proc/control/command.cpp index 25ee53c3f..bc9f1fba6 100644 --- a/src/proc/control/command.cpp +++ b/src/proc/control/command.cpp @@ -2,7 +2,7 @@ Command - Key abstraction for proc/edit operations and UNDO management Copyright (C) Lumiera.org - 2008, Hermann Vosseler + 2009, 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 diff --git a/src/proc/control/command.hpp b/src/proc/control/command.hpp index ec0867fb8..e07653b93 100644 --- a/src/proc/control/command.hpp +++ b/src/proc/control/command.hpp @@ -40,6 +40,7 @@ #include "proc/control/command-mutation.hpp" #include "proc/control/command-closure.hpp" #include "lib/bool-checkable.hpp" +#include "lib/handle.hpp" //#include @@ -68,6 +69,7 @@ namespace control { class Command : public com::ArgumentBinder > + ////////////////////////////////////////////////////////////////TODO: inherit from lib/handle { public: