当前位置: 首页 > news >正文

深圳网站建设 工作室wordpress themepath

深圳网站建设 工作室,wordpress themepath,最好的销售管理系统,wordpress 注释模版意图#xff1a;将对象组成树状结构以表示“部分#xff0d;整体”的层次结构#xff0c;使得Client对单个对象和组合对象的使用具有一致性。 上下文#xff1a;在树型结构的问题中#xff0c;Client必须以不同的方式处理单个对象和组合对象。能否提供一种封装#xff0c… 意图将对象组成树状结构以表示“部分整体”的层次结构使得Client对单个对象和组合对象的使用具有一致性。 上下文在树型结构的问题中Client必须以不同的方式处理单个对象和组合对象。能否提供一种封装统一简单元素和复杂元素的概念让对象容器自己来实现自身的复杂结构让Client可以像处理简单元素一样来处理复杂元素从而使Client与复杂元素的内部结构解耦 UML Component为Composite中的对象声明接口在适当情况下实现所有类公共接口的默认行为声明一个接口用于访问和管理Component的子部件在递归结构中定义一个接口用于访问一个父部件并在适当的情况下实现它。 Leaf在Composite中表示叶子对象。 Composite存储子部件并定义有子部件的那些部件的行为。 Client通过Component接口操作Composite的对象。 代码 #include iostream #include list using namespace std;class Component { public:string name;Component(string name):name(name){}virtual void add(Component *c) 0;virtual void remove(Component *c) 0;virtual void display(int depth) 0; };class Leaf:public Component { public:// Component interfaceLeaf(string name):Component(name){} public:void add(Component *c);void remove(Component *c);void display(int depth); };void Leaf::add(Component *c ) {(void)(c);//消除警告cout 不能向叶子中添加Component endl; }void Leaf::remove(Component *c) {(void)(c);//Warningcout 不能从叶子中删除Component endl; }void Leaf::display(int depth) {cout string(depth,-) this-name endl; }class Composite:public Component { public:listComponent* children;// Component interfaceComposite(string name):Component(name){} public:void add(Component *c);void remove(Component *c);void display(int depth); }; void Composite::add(Component *c) {children.push_back(c); }void Composite::remove(Component *c) {children.remove(c); }void Composite::display(int depth) {cout string(depth,-) this-name endl;listComponent*::iterator it;for(it children.begin();it ! children.end();it){Component *c *it;c-display(depth 2);} } int main() {Composite *root new Composite(树干);root-add(new Leaf(树叶1));root-add(new Leaf(树叶2));Composite *c1 new Composite(树枝1);c1-add(new Leaf(树叶1-1));c1-add(new Leaf(树叶1-2));root-add(c1);Composite *c1_1 new Composite(树枝1-1);c1_1-add(new Leaf(树叶1-1-1));c1_1-add(new Leaf(树叶1-1-2));c1-add(c1_1);root-add(new Leaf(树叶3));root-display(1);return 0; }结果 -树干 ---树叶1 ---树叶2 ---树枝1 -----树叶1-1 -----树叶1-2 -----树枝1-1 -------树叶1-1-1 -------树叶1-1-2 ---树叶3
http://wiki.neutronadmin.com/news/437924/

相关文章:

  • 建模e-r跟做网站有什么关系中文搜索引擎有哪些
  • 微网站怎么做的好刚刚地震最新消息今天 刚才云南
  • 杭州做网站公司vue做普通网站页面跳转
  • 网站怎么样做不违规卫浴品牌排行榜前十名
  • 表格可以做网站么网站开发流程表
  • nodejs网站开发诸暨网站制作公司 网页
  • wordpress可以做大量文章的网站潍坊百度搜索优化
  • jsp网站开发的环境要求agile WordPress
  • 提供网站建设方案ppt环球资源网的定位
  • 太仓网站建设找哪家seo网络推广经理
  • 新网站建设咨询数商云电子商务网站建设
  • 做网站可以赚钱吗文创产品网站
  • 南京模板网站建设企业专业群建设 网站
  • 网站开发 英文文章招聘网站免费平台
  • wordpress站内301做网站可以用什么语言
  • 建设网站找哪里saas电商建站系统
  • 一个服务器可以做多个网站吗商业网站建设咨询
  • 有pc网站竞价托管外包哪家好
  • 网站托管服务怎么收费沂南网站优化
  • 辽阳网站建设多少钱网站高端设计
  • 徐州网站排名苏州网站设计
  • 类似freenom的免费域名网站现在一般做网站都是去哪家做的
  • 河北做it的网站深圳自助建站网站
  • 上海哪家网站建设比较好保定投递网站建设
  • 影响力网站建设江苏广兴建设集团网站
  • 做网站放哪个科目推荐手机网站建设
  • 外贸网站建设的败笔凌风wordpress百度云
  • 江苏城乡建设网站公司起名字库
  • 做网站店铺图片用什么软件做科研交流常用的网站
  • 网站开发 题目成都网站建设外包