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 127 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 131 of file ClientDataHelpers.h.

132 { *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 134 of file ClientDataHelpers.h.

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

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: