当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: //C++ 中泛型工厂注册类的实现//-------------
 

 

    摘要:条款1:仔细选择你的容器 你知道c++中有很多你可以支配的容器,但是你意识到有多少吗?要确定你没有忽略你的选项,这里有一个快速回顾。 标准stl序列容器:vector、string、deque和list。 标准stl关联容器:set、multiset、map和multimap。 非标准序列容器slist和rope。slist是一个单向链表,rope本质上是一个重型字符串。(R......
 ·jsp/servlet文件上传    »显示摘要«
    摘要:common-fileupload组件下载地址:http://jakarta.apache.org/commons/fileupload/下载后解压zip包,将commons-fileupload-1.0.jar复制到tomcat的webapps\你的webapp\web-inf\lib\下create a servletimport java.io.*;import java.util.*;im......


C++ 中泛型工厂注册类的实现

//c++ 中泛型工厂注册类的实现

【程序编程相关:看实例学php正则表达式

【推荐阅读:原来写的一篇老文:实战Log4j

//--------------------------------------------------------------------------- 【扩展信息:模板类的练习——队列

#ifndef genericfactoryh

#define genericfactoryh

#include <string>

#include <map>

#define register_class(base_class, derived_class)\

        registerinpfactory<base_class, derived_class> register##derived_class(#derived_class)

#define create_class(base_class,derived_class)\

        genericfactory<base_class>::instance().create(#derived_class)

//---------------------------------------------------------------------------

using  std::string;

using  std::map;

template <class manufacturedtype, typename classidkey=std::string>

class genericfactory

{

    typedef manufacturedtype* (*basecreatefn)();

    typedef std::map<classidkey, basecreatefn> fnregistry;

    fnregistry registry;


...   下一页
    摘要: - 中国ベンダの見積もりは高過ぎるのか? 中国开发商的报价是不是太高了?  ある中堅ベンダで企画が進んでいる中国オフショア開発の事例を紹介します。社内のプロジェクト計画がまとまり、発注候補先の中国ベンダと最終的な見積もり交渉を行っていました。ところが、中国ベンダの回答にあった見積もり内訳書に目を通していると、隣に座っていたプロジェクトマネージャが渋い顔でこうつぶやきました。 介......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE