class_adapter_pattern
-
namespace class_adapter_pattern
Namespace for the Class Adapter pattern.
-
class Adaptee
- #include <class_adapter.hpp>
The Adaptee class provides specific functionality.
The Adaptee has methods that perform useful operations but with an interface that is incompatible with the Target interface.
Subclassed by class_adapter_pattern::Adapter
-
class Adapter : public class_adapter_pattern::Target, private class_adapter_pattern::Adaptee
- #include <class_adapter.hpp>
The Adapter class bridges the Target and Adaptee interfaces.
The Adapter allows the Adaptee’s functionality to be used where the Target’s interface is required by translating requests from the Target format to the Adaptee’s specific format.
-
class Target
- #include <class_adapter.hpp>
Interface representing the Target.
The Target defines the domain-specific interface expected by the client. Classes implementing this interface can be used seamlessly by the client.
Subclassed by class_adapter_pattern::Adapter
Public Functions
-
virtual std::string request() const = 0
Handles a generic request from the client.
This method provides the interface that the client interacts with.
- Returns:
A string response from the Target.
-
virtual std::string request() const = 0
-
class Adaptee