Facade Class Reference
The Facade Module

This is the super class of all facades. More...

`#include <Facade.h>`

Inheritance diagram for Facade:

## Protected Member Functions

| Facade (bool printActions)
| Constructs a facade that prints out what it is doing if printActions is true.
virtual | ~Facade ()
void | printMessage (const char *message)
| Prints message to standard error if printing is turned on.
void | beginAction (const char *message)
| Prints message to standard error if printing is turned on, and records the time when the action started.
void | endAction ()
| Prints to standard error the time since the last call to beginAction.
bool | isPrintingActions () const
| Returns true if printing actions.

## Private Attributes

Timer | _timer
| Keeps track of the time between calls to beginAction() and endAction().
bool | _printActions
| Keeps track of whether we are printing.

## Detailed Description

This is the super class of all facades.

It offers protected methods that are convenient for derived classes to print out what they are doing and how long it took, and to be able to turn this on and off with a boolean flag.

Todo
  Replace this with ActionPrinter using aggregation instead of inheritance.

Definition at line 32 of file Facade.h.

## Constructor & Destructor Documentation

## Facade()

Facade::Facade | ( | bool | printActions | ) |

protected

Constructs a facade that prints out what it is doing if printActions is true.

Definition at line 20 of file Facade.cpp.

## ~Facade()

Facade::~Facade | ( |  | ) |

protected virtual

Definition at line 28 of file Facade.cpp.

## Member Function Documentation

## beginAction()

void Facade::beginAction | ( | const char * | message | ) |

protected

Prints message to standard error if printing is turned on, and records the time when the action started.

endAction() must be called in-between two calls to beginAction.

Definition at line 38 of file Facade.cpp.

## endAction()

void Facade::endAction | ( |  | ) |

protected

Prints to standard error the time since the last call to beginAction.

endAction() can only be called once after each call to beginAction.

Definition at line 51 of file Facade.cpp.

## isPrintingActions()

bool Facade::isPrintingActions | ( |  | ) | const

protected

Returns true if printing actions.

Definition at line 66 of file Facade.cpp.

## printMessage()

void Facade::printMessage | ( | const char * | message | ) |

protected

Prints message to standard error if printing is turned on.

Definition at line 31 of file Facade.cpp.

## Member Data Documentation

## _printActions

bool Facade::_printActions

private

Keeps track of whether we are printing.

Definition at line 64 of file Facade.h.

## _timer

Timer Facade::_timer

private

Keeps track of the time between calls to beginAction() and endAction().

Definition at line 61 of file Facade.h.

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

- src/Facade.h
- src/Facade.cpp