C++ features by examples
Prototype Struct Reference

is the factory of himself More...

Inheritance diagram for Prototype:
Collaboration diagram for Prototype:

Public Member Functions

int method () override
 
unique_ptr< Interfacecreate () override
 
virtual unique_ptr< Interfacecreate ()=0
 
- Public Member Functions inherited from Interface
virtual int method ()=0
 
virtual ~Interface ()=default
 

Detailed Description

is the factory of himself

Definition at line 244 of file patterns.cpp.

Member Function Documentation

◆ create()

unique_ptr< Interface > Prototype::create ( )
inlineoverridevirtual

Implements Abstract_factory.

Definition at line 250 of file patterns.cpp.

250 {
251 auto clone = new Prototype(*this);
252 return unique_ptr<Interface>(clone);
253 }
is the factory of himself
Definition: patterns.cpp:247
Here is the caller graph for this function:

◆ method()

int Prototype::method ( )
inlineoverridevirtual

Implements Interface.

Definition at line 249 of file patterns.cpp.

249{ return 1; }

The documentation for this struct was generated from the following file: