object_adapter_pattern::Adapter

class Adapter : public object_adapter_pattern::Target

The Adapter class adapts the Adaptee to the Target interface.

The Adapter uses composition to hold an instance of Adaptee and translates calls from the Target interface into calls to the Adaptee’s methods. This enables the client to interact with Adaptee functionality seamlessly.

Public Functions

inline explicit Adapter(Adaptee *adaptee)

Constructs an Adapter with a given Adaptee instance.

The Adapter holds a reference to the Adaptee, enabling it to translate client calls into the Adaptee’s specific methods.

Parameters:

adaptee – Pointer to the Adaptee instance to be adapted.

inline virtual void request() const override

Implements the Target interface by delegating to the Adaptee.

This method adapts the Target’s request() call into a call to the Adaptee’s specificRequest() method.