diagnostics about captured state (on the CmdClosure API)

This commit is contained in:
Fischlurch 2009-09-21 03:33:56 +02:00
parent 246c535569
commit 09b9f64842
4 changed files with 14 additions and 19 deletions

View file

@ -140,6 +140,12 @@ namespace control {
return arguments_->isValid();
}
virtual bool isCaptured() const
{
return memento_->isValid();
}
/** assign a new parameter tuple to this */
virtual void bindArguments (Arguments& args)

View file

@ -127,14 +127,11 @@ namespace control {
virtual ~CmdClosure() {}
virtual operator string() const =0;
virtual bool isValid () const =0;
virtual void bindArguments (Arguments&) =0;
virtual void invoke (CmdFunctor const&) =0;
virtual PClo createClone (TypedAllocationManager&) =0;
virtual bool isValid () const =0; ///< does this closure hold a valid argument tuple?
virtual bool isCaptured () const =0; ///< does this closure hold captured UNDO state?
virtual void bindArguments (Arguments&) =0; ///< store a set of parameter values within this closure
virtual void invoke (CmdFunctor const&) =0; ///< invoke functor using the stored parameter values
virtual PClo createClone (TypedAllocationManager&) =0; ///< create clone allocation without disclosing concrete type
};
@ -271,7 +268,8 @@ namespace control {
}
bool isValid () const { return true; }
bool isValid () const { return true; }
bool isCaptured() const { return false; }
/// Supporting equality comparisons...

View file

@ -50,13 +50,6 @@ namespace control {
/////////////////////////////////////////TODO: is this impl file actually necessary??
bool
CommandImpl::hasUndoState (CmdClosure const& closure)
{
UNIMPLEMENTED ("how the hell do we get at the memento-captured state???");
// REQUIRE (INSTANCEOF (ArgumentHolder, &closure));
// return static_cast<ArgumentHolder const&> (closure).canUndo();
}

View file

@ -183,7 +183,7 @@ namespace control {
bool
canUndo() const ///< state check: has undo state been captured?
{
return isValid() && hasUndoState(*pClo_);
return isValid() && pClo_->isCaptured();
}
@ -191,8 +191,6 @@ namespace control {
private:
static bool hasUndoState (CmdClosure const&);
};