WIP some implementation drafting...
This commit is contained in:
parent
3ebb8d0285
commit
19dd606f54
5 changed files with 1745 additions and 1 deletions
1587
doc/devel/draw/CommandImpl-1.svg
Normal file
1587
doc/devel/draw/CommandImpl-1.svg
Normal file
File diff suppressed because it is too large
Load diff
|
After Width: | Height: | Size: 104 KiB |
56
src/proc/control/command-impl.cpp
Normal file
56
src/proc/control/command-impl.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
CommandImpl - Proc-Layer command implementation (top level)
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2009, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
/** @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 <boost/format.hpp>
|
||||
//using boost::str;
|
||||
|
||||
namespace control {
|
||||
|
||||
|
||||
|
||||
/** */
|
||||
CommandImpl::~CommandImpl() { }
|
||||
|
||||
|
||||
/** */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace control
|
||||
99
src/proc/control/command-impl.hpp
Normal file
99
src/proc/control/command-impl.hpp
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
COMMAND-IMPL.hpp - Proc-Layer command implementation (top level)
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2009, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/** @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 <tr1/memory>
|
||||
|
||||
|
||||
|
||||
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<typename TYPES>
|
||||
void bindArg (Tuple<TYPES> 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
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
Command - Key abstraction for proc/edit operations and UNDO management
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
2009, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
|
|
|
|||
|
|
@ -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 <tr1/memory>
|
||||
|
||||
|
|
@ -68,6 +69,7 @@ namespace control {
|
|||
class Command
|
||||
: public com::ArgumentBinder<Command
|
||||
, lib::BoolCheckable<Command> >
|
||||
////////////////////////////////////////////////////////////////TODO: inherit from lib/handle
|
||||
{
|
||||
|
||||
public:
|
||||
|
|
|
|||
Loading…
Reference in a new issue