From: subhransu mohanty Date: Wed, 19 Sep 2018 02:29:26 +0000 (+0900) Subject: lottie: make animation class constructor private. X-Git-Tag: submit/tizen/20181129.071502~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F81%2F189581%2F1;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie: make animation class constructor private. we can't use make_unique to create the animation object anymore because the constructor is private. so used unique_ptr constructor instead. Change-Id: I23b68c68d1b960085800365662ebb1cc676731cc --- diff --git a/inc/lottieanimation.h b/inc/lottieanimation.h index c2a4e26..08edd48 100644 --- a/inc/lottieanimation.h +++ b/inc/lottieanimation.h @@ -28,7 +28,7 @@ #endif class AnimationImpl; -class LOTNode; +struct LOTNode; namespace lottie { @@ -209,17 +209,12 @@ public: */ ~Animation(); +private: /** * @brief default constructor - * - * @note user should never construct animation object. - * they should call the one of the factory method instead. - * - * @see loadFromFile() - * @see loadFromData() */ Animation(); -private: + std::unique_ptr d; }; diff --git a/src/lottie/lottieanimation.cpp b/src/lottie/lottieanimation.cpp index 07dfcb0..f7a929f 100644 --- a/src/lottie/lottieanimation.cpp +++ b/src/lottie/lottieanimation.cpp @@ -199,7 +199,7 @@ Animation::loadFromData(std::string jsonData, const std::string &key) LottieLoader loader; if (loader.loadFromData(std::move(jsonData), key)) { - auto animation = std::make_unique(); + auto animation = std::unique_ptr(new Animation); animation->d->init(loader.model()); return animation; } @@ -216,7 +216,7 @@ Animation::loadFromFile(const std::string &path) LottieLoader loader; if (loader.load(path)) { - auto animation = std::make_unique(); + auto animation = std::unique_ptr(new Animation); animation->d->init(loader.model()); return animation; }