IWidgetFactory    obsolete

貌似与FactoryManger 与 GenericFactory 的效用相似

但是它采用了继承关系:

两层关系:

IWidgetFactory

而BaseWidgetFactory 很值得注意,因为作者在MyGui的命名空间中引入 namespace factory 

引入代码:


这种模式在MyGUI中应该是过时的:

因为关于IWidgetFactory的操作都是


	/*obsolete:*/
#ifndef MYGUI_DONT_USE_OBSOLETE

		MYGUI_OBSOLETE("use : void WidgetManager::destroyWidgets(VectorWidgetPtr &_widgets)")
		void destroyWidgetsVector(VectorWidgetPtr &_widgets) { destroyWidgets(_widgets); }
		MYGUI_OBSOLETE("")
		Widget* findWidgetT(const std::string& _name, bool _throw = true);
		MYGUI_OBSOLETE("")
		Widget* findWidgetT(const std::string& _name, const std::string& _prefix, bool _throw = true);
		MYGUI_OBSOLETE("")
		void registerFactory(IWidgetFactory * _factory);
		MYGUI_OBSOLETE("")
		void unregisterFactory(IWidgetFactory * _factory);
		MYGUI_OBSOLETE("use : void Widget::setProperty(const std::string &_key, const std::string &_value)")
		void parse(Widget* _widget, const std::string &_key, const std::string &_value);
		MYGUI_OBSOLETE("")
		ParseDelegate& registerDelegate(const std::string& _key);
		MYGUI_OBSOLETE("")
		void unregisterDelegate(const std::string& _key);

		template <typename T>
		MYGUI_OBSOLETE("")
		T* findWidget(const std::string& _name, bool _throw = true)
		{
			Widget* widget = findWidgetT(_name, _throw);
			if (nullptr == widget) return nullptr;
			return widget->castType<T>(_throw);
		}

		template <typename T>
		MYGUI_OBSOLETE("")
		T* findWidget(const std::string& _name, const std::string& _prefix, bool _throw = true)
		{
			return findWidget<T>(_prefix + _name, _throw);
		}

#endif // MYGUI_DONT_USE_OBSOLETE

而且在加载过程的日志中并没有对其有说明!

所以暂时不对这两个类进行过多的分析.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值