corelinux::State Class Referenceabstract

Allow an object to alter its behavior when its internal state changes. More...

`#include <State.hpp>`

## Public Member Functions

| State (void)
| Default Constructor.
virtual | ~State (void)
| Virtual Destructor.
bool | operator== (StateCref) const
| Equality operator overload. More...
virtual void | handle (void)=0
| Called by context.

## Protected Member Functions

| State (StateCref) throw ( Assertion )
| Copy Constructor. More...
StateRef | operator= (StateCref) throw ( Assertion )
| Assignment operator overload. More...
void | setCurrentState (ContextPtr, StatePtr) throw ( NullPointerException )
| Sets context state change.

## Detailed Description

Allow an object to alter its behavior when its internal state changes.

The object will appear to change its class. State is best served as a flyweight and singleton.

## Constructor & Destructor Documentation

corelinux::State::State | ( | StateCref |  | ) |
throw | ( | Assertion
| ) |  |

protected

Copy Constructor.

Parameters

  State | const reference

Exceptions

  Assertion | to help enforce singleton

## Member Function Documentation

StateRef corelinux::State::operator= | ( | StateCref |  | ) |
throw | ( | Assertion
| ) |  |

protected

Assignment operator overload.

Parameters

  State | const reference

Returns
  State reference to self

Exceptions

  Assertion | to help enforce singleton

bool corelinux::State::operator== | ( | StateCref | aState | ) | const

Equality operator overload.

Parameters

  State | const reference

Returns
  true if equal, false otherwise

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

- State.hpp
- State.cpp

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium