implement mising diagnostics

This commit is contained in:
Fischlurch 2009-08-11 06:32:29 +02:00
parent 8925c9a73b
commit 0d4d3f25dc
3 changed files with 30 additions and 10 deletions

View file

@ -163,31 +163,30 @@ namespace control {
/* === diagnostics === */
bool
isValid() const
isValid() const ///< validity self-check: is basically usable.
{
UNIMPLEMENTED ("command validity self check");
return bool(pClo_)
&& HandlingPattern::get(defaultPatt_).isValid();
}
bool
canExec() const
canExec() const ///< state check: sufficiently defined to be invoked
{
UNIMPLEMENTED ("state check: sufficiently defined to be invoked");
return isValid()
&& *pClo_ && do_;
}
bool
canUndo() const
canUndo() const ///< state check: has undo state been captured?
{
UNIMPLEMENTED ("state check: has undo state been captured?");
return isValid() && undo_;
}
protected:
// static Command& fetchDef (Symbol cmdID);
// friend class CommandDef;
};
////////////////TODO currently just fleshing out the API....

View file

@ -77,6 +77,7 @@ namespace control {
* @todo Type-comment
*/
class HandlingPattern
: public lib::BoolCheckable<HandlingPattern>
{
public:
@ -106,6 +107,7 @@ namespace control {
HandlingPattern const& howtoUNDO() const;
virtual bool isValid() const =0;
protected:
@ -114,6 +116,7 @@ namespace control {
virtual HandlingPattern const& defineUNDO() const =0;
};
////////////////TODO currently just fleshing out the API....

View file

@ -85,6 +85,12 @@ namespace control {
{
UNIMPLEMENTED ("yield a handling pattern suitable for UNDOing a command, according to this pattern");
}
bool
isValid() const
{
UNIMPLEMENTED ("is this pattern currently able to handle commands?");
}
};
@ -107,6 +113,12 @@ namespace control {
{
UNIMPLEMENTED ("yield a handling pattern suitable for UNDOing a command, according to this pattern");
}
bool
isValid() const
{
UNIMPLEMENTED ("is this pattern currently able to handle commands?");
}
};
@ -129,6 +141,12 @@ namespace control {
{
UNIMPLEMENTED ("yield a handling pattern suitable for UNDOing a command, according to this pattern");
}
bool
isValid() const
{
UNIMPLEMENTED ("is this pattern currently able to handle commands?");
}
};