#include "cloneable.hpp"

Public Types | |
| using | base_type = T |
Public Member Functions | |
| virtual | ~Cloneable ()=default |
Protected Member Functions | |
| virtual T * | clone () const =0 |
Friends | |
| template<typename X > | |
| std::unique_ptr< X > | clone (const X &) |
Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 Functions and interface for creation cloneable classes with smart pointers.
Usage: struct Base : object::cloneable<Base> { // ... other methods };
struct Derived : Base { // ... other methods protected: Derived* clone() const override { return new Derived(*this); } };
Derived derived; auto c1 = clone(derived);
Interface for cloneable classes.
| T |
|
protectedpure virtual |
Polymorphic clone constructor. Method guarantees deep-copy.
Implemented in shared_model::crypto::Blob, shared_model::proto::Transaction, shared_model::proto::Block, and shared_model::plain::Signature.
|
friend |