Design Pattern Examples
Overview of object-oriented design patterns
StateContext_Class Class Reference

Wraps a private implementation of the state machine. The implementation maintains the context in which the state machine runs. More...

#include <State_Class.h>

Collaboration diagram for StateContext_Class:
Collaboration graph

Public Member Functions

 StateContext_Class ()
 Default constructor.
 
std::string RemoveComments (std::string text)
 Entry point for callers to filter text. Removes C++-style line and block comments from the text.
 

Private Attributes

std::unique_ptr< IStateContext_stateContextimpl
 Pointer to the actual implementation.
 

Detailed Description

Wraps a private implementation of the state machine. The implementation maintains the context in which the state machine runs.

To use:

StateContext_Class filterContext;
std::string filteredText = filterContext.RemoveComments(textToFilter);
static const char * textToFilter
Wraps a private implementation of the state machine. The implementation maintains the context in whic...
Definition: State_Class.h:139
std::string RemoveComments(std::string text)
Entry point for callers to filter text. Removes C++-style line and block comments from the text.

Definition at line 138 of file State_Class.h.

Constructor & Destructor Documentation

◆ StateContext_Class()

Default constructor.

Definition at line 850 of file State_Class.cpp.

Member Function Documentation

◆ RemoveComments()

std::string RemoveComments ( std::string  text)

Entry point for callers to filter text. Removes C++-style line and block comments from the text.

Parameters
textThe text to filter.
Returns
Returns the filtered text.

Definition at line 856 of file State_Class.cpp.

References StateContext_Class::_stateContextimpl.

Referenced by DesignPatternExamples_cpp::State_Exercise().

Member Data Documentation

◆ _stateContextimpl

std::unique_ptr<IStateContext> _stateContextimpl
private

Pointer to the actual implementation.

Definition at line 144 of file State_Class.h.

Referenced by StateContext_Class::RemoveComments().


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