From: Hermet Park Date: Wed, 16 Nov 2016 08:28:44 +0000 (+0900) Subject: c++: add noexcept specifiers to compiler optimize aggresively. X-Git-Tag: submit/tizen_3.0/20161121.043705^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7fcecfbbd7cbb985cc2ff01676686afc30d2c0e;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git c++: add noexcept specifiers to compiler optimize aggresively. We don't need to throw exceptions becaus we have own exception specification (tizen error values). This noexcept keyword may help compiler to optmize op code better. Change-Id: Ied8f110bdbe846fa73f4b546f76c731cd9ea654a --- diff --git a/src/lib/efl/UiBaseKeyListener.cpp b/src/lib/efl/UiBaseKeyListener.cpp index 7cd00b9..fa5d6c3 100644 --- a/src/lib/efl/UiBaseKeyListener.cpp +++ b/src/lib/efl/UiBaseKeyListener.cpp @@ -36,10 +36,10 @@ public: ~UiBaseKeyListenerImpl() {} int init(); - int term(); + int term() noexcept; void eventProc(Evas_Event_Key_Down *ev); - UiBaseViewmgr *getViewmgr() { return this->viewmgr; } - Eo *getKeygrabObj() { return this->keyGrabber; } + UiBaseViewmgr *getViewmgr() noexcept { return this->viewmgr; } + Eo *getKeygrabObj() noexcept { return this->keyGrabber; } }; } @@ -68,7 +68,7 @@ void UiBaseKeyListenerImpl::eventProc(Evas_Event_Key_Down *ev) view->onBack(); } -int UiBaseKeyListenerImpl::term() +int UiBaseKeyListenerImpl::term() noexcept { evas_object_del(this->keyGrabber); diff --git a/src/lib/efl/UiBaseViewmgr.cpp b/src/lib/efl/UiBaseViewmgr.cpp index c6bc856..34dcdea 100644 --- a/src/lib/efl/UiBaseViewmgr.cpp +++ b/src/lib/efl/UiBaseViewmgr.cpp @@ -45,11 +45,11 @@ private: Elm_Layout *_setTransitionLayout(string transitionStyle); - bool _createConformant(Elm_Win *win); - bool _createScroller(Elm_Conformant *conform); + bool _createConformant(Elm_Win *win) noexcept; + bool _createScroller(Elm_Conformant *conform) noexcept; bool _createBaseLayout(Elm_Scroller *scroller, const char *style); - void _setIndicator(UiViewIndicator indicator); - void _setAvailableRotations(UiBaseView *view); + void _setIndicator(UiViewIndicator indicator) noexcept; + void _setAvailableRotations(UiBaseView *view) noexcept; void _activateTopView(); bool _init(); bool _term(); @@ -58,8 +58,8 @@ public: UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, UiBaseKeyListener *keyListener); ~UiBaseViewmgrImpl(); - void activate(); - void deactivate(); + void activate() noexcept; + void deactivate() noexcept; void pushView(UiBaseView *view); void popView(); @@ -179,7 +179,7 @@ void UiBaseViewmgrImpl::_activateTopView() //FIXME: How to deal with indicator in other UI framework? Dali? Volt? //Is it possible make this interface common? -void UiBaseViewmgrImpl::_setIndicator(UiViewIndicator indicator) +void UiBaseViewmgrImpl::_setIndicator(UiViewIndicator indicator) noexcept { if (this->_indicator == indicator) return; this->_indicator = indicator; @@ -209,7 +209,7 @@ void UiBaseViewmgrImpl::_setIndicator(UiViewIndicator indicator) } } -void UiBaseViewmgrImpl::_setAvailableRotations(UiBaseView *view) +void UiBaseViewmgrImpl::_setAvailableRotations(UiBaseView *view) noexcept { const int *rotations = nullptr; unsigned int count = 0; @@ -219,7 +219,7 @@ void UiBaseViewmgrImpl::_setAvailableRotations(UiBaseView *view) elm_win_wm_rotation_available_rotations_set(this->getWindow(), rotations, count); } -bool UiBaseViewmgrImpl::_createConformant(Elm_Win *win) +bool UiBaseViewmgrImpl::_createConformant(Elm_Win *win) noexcept { Elm_Conformant *conform = elm_conformant_add(win); if (!conform) return false; @@ -234,7 +234,7 @@ bool UiBaseViewmgrImpl::_createConformant(Elm_Win *win) return true; } -bool UiBaseViewmgrImpl::_createScroller(Elm_Conformant *conform) +bool UiBaseViewmgrImpl::_createScroller(Elm_Conformant *conform) noexcept { Elm_Scroller *scroller = elm_scroller_add(conform); if (!scroller) return false; @@ -340,13 +340,13 @@ bool UiBaseViewmgrImpl::_term() return this->_keyListener->term(); } -void UiBaseViewmgrImpl::activate() +void UiBaseViewmgrImpl::activate() noexcept { this->_activateTopView(); evas_object_show(this->_win); } -void UiBaseViewmgrImpl::deactivate() +void UiBaseViewmgrImpl::deactivate() noexcept { //FIXME: based on the profile, we should app to go behind or terminate. if (true) { diff --git a/src/lib/efl/mobile/UiStandardView.cpp b/src/lib/efl/mobile/UiStandardView.cpp index 59a9d63..5809000 100644 --- a/src/lib/efl/mobile/UiStandardView.cpp +++ b/src/lib/efl/mobile/UiStandardView.cpp @@ -38,36 +38,36 @@ private: Elm_Button *_titleRightBtn = nullptr; //Title right button bool _titleVisible = true; - bool _createLayout(); - bool _destroyLayout(); + bool _createLayout() noexcept; + bool _destroyLayout() noexcept; public: explicit UiStandardViewImpl(UiStandardView *view); ~UiStandardViewImpl(); - int setContent(Eo *content); - int setTitleBadge(const char *text); - int setSubtitle(const char *text); - int setTitleLeftBtn(Elm_Button *titleLeftBtn); - int setTitleRightBtn(Elm_Button *titleRightBtn); - int setTitle(const char *text); - int setToolbar(Elm_Toolbar *toolbar); - int setTitleVisible(bool visible, bool anim); - int unsetContent(); - Elm_Button *unsetTitleLeftBtn(); - Elm_Button *unsetTitleRightBtn(); - Elm_Toolbar *unsetToolbar(); - Eo *getBase() const; - - Elm_Button *getTitleLeftBtn() const { + int setContent(Eo *content) noexcept; + int setTitleBadge(const char *text) noexcept; + int setSubtitle(const char *text) noexcept; + int setTitleLeftBtn(Elm_Button *titleLeftBtn) noexcept; + int setTitleRightBtn(Elm_Button *titleRightBtn) noexcept; + int setTitle(const char *text) noexcept; + int setToolbar(Elm_Toolbar *toolbar) noexcept; + int setTitleVisible(bool visible, bool anim) noexcept; + int unsetContent() noexcept; + Elm_Button *unsetTitleLeftBtn() noexcept; + Elm_Button *unsetTitleRightBtn() noexcept; + Elm_Toolbar *unsetToolbar() noexcept; + Eo *getBase() const noexcept; + + Elm_Button *getTitleLeftBtn() const noexcept { return this->_titleLeftBtn; } - Elm_Button *getTitleRightBtn()const { + Elm_Button *getTitleRightBtn()const noexcept { return this->_titleRightBtn; } - Elm_Toolbar *getToolbar() const { + Elm_Toolbar *getToolbar() const noexcept { return this->_toolbar; } }; @@ -102,7 +102,7 @@ static void _toolbarDelCb(void *data, Evas *e, Eo *obj, void *event_info) view->unsetToolbar(); } -bool UiStandardViewImpl::_destroyLayout() +bool UiStandardViewImpl::_destroyLayout() noexcept { if (!this->_layout) return false; @@ -112,7 +112,7 @@ bool UiStandardViewImpl::_destroyLayout() return true; } -bool UiStandardViewImpl::_createLayout() +bool UiStandardViewImpl::_createLayout() noexcept { if (this->_layout) return false; @@ -170,7 +170,7 @@ UiStandardViewImpl::~UiStandardViewImpl() _destroyLayout(); } -int UiStandardViewImpl::setContent(Eo *content) +int UiStandardViewImpl::setContent(Eo *content) noexcept { Elm_Layout *layout = this->getBase(); LAYOUT_VALIDATE(); @@ -187,7 +187,7 @@ int UiStandardViewImpl::setContent(Eo *content) return UI_VIEWMGR_ERROR_NONE; } -int UiStandardViewImpl::setSubtitle(const char *text) +int UiStandardViewImpl::setSubtitle(const char *text) noexcept { Elm_Layout *layout = this->getBase(); LAYOUT_VALIDATE(); @@ -200,7 +200,7 @@ int UiStandardViewImpl::setSubtitle(const char *text) return UI_VIEWMGR_ERROR_NONE; } -int UiStandardViewImpl::setTitleLeftBtn(Elm_Button *titleLeftBtn) +int UiStandardViewImpl::setTitleLeftBtn(Elm_Button *titleLeftBtn) noexcept { Elm_Layout *layout = this->getBase(); LAYOUT_VALIDATE(); @@ -230,7 +230,7 @@ int UiStandardViewImpl::setTitleLeftBtn(Elm_Button *titleLeftBtn) return UI_VIEWMGR_ERROR_NONE; } -int UiStandardViewImpl::setTitleRightBtn(Elm_Button *titleRightBtn) +int UiStandardViewImpl::setTitleRightBtn(Elm_Button *titleRightBtn) noexcept { Elm_Layout *layout = this->getBase(); Elm_Button *pbtn; @@ -258,7 +258,7 @@ int UiStandardViewImpl::setTitleRightBtn(Elm_Button *titleRightBtn) return UI_VIEWMGR_ERROR_NONE; } -int UiStandardViewImpl::setTitleBadge(const char *text) +int UiStandardViewImpl::setTitleBadge(const char *text) noexcept { Elm_Layout *layout = this->getBase(); LAYOUT_VALIDATE(); @@ -271,7 +271,7 @@ int UiStandardViewImpl::setTitleBadge(const char *text) return UI_VIEWMGR_ERROR_NONE; } -int UiStandardViewImpl::setTitle(const char *text) +int UiStandardViewImpl::setTitle(const char *text) noexcept { Elm_Layout *layout = this->getBase(); LAYOUT_VALIDATE(); @@ -284,7 +284,7 @@ int UiStandardViewImpl::setTitle(const char *text) return UI_VIEWMGR_ERROR_NONE; } -int UiStandardViewImpl::setToolbar(Elm_Toolbar *toolbar) +int UiStandardViewImpl::setToolbar(Elm_Toolbar *toolbar) noexcept { Elm_Layout *layout = this->getBase(); LAYOUT_VALIDATE(); @@ -321,7 +321,7 @@ int UiStandardViewImpl::setToolbar(Elm_Toolbar *toolbar) return UI_VIEWMGR_ERROR_NONE; } -int UiStandardViewImpl::unsetContent() +int UiStandardViewImpl::unsetContent() noexcept { Elm_Layout *layout = this->getBase(); LAYOUT_VALIDATE(); @@ -332,7 +332,7 @@ int UiStandardViewImpl::unsetContent() return UI_VIEWMGR_ERROR_NONE; } -Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn() +Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn() noexcept { Elm_Button *btn = this->_titleLeftBtn; if (!btn) { @@ -357,7 +357,7 @@ Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn() return btn; } -Elm_Button *UiStandardViewImpl::unsetTitleRightBtn() +Elm_Button *UiStandardViewImpl::unsetTitleRightBtn() noexcept { Elm_Button *btn = this->_titleRightBtn; if (!btn) { @@ -382,7 +382,7 @@ Elm_Button *UiStandardViewImpl::unsetTitleRightBtn() return btn; } -Elm_Toolbar *UiStandardViewImpl::unsetToolbar() +Elm_Toolbar *UiStandardViewImpl::unsetToolbar() noexcept { Elm_Toolbar *toolbar = this->_toolbar; if (!toolbar) { @@ -407,7 +407,7 @@ Elm_Toolbar *UiStandardViewImpl::unsetToolbar() return toolbar; } -Eo *UiStandardViewImpl::getBase() const +Eo *UiStandardViewImpl::getBase() const noexcept { if (!this->_layout) { const_cast(this)->_createLayout(); @@ -416,7 +416,7 @@ Eo *UiStandardViewImpl::getBase() const return this->_layout; } -int UiStandardViewImpl::setTitleVisible(bool visible, bool anim) +int UiStandardViewImpl::setTitleVisible(bool visible, bool anim) noexcept { this->_titleVisible = visible; diff --git a/src/lib/efl/mobile/UiView.cpp b/src/lib/efl/mobile/UiView.cpp index 54486ac..d801696 100644 --- a/src/lib/efl/mobile/UiView.cpp +++ b/src/lib/efl/mobile/UiView.cpp @@ -38,8 +38,8 @@ private: UiMenu *_menu = nullptr; list _popupList; - void _connectPopup(UiPopup *popup); - void _disconnectPopup(UiPopup *popup); + void _connectPopup(UiPopup *popup) noexcept; + void _disconnectPopup(UiPopup *popup) noexcept; bool _deactivatePopup(bool topOne); protected: @@ -54,22 +54,22 @@ public: explicit UiViewImpl(UiView *view); ~UiViewImpl(); - const UiMenu *getMenu() const + const UiMenu *getMenu() const noexcept { return this->_menu; } - UiViewOrientationMode getOrientationMode() const; + UiViewOrientationMode getOrientationMode() const noexcept; }; } -void UiViewImpl::_connectPopup(UiPopup *popup) +void UiViewImpl::_connectPopup(UiPopup *popup) noexcept { this->_popupList.push_back(popup); } -void UiViewImpl::_disconnectPopup(UiPopup *popup) +void UiViewImpl::_disconnectPopup(UiPopup *popup) noexcept { this->_popupList.remove(popup); } @@ -160,7 +160,7 @@ void UiViewImpl::onLandscape() this->_menu->onLandscape(); } -UiViewOrientationMode UiViewImpl::getOrientationMode() const +UiViewOrientationMode UiViewImpl::getOrientationMode() const noexcept { switch (this->_view->getDegree()) { case 0: diff --git a/src/lib/efl/mobile/c/ui_application.cpp b/src/lib/efl/mobile/c/ui_application.cpp index 732d562..6cfc633 100644 --- a/src/lib/efl/mobile/c/ui_application.cpp +++ b/src/lib/efl/mobile/c/ui_application.cpp @@ -95,7 +95,7 @@ public: { } - bool set_event_cb(ui_application_event_type_e event_type, ui_application_event_cb event_cb, void *user_data) + bool set_event_cb(ui_application_event_type_e event_type, ui_application_event_cb event_cb, void *user_data) noexcept { this->event_cb[event_type] = event_cb; this->user_data[event_type] = user_data; diff --git a/src/lib/interface/UiIfaceOverlay.cpp b/src/lib/interface/UiIfaceOverlay.cpp index 20289da..b5fc461 100644 --- a/src/lib/interface/UiIfaceOverlay.cpp +++ b/src/lib/interface/UiIfaceOverlay.cpp @@ -35,10 +35,10 @@ private: T _content = nullptr; public: - int setContent(T content); - T unsetContent(); - UiIfaceView *getView() const; - T getContent() const; + int setContent(T content) noexcept; + T unsetContent() noexcept; + UiIfaceView *getView() const noexcept; + T getContent() const noexcept; UiIfaceOverlayImpl(UiIfaceOverlay *overlay, UiIfaceView *view); ~UiIfaceOverlayImpl(); @@ -55,25 +55,25 @@ UiIfaceOverlayImpl::~UiIfaceOverlayImpl() { } -int UiIfaceOverlayImpl::setContent(T content) +int UiIfaceOverlayImpl::setContent(T content) noexcept { this->_content = content; return UI_VIEWMGR_ERROR_NONE; } -T UiIfaceOverlayImpl::unsetContent() +T UiIfaceOverlayImpl::unsetContent() noexcept { T prev = this->_content; this->_content = nullptr; return prev; } -T UiIfaceOverlayImpl::getContent() const +T UiIfaceOverlayImpl::getContent() const noexcept { return this->_content; } -UiIfaceView *UiIfaceOverlayImpl::getView() const +UiIfaceView *UiIfaceOverlayImpl::getView() const noexcept { return this->_view; } diff --git a/src/lib/interface/UiIfaceView.cpp b/src/lib/interface/UiIfaceView.cpp index ac6fb6d..6788fb7 100644 --- a/src/lib/interface/UiIfaceView.cpp +++ b/src/lib/interface/UiIfaceView.cpp @@ -49,32 +49,32 @@ private: bool _popping = false; public: - int setEventBlock(bool block); - void onLoad(); - void onUnload(); - void onActivate(); - void onDeactivate(); - void onPause(); - void onResume(); - void onDestroy(); - bool getEventBlock() const; - int setContent(T content); - T unsetContent(); + int setEventBlock(bool block) noexcept; + void onLoad() noexcept; + void onUnload() noexcept; + void onActivate() noexcept; + void onDeactivate() noexcept; + void onPause() noexcept; + void onResume() noexcept; + void onDestroy() noexcept; + bool getEventBlock() const noexcept; + int setContent(T content) noexcept; + T unsetContent() noexcept; UiIfaceViewImpl(UiIfaceView *view, const char *name); ~UiIfaceViewImpl(); int setTransitionStyle(const char *style); - void setRemovableContent(bool removable); - int setIndicator(UiViewIndicator indicator); - int setAvailableRotations(const int *rotations, unsigned int count); - const int *getAvailableRotations(unsigned int *count) const; - const char *getTransitionStyle() const; - const char *getName() const; - T getContent() const; - UiViewState getState() const; - bool getRemovableContent() const; - UiViewIndicator getIndicator() const; + void setRemovableContent(bool removable) noexcept; + int setIndicator(UiViewIndicator indicator) noexcept; + int setAvailableRotations(const int *rotations, unsigned int count) noexcept; + const int *getAvailableRotations(unsigned int *count) const noexcept; + const char *getTransitionStyle() const noexcept; + const char *getName() const noexcept; + T getContent() const noexcept; + UiViewState getState() const noexcept; + bool getRemovableContent() const noexcept; + UiViewIndicator getIndicator() const noexcept; void onBack(); }; @@ -82,24 +82,24 @@ public: #define MAX_NUM_OF_AVAILABLE_ROTATIONS 4 -bool UiIfaceViewImpl::getEventBlock() const +bool UiIfaceViewImpl::getEventBlock() const noexcept { return this->_eventBlock; } -int UiIfaceViewImpl::setEventBlock(bool block) +int UiIfaceViewImpl::setEventBlock(bool block) noexcept { this->_eventBlock = block; return UI_VIEWMGR_ERROR_NONE; } -void UiIfaceViewImpl::onLoad() +void UiIfaceViewImpl::onLoad() noexcept { this->_state = UI_VIEW_STATE_LOAD; } -void UiIfaceViewImpl::onUnload() +void UiIfaceViewImpl::onUnload() noexcept { this->_state = UI_VIEW_STATE_UNLOAD; if (this->getRemovableContent()) { @@ -108,27 +108,27 @@ void UiIfaceViewImpl::onUnload() } } -void UiIfaceViewImpl::onActivate() +void UiIfaceViewImpl::onActivate() noexcept { this->_state = UI_VIEW_STATE_ACTIVATE; } -void UiIfaceViewImpl::onDeactivate() +void UiIfaceViewImpl::onDeactivate() noexcept { this->_state = UI_VIEW_STATE_DEACTIVATE; } -void UiIfaceViewImpl::onPause() +void UiIfaceViewImpl::onPause() noexcept { this->_state = UI_VIEW_STATE_PAUSE; } -void UiIfaceViewImpl::onResume() +void UiIfaceViewImpl::onResume() noexcept { this->_state = UI_VIEW_STATE_ACTIVATE; } -void UiIfaceViewImpl::onDestroy() +void UiIfaceViewImpl::onDestroy() noexcept { } @@ -160,13 +160,13 @@ UiIfaceViewImpl::~UiIfaceViewImpl() if (this->_rotations) delete[](this->_rotations); } -int UiIfaceViewImpl::setContent(T content) +int UiIfaceViewImpl::setContent(T content) noexcept { this->_content = content; return UI_VIEWMGR_ERROR_NONE; } -T UiIfaceViewImpl::unsetContent() +T UiIfaceViewImpl::unsetContent() noexcept { T prev = this->_content; this->_content = nullptr; @@ -181,14 +181,14 @@ int UiIfaceViewImpl::setTransitionStyle(const char *style) return UI_VIEWMGR_ERROR_NONE; } -void UiIfaceViewImpl::setRemovableContent(bool removable) +void UiIfaceViewImpl::setRemovableContent(bool removable) noexcept { this->_removableContent = removable; //FIXME: If this api is called on unload state? should we remove content right now? } -int UiIfaceViewImpl::setIndicator(UiViewIndicator indicator) +int UiIfaceViewImpl::setIndicator(UiViewIndicator indicator) noexcept { if (indicator <= UI_VIEW_INDICATOR_UNKNOWN || indicator >= _NUM_OF_UI_VIEW_INDICATOR) return UI_VIEWMGR_ERROR_INVALID_PARAMETER; @@ -198,7 +198,7 @@ int UiIfaceViewImpl::setIndicator(UiViewIndicator indicator) return UI_VIEWMGR_ERROR_NONE; } -int UiIfaceViewImpl::setAvailableRotations(const int *rotations, unsigned int count) +int UiIfaceViewImpl::setAvailableRotations(const int *rotations, unsigned int count) noexcept { if (!rotations) { @@ -226,7 +226,7 @@ int UiIfaceViewImpl::setAvailableRotations(const int *rotations, unsigned int co return UI_VIEWMGR_ERROR_NONE; } -const int *UiIfaceViewImpl::getAvailableRotations(unsigned int *count) const +const int *UiIfaceViewImpl::getAvailableRotations(unsigned int *count) const noexcept { if (!count) { set_last_result(UI_VIEWMGR_ERROR_INVALID_PARAMETER); @@ -246,32 +246,32 @@ const int *UiIfaceViewImpl::getAvailableRotations(unsigned int *count) const } } -const char *UiIfaceViewImpl::getTransitionStyle() const +const char *UiIfaceViewImpl::getTransitionStyle() const noexcept { return this->_transitionStyle.c_str(); } -const char *UiIfaceViewImpl::getName() const +const char *UiIfaceViewImpl::getName() const noexcept { return this->_name.c_str(); } -T UiIfaceViewImpl::getContent() const +T UiIfaceViewImpl::getContent() const noexcept { return this->_content; } -UiViewState UiIfaceViewImpl::getState() const +UiViewState UiIfaceViewImpl::getState() const noexcept { return this->_state; } -bool UiIfaceViewImpl::getRemovableContent() const +bool UiIfaceViewImpl::getRemovableContent() const noexcept { return this->_removableContent; } -UiViewIndicator UiIfaceViewImpl::getIndicator() const +UiViewIndicator UiIfaceViewImpl::getIndicator() const noexcept { return this->_indicator; } diff --git a/src/lib/interface/UiIfaceViewmgr.cpp b/src/lib/interface/UiIfaceViewmgr.cpp index 385061b..0611b6c 100644 --- a/src/lib/interface/UiIfaceViewmgr.cpp +++ b/src/lib/interface/UiIfaceViewmgr.cpp @@ -43,9 +43,9 @@ private: bool _destroying = false; //True, if viewmgr is on destroying. public: - int connectView(UiIfaceView *view); - int disconnectView(UiIfaceView *view); - void setEventBlock(UiIfaceView *view, bool block); + int connectView(UiIfaceView *view) noexcept; + int disconnectView(UiIfaceView *view) noexcept; + void setEventBlock(UiIfaceView *view, bool block) noexcept; void pushViewFinished(UiIfaceView *view); void popViewFinished(UiIfaceView *view); @@ -53,21 +53,21 @@ public: int popView(); int insertViewBefore(UiIfaceView *view, UiIfaceView *before); int insertViewAfter(UiIfaceView *view, UiIfaceView *after); - int removeView(UiIfaceView *view); - UiIfaceView *getView(unsigned int idx); - UiIfaceView *getView(const char *name); - UiIfaceView *getLastView(); - int getViewIndex(const UiIfaceView *view); + int removeView(UiIfaceView *view) noexcept; + UiIfaceView *getView(unsigned int idx) noexcept; + UiIfaceView *getView(const char *name) noexcept; + UiIfaceView *getLastView() noexcept; + int getViewIndex(const UiIfaceView *view) noexcept; explicit UiIfaceViewmgrImpl(UiIfaceViewmgr *viewmgr); ~UiIfaceViewmgrImpl(); int activate(); int deactivate(); - bool isActivated(); - unsigned int getViewCount(); - static bool needSoftKey(); - static UiIfaceViewmgr* getInstance(); + bool isActivated() noexcept; + unsigned int getViewCount() noexcept; + static bool needSoftKey() noexcept; + static UiIfaceViewmgr* getInstance() noexcept; }; } @@ -116,12 +116,12 @@ int UiIfaceViewmgrImpl::insertViewAfter(UiIfaceView *view, UiIfaceView *after) return this->pushView(view); } -bool UiIfaceViewmgrImpl::needSoftKey() +bool UiIfaceViewmgrImpl::needSoftKey() noexcept { return UiIfaceViewmgrImpl::_softKey; } -int UiIfaceViewmgrImpl::connectView(UiIfaceView *view) +int UiIfaceViewmgrImpl::connectView(UiIfaceView *view) noexcept { //TODO: Perform this only in debug mode? //Check whether the same name of this view is already existed in this viewmgr? @@ -145,14 +145,14 @@ int UiIfaceViewmgrImpl::connectView(UiIfaceView *view) return UI_VIEWMGR_ERROR_NONE; } -int UiIfaceViewmgrImpl::disconnectView(UiIfaceView *view) +int UiIfaceViewmgrImpl::disconnectView(UiIfaceView *view) noexcept { if (!view->_getViewmgr()) return UI_VIEWMGR_ERROR_NOT_PERMITTED; view->_setViewmgr(nullptr); return UI_VIEWMGR_ERROR_NONE; } -void UiIfaceViewmgrImpl::setEventBlock(UiIfaceView *view, bool block) +void UiIfaceViewmgrImpl::setEventBlock(UiIfaceView *view, bool block) noexcept { if (!UiIfaceViewmgrImpl::_eventBlock) return; view->setEventBlock(block); @@ -334,7 +334,7 @@ int UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before) return this->pushView(view); } -int UiIfaceViewmgrImpl::removeView(UiIfaceView *view) +int UiIfaceViewmgrImpl::removeView(UiIfaceView *view) noexcept { if (this->_destroying) return UI_VIEWMGR_ERROR_NONE; @@ -344,7 +344,7 @@ int UiIfaceViewmgrImpl::removeView(UiIfaceView *view) return this->disconnectView(view); } -UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx) +UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx) noexcept { if (idx >= this->_viewList.size()) { LOGE("Invalid idx(%d)! =? (idx range: %d ~ %d)", idx, 0, this->_viewList.size() - 1); @@ -359,7 +359,7 @@ UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx) return *it; } -int UiIfaceViewmgrImpl::getViewIndex(const UiIfaceView *view) +int UiIfaceViewmgrImpl::getViewIndex(const UiIfaceView *view) noexcept { int idx = 0; @@ -371,7 +371,7 @@ int UiIfaceViewmgrImpl::getViewIndex(const UiIfaceView *view) return UI_VIEWMGR_ERROR_INVALID_PARAMETER; } -UiIfaceView *UiIfaceViewmgrImpl::getLastView() +UiIfaceView *UiIfaceViewmgrImpl::getLastView() noexcept { int cnt = this->getViewCount(); @@ -418,7 +418,7 @@ int UiIfaceViewmgrImpl::deactivate() return UI_VIEWMGR_ERROR_NONE; } -UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name) +UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name) noexcept { if (!name) { @@ -443,17 +443,17 @@ UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name) return nullptr; } -bool UiIfaceViewmgrImpl::isActivated() +bool UiIfaceViewmgrImpl::isActivated() noexcept { return this->_activated; } -unsigned int UiIfaceViewmgrImpl::getViewCount() +unsigned int UiIfaceViewmgrImpl::getViewCount() noexcept { return this->_viewList.size(); } -UiIfaceViewmgr* UiIfaceViewmgrImpl::getInstance() +UiIfaceViewmgr* UiIfaceViewmgrImpl::getInstance() noexcept { return UiIfaceViewmgrImpl::_inst; }