Skip to content

Commit 07d06f4

Browse files
committed
Make Asset private implementation unique
1 parent 18dc029 commit 07d06f4

File tree

9 files changed

+9
-6
lines changed

9 files changed

+9
-6
lines changed

include/scratchcpp/asset.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class LIBSCRATCHCPP_EXPORT Asset : public Entity
2727
const std::string &dataFormat() const;
2828

2929
private:
30-
spimpl::impl_ptr<AssetPrivate> impl;
30+
spimpl::unique_impl_ptr<AssetPrivate> impl;
3131
};
3232

3333
} // namespace libscratchcpp

include/scratchcpp/costume.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LIBSCRATCHCPP_EXPORT Costume : public Asset
2828
void setRotationCenterY(int newRotationCenterY);
2929

3030
private:
31-
spimpl::impl_ptr<CostumePrivate> impl;
31+
spimpl::unique_impl_ptr<CostumePrivate> impl;
3232
};
3333

3434
} // namespace libscratchcpp

include/scratchcpp/sound.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class LIBSCRATCHCPP_EXPORT Sound : public Asset
2525
void setSampleCount(int newSampleCount);
2626

2727
private:
28-
spimpl::impl_ptr<SoundPrivate> impl;
28+
spimpl::unique_impl_ptr<SoundPrivate> impl;
2929
};
3030

3131
} // namespace libscratchcpp

src/scratch/asset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using namespace libscratchcpp;
99
/*! Constructs Asset. */
1010
Asset::Asset(const std::string &name, const std::string &id, const std::string &format) :
1111
Entity(id),
12-
impl(spimpl::make_impl<AssetPrivate>(name, format))
12+
impl(spimpl::make_unique_impl<AssetPrivate>(name, format))
1313
{
1414
impl->updateFileName(id);
1515
}

src/scratch/asset_p.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace libscratchcpp
1010
struct AssetPrivate
1111
{
1212
AssetPrivate(const std::string &name, const std::string &format);
13+
AssetPrivate(const AssetPrivate &) = delete;
1314

1415
void updateFileName(const std::string &id);
1516

src/scratch/costume.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using namespace libscratchcpp;
99
/*! Constructs Costume. */
1010
Costume::Costume(const std::string &name, const std::string &id, const std::string &format) :
1111
Asset(name, id, format),
12-
impl(spimpl::make_impl<CostumePrivate>())
12+
impl(spimpl::make_unique_impl<CostumePrivate>())
1313
{
1414
}
1515

src/scratch/costume_p.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace libscratchcpp
88
struct CostumePrivate
99
{
1010
CostumePrivate();
11+
CostumePrivate(const CostumePrivate &) = delete;
1112

1213
double bitmapResolution = 1;
1314
int rotationCenterX = 0;

src/scratch/sound.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using namespace libscratchcpp;
99
/*! Constructs Sound. */
1010
Sound::Sound(const std::string &name, const std::string &id, const std::string &format) :
1111
Asset(name, id, format),
12-
impl(spimpl::make_impl<SoundPrivate>())
12+
impl(spimpl::make_unique_impl<SoundPrivate>())
1313
{
1414
}
1515

src/scratch/sound_p.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace libscratchcpp
1010
struct SoundPrivate
1111
{
1212
SoundPrivate();
13+
SoundPrivate(const SoundPrivate &) = delete;
1314

1415
int rate = 0;
1516
int sampleCount = 0;

0 commit comments

Comments
 (0)