Backproject
Public Member Functions | List of all members
PurposelyBrokenOperation Class Reference

This operation's perform method is 66% likely to throw an exception. More...

#include <PurposelyBrokenOperation.h>

Inheritance diagram for PurposelyBrokenOperation:
ContextOperation

Public Member Functions

bool IsPossible (const Context &context) const
 Indicates whether the operation can be performed given the current state of affairs. More...
 
std::string getDescription () const
 Gives a short (infinitive verb) indication of what the operation does. More...
 
std::string Perform (Context &context) const
 33% of time, this method works every time. More...
 

Detailed Description

This operation's perform method is 66% likely to throw an exception.

Member Function Documentation

§ getDescription()

std::string PurposelyBrokenOperation::getDescription ( ) const
virtual

Gives a short (infinitive verb) indication of what the operation does.

Returns
e.g. "use the context to do something"

Implements ContextOperation.

§ IsPossible()

bool PurposelyBrokenOperation::IsPossible ( const Context context) const
virtual

Indicates whether the operation can be performed given the current state of affairs.

Parameters
contextthe context for which the operation may be runnable
Returns
true when the operation may be performed

Implements ContextOperation.

§ Perform()

std::string PurposelyBrokenOperation::Perform ( Context context) const
virtual

33% of time, this method works every time.

In 66% of times, it throws an exception.

Parameters
context
Returns
a string expressing mild surprise at how the the method succeeded.

Implements ContextOperation.


The documentation for this class was generated from the following files: