[Issue#] Code refactoring.
[Bug] N/A
[Cause] N/A
[Solution] Used std::shared_ptr as SharedPtr
[Verification] Build commons, plugins, installer.
Change-Id: Icf661c0a638cfae0c53e249b6cb36e84ffdb8003
#include <typeinfo>
#include <utility>
#include <set>
+#include <memory>
#include <dpl/db/sql_connection.h>
#include <dpl/db/orm_interface.h>
#include <dpl/string.h>
#include <dpl/optional.h>
-#include <dpl/shared_ptr.h>
#include <dpl/type_list.h>
#include <dpl/assert.h>
#include <dpl/foreach.h>
virtual ArgumentIndex BindTo(DataCommand *command, ArgumentIndex index) = 0;
};
-typedef DPL::SharedPtr<Expression> ExpressionPtr;
+typedef std::shared_ptr<Expression> ExpressionPtr;
template<const char* Operator, typename LeftExpression, typename RightExpression>
class __attribute__ ((visibility("hidden"))) BinaryExpression : public Expression {
str.str());
}
//TODO maybe don't make a copy here but just generate the string part of the query.
- m_whereExpression.Reset(new Expression(expression));
+ m_whereExpression.reset(new Expression(expression));
}
};
#include <dpl/event/main_event_dispatcher.h>
#include <dpl/fast_delegate.h>
#include <dpl/shared_ptr.h>
-#include <dpl/enable_shared_from_this.h>
#include <dpl/generic_event.h>
#include <dpl/foreach.h>
#include <dpl/recursive_mutex.h>
#include <dpl/apply.h>
#include <tuple>
#include <list>
+#include <memory>
/*
* - Created ICDelegate can be passed freely to other threads.
class ICDSharedDataBase
{
public:
- typedef DPL::SharedPtr<ICDSharedDataBase> ICDSharedDataBasePtr;
+ typedef std::shared_ptr<ICDSharedDataBase> ICDSharedDataBasePtr;
typedef std::list<ICDSharedDataBasePtr> ICDSharedDataBaseList;
class ScopedLock : DPL::Noncopyable
}
virtual void Call()
{
- m_helperBase.Reset();
+ m_helperBase.reset();
}
private:
template<typename ThisType>
friend class ICDelegateSupport;
class ICDSharedData;
- typedef DPL::SharedPtr<ICDSharedData> ICDSharedDataPtr;
+ typedef std::shared_ptr<ICDSharedData> ICDSharedDataPtr;
struct PrivateEvent
{
typedef DPL::FastDelegate<void (const PrivateEvent&)>
ICDSharedDataDelegateType;
class ICDSharedData : private DPL::Event::EventSupport<PrivateEvent>,
- private DPL::EnableSharedFromThis<ICDSharedData>,
+ private std::enable_shared_from_this<ICDSharedData>,
public ICDPrivate::ICDSharedDataBase
{
public:
}
private:
- friend class DPL::SharedPtr<ICDSharedData>;
+ friend class std::shared_ptr<ICDSharedData>;
ICDSharedDataDelegateType m_subDelegate;
ICDPrivate::ICDelegateSupportInterface* m_base;
DPL::FastDelegate<void (ArgTypesList ...)> m_outerDelegate;
m_ICDSharedDatas;
FOREACH(helper, list) {
ICDPrivate::ICDSharedDataBase::ScopedLock lock(
- DPL::StaticPointerCast<ICDPrivate::ICDSharedDataBase>(*helper));
+ std::static_pointer_cast<ICDPrivate::ICDSharedDataBase>(*helper));
(*helper)->disable();
}
m_ICDSharedDatas.clear();
#ifndef WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
#define WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
+#include <dpl/noncopyable.h>
#include <dpl/framework_efl.h>
#include <dpl/assert.h>
-#include <dpl/shared_ptr.h>
#include <dpl/foreach.h>
#include <dpl/apply.h>
#include <set>
#include <string>
#include <tuple>
#include <utility>
-
+#include <memory>
namespace DPL {
namespace Popup {
class EvasObject
{
class EvasObjectShared;
- typedef DPL::SharedPtr<EvasObjectShared> EvasObjectSharedPtr;
+ typedef std::shared_ptr<EvasObjectShared> EvasObjectSharedPtr;
public:
class IConnection
#ifndef WRT_SRC_POPUP_POPUP_H_
#define WRT_SRC_POPUP_POPUP_H_
-#include <dpl/enable_shared_from_this.h>
-#include <dpl/shared_ptr.h>
+#include <memory>
#include <dpl/assert.h>
#include <dpl/log/log.h>
#include <string>
class PopupManager;
class IPopup;
-typedef DPL::SharedPtr<IPopup> IPopupPtr;
+typedef std::shared_ptr<IPopup> IPopupPtr;
-class IPopup : protected DPL::EnableSharedFromThis<IPopup>
+class IPopup : public std::enable_shared_from_this<IPopup>
{
public:
virtual void SetTitle(const std::string &title) = 0;
private:
friend class PopupManager;
- friend class DPL::SharedPtr<IPopup>;
+ friend class std::shared_ptr<IPopup>;
};
} // namespace Popup
#ifndef WRT_SRC_POPUP_CONTROLLER_POPUP_CONTROLLER_H_
#define WRT_SRC_POPUP_CONTROLLER_POPUP_CONTROLLER_H_
+#include <memory>
#include <dpl/singleton.h>
#include <dpl/event/controller.h>
#include <dpl/event/event_listener.h>
#include <dpl/generic_event.h>
#include <dpl/mutex.h>
#include <dpl/exception.h>
-#include <dpl/shared_ptr.h>
-#include <dpl/enable_shared_from_this.h>
#include <dpl/noncopyable.h>
#include <dpl/log/log.h>
#include <dpl/popup/popup_manager.h>
class PopupController;
class CtrlPopup;
-typedef DPL::SharedPtr<CtrlPopup> CtrlPopupPtr;
+typedef std::shared_ptr<CtrlPopup> CtrlPopupPtr;
DECLARE_GENERIC_EVENT_3(PopupAnswerEvent,
CtrlPopupPtr,
PopupAnswerCallback)
class CtrlPopup : public DPL::Event::EventSupport<PopupAnswerEvent>,
- protected DPL::EnableSharedFromThis<CtrlPopup>
+ public std::enable_shared_from_this<CtrlPopup>
{
public:
void SetTitle(const std::string &title);
void Append(PopupObject::IPopupObject *object);
+ ~CtrlPopup();
private:
friend class PopupController;
- friend class DPL::SharedPtr<CtrlPopup>;
+ friend class std::shared_ptr<CtrlPopup>;
explicit CtrlPopup(IPopupPtr popup);
- ~CtrlPopup();
void EmitAnswer(const AnswerCallbackData& answer);
IPopupPtr m_popup;
#ifndef WRT_SRC_POPUP_POPUP_MANAGER_H_
#define WRT_SRC_POPUP_POPUP_MANAGER_H_
+#include <memory>
#include <dpl/assert.h>
-#include <dpl/shared_ptr.h>
#include <dpl/noncopyable.h>
#include <dpl/singleton.h>
#include <dpl/optional.h>
#include <map>
#include <string>
+#include <memory>
-#include <dpl/shared_ptr.h>
#include <dpl/noncopyable.h>
#include <dpl/log/log.h>
#include <dpl/assert.h>
-#include <dpl/enable_shared_from_this.h>
#include <dpl/foreach.h>
-
#include <dpl/popup/popup.h>
namespace DPL {
namespace Popup {
-class PopupRenderer : public DPL::EnableSharedFromThis<PopupRenderer>
+class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
{
public:
PopupRenderer();
virtual void setExternalCanvas(void* externalCanvas);
protected:
class Popup;
- typedef DPL::SharedPtr<Popup> PopupPtr;
+ typedef std::shared_ptr<Popup> PopupPtr;
class Popup : public IPopup
{
Assert(callback);
m_data = data;
m_callback = callback;
- m_renderer->Render(DPL::StaticPointerCast<Popup>(SharedFromThis()));
+ m_renderer->Render(std::static_pointer_cast<Popup>(shared_from_this()));
}
const std::string& GetTitle() const
private:
friend class PopupRenderer;
- friend class DPL::SharedPtr<Popup>;
+ friend class std::shared_ptr<Popup>;
friend class PopupObjectTheme;
- Popup(DPL::SharedPtr<PopupRenderer> renderer) : m_renderer(renderer)
+ Popup(std::shared_ptr<PopupRenderer> renderer) : m_renderer(renderer)
{
}
void* m_data;
IPopup::PopupCallbackType m_callback;
PopupObject::PopupObjects m_popupObjectList;
- DPL::SharedPtr<PopupRenderer> m_renderer;
+ std::shared_ptr<PopupRenderer> m_renderer;
};
private:
Impl* m_impl;
};
-typedef DPL::SharedPtr<PopupRenderer> PopupRendererPtr;
+typedef std::shared_ptr<PopupRenderer> PopupRendererPtr;
} // namespace Popup
} // namespace DPL
void CtrlPopup::EmitAnswer(const AnswerCallbackData & answer)
{
AnswerCallbackData l_answer = answer;
- PopupAnswerEvent event(SharedFromThis(), m_callback, l_answer);
+ PopupAnswerEvent event(shared_from_this(), m_callback, l_answer);
DPL::Event::EventSupport<PopupAnswerEvent>::EmitEvent(event);
}
#include <stddef.h>
#include <dpl/popup/popup_manager.h>
#include <dpl/popup/popup.h>
-
#include <dpl/log/log.h>
-#include <dpl/shared_ptr.h>
#include <dpl/assert.h>
#include <dpl/singleton_impl.h>
{
m_popupRenderer->Deinitialize();
Assert(m_initialized);
- m_popupRenderer.Reset();
+ m_popupRenderer.reset();
m_initialized = false;
}
#include <dpl/popup/popup_renderer.h>
#include <dpl/popup/popup_manager.h>
#include <dpl/popup/evas_object.h>
-#include <dpl/shared_ptr.h>
#include <dpl/scoped_array.h>
#include <dpl/assert.h>
#include <dpl/log/log.h>
void Deinitialize()
{
Assert(m_initialized);
- m_current.Reset(NULL);
+ m_current.reset();
while (!m_popupsToRender.empty()) {
m_popupsToRender.pop();
}
answerData.chackState = m_checkState;
answerData.password = m_password;
m_current->ForwardAnswer(answerData);
- m_current.Reset();
+ m_current.reset();
FOREACH(it, m_createdObjects)
{
IPopupPtr PopupRenderer::CreatePopup()
{
- return DPL::StaticPointerCast<IPopup>(IPopupPtr
- (new Popup(SharedFromThis())));
+ return std::static_pointer_cast<IPopup>(IPopupPtr
+ (new Popup(shared_from_this())));
}
void PopupRenderer::Render(PopupPtr popup)
#ifndef DPL_TEST_RESULTS_COLLECTOR_H
#define DPL_TEST_RESULTS_COLLECTOR_H
-#include <dpl/shared_ptr.h>
#include <dpl/noncopyable.h>
#include <vector>
#include <list>
#include <map>
#include <string>
+#include <memory>
namespace DPL
{
{
class TestResultsCollectorBase;
-typedef DPL::SharedPtr<TestResultsCollectorBase>
+typedef std::shared_ptr<TestResultsCollectorBase>
TestResultsCollectorBasePtr;
class TestResultsCollectorBase
Usage();
return -1;
}
- currentCollector.Reset(TestResultsCollectorBase::Create(arg));
+ currentCollector.reset(TestResultsCollectorBase::Create(arg));
if (!currentCollector) {
InvalidArgs("Unsupported output type!");
Usage();
}
}
- currentCollector.Reset();
+ currentCollector.reset();
// Show help
if (showHelp)
#include <map>
#include <vector>
#include <list>
-#include <dpl/optional_typedefs.h>
-#include <dpl/shared_ptr.h>
#include <memory>
+#include <dpl/optional_typedefs.h>
+
namespace WrtDB {
class PluginMetafileData
{
public:
typedef std::set<std::string> Objects;
- typedef DPL::SharedPtr<Objects> ObjectsPtr;
+ typedef std::shared_ptr<Objects> ObjectsPtr;
public:
explicit PluginObjectsDAO() {}
#include <dpl/event/model.h>
#include <dpl/event/property.h>
-#include <dpl/shared_ptr.h>
+#include <memory>
#include <string>
#include <list>
#include <set>
typedef int FeatureHandle;
typedef std::list<FeatureHandle> FeatureHandleList;
-typedef DPL::SharedPtr<FeatureHandleList> FeatureHandleListPtr;
+typedef std::shared_ptr<FeatureHandleList> FeatureHandleListPtr;
typedef int FeatureSetHandle;
typedef std::list<FeatureSetHandle> FeatureSetHandleList;
}
};
-typedef DPL::SharedPtr<FeatureModel> FeatureModelPtr;
+typedef std::shared_ptr<FeatureModel> FeatureModelPtr;
} // namespace WrtDB
#include <string>
#include <list>
+#include <memory>
#include <dpl/exception.h>
-#include <dpl/shared_ptr.h>
#include <dpl/wrt-dao-ro/common_dao_types.h>
namespace WrtDB {
typedef std::list<DbPluginHandle> PluginHandleList;
typedef std::set<DbPluginHandle> PluginHandleSet;
typedef std::list<std::string> ImplementedObjectsList;
-typedef DPL::SharedPtr<PluginHandleSet> PluginHandleSetPtr;
+typedef std::shared_ptr<PluginHandleSet> PluginHandleSetPtr;
//TODO make it friend to FeatureDAO or inherit
class PluginDAOReadOnly