CoreLinux++  0.4.32
Public Member Functions | Protected Member Functions | List of all members
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
Stateconst reference
Exceptions
Assertionto help enforce singleton

Member Function Documentation

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

Assignment operator overload.

Parameters
Stateconst reference
Returns
State reference to self
Exceptions
Assertionto help enforce singleton
bool corelinux::State::operator== ( StateCref  aState) const

Equality operator overload.

Parameters
Stateconst reference
Returns
true if equal, false otherwise

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

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