Audacity 3.2.0
Public Member Functions | List of all members
ClientData::Copyable< Container, DeepCopying > Struct Template Reference

Specialization that clones sub-objects when copying; strong guarantee for assignment. More...

#include <ClientDataHelpers.h>

Inheritance diagram for ClientData::Copyable< Container, DeepCopying >:
[legend]
Collaboration diagram for ClientData::Copyable< Container, DeepCopying >:
[legend]

Public Member Functions

 Copyable ()=default
 
 Copyable (const Copyable &other)
 Call through to operator =. More...
 
Copyableoperator= (const Copyable &other)
 
 Copyable (Copyable &&)=default
 
Copyableoperator= (Copyable &&)=default
 

Detailed Description

template<typename Container>
struct ClientData::Copyable< Container, DeepCopying >

Specialization that clones sub-objects when copying; strong guarantee for assignment.

Definition at line 128 of file ClientDataHelpers.h.

Constructor & Destructor Documentation

◆ Copyable() [1/3]

template<typename Container >
ClientData::Copyable< Container, DeepCopying >::Copyable ( )
default

◆ Copyable() [2/3]

template<typename Container >
ClientData::Copyable< Container, DeepCopying >::Copyable ( const Copyable< Container, DeepCopying > &  other)
inline

Call through to operator =.

Definition at line 132 of file ClientDataHelpers.h.

133 { *this = other; }

◆ Copyable() [3/3]

template<typename Container >
ClientData::Copyable< Container, DeepCopying >::Copyable ( Copyable< Container, DeepCopying > &&  )
default

Member Function Documentation

◆ operator=() [1/2]

template<typename Container >
Copyable & ClientData::Copyable< Container, DeepCopying >::operator= ( const Copyable< Container, DeepCopying > &  other)
inline
Exception safety guarantee:
Strong

Definition at line 135 of file ClientDataHelpers.h.

136 {
137 if (this != &other) {
138 // Build then swap for strong exception guarantee
139 Copyable temp;
140 for ( auto &&p : other ) {
141 using Ptr = decltype( p->Clone() );
142 temp.push_back( p ? p->Clone() : Ptr{} );
143 }
144 this->swap( temp );
145 }
146 return *this;
147 }
void swap(std::unique_ptr< Alg_seq > &a, std::unique_ptr< Alg_seq > &b)
Definition: NoteTrack.cpp:628

References anonymous_namespace{NoteTrack.cpp}::swap().

Here is the call graph for this function:

◆ operator=() [2/2]

template<typename Container >
Copyable & ClientData::Copyable< Container, DeepCopying >::operator= ( Copyable< Container, DeepCopying > &&  )
default

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