strategy_pattern::Context

class Context

Context maintains a reference to a Strategy object and delegates behavior to it.

Public Functions

inline void setStrategy(std::unique_ptr<Strategy> strategy)

Sets the strategy for the context.

Parameters:

strategy – A unique pointer to the strategy to use.

inline void executeStrategy() const

Executes the strategy.