jfo planet

Hope is the best gift that tomorrow gives.

  • 首页
  • 分类
  • 归档
  • 标签
  • 搜索
close

boost代码分析:is_const,is_reference

发表于 2007-12-15   |   分类于 c++/c++ template/gp/boost
template <typename T> struct cv_traits_imp {};template <typename T>struct cv_traits_imp<T>{    static const bool is_const = false;    static const bool is_volatile = false;    typedef T unqualified_type;};template <typename T>struct cv_traits_imp<const T>{    static const bool is_const = true;    static const bool is_volatile = false;    typedef T unqualified ...
阅读全文 »

【zz】在C++中侦测内嵌类型的存在

发表于 2007-12-14   |   分类于 c++/c++ template/gp/boost
www.ithao123.com/cpluspluslib/20071020/1671.html 一是利用函数重载:typedef char (&yes_type)[1]; // sizeof(yes_type)==1typedef char (&no_type)[2]; // sizeof(no_type)==2char (&)[1]表示对char[1]数组的引用,注意围绕&符号的一对圆括号,它们是必要的,如果没有将会导致编译错误,正如char [1]将被解析为char的数组,char& [1]将被解析为引用的数组,而后者是非法的。将&用圆括号包围则改变了运算符的结合优先序,这将被解析为对char[1]数组的引用。 template<class T>struct does_sometypedef_exists{template<class U>static yes_type check(U, typename U::key_type =0); // #1static no_type check(…);stat ...
阅读全文 »

boost代码分析:signal中的connect过程(下)

发表于 2007-12-13   |   分类于 c++/c++ template/gp/boost
connect 过程中 slot 的连接    template<        typename R,        typename T1, typename T2        ,        typename Combiner,        typename Group,        typename GroupCompare,   ...
阅读全文 »

boost代码分析:signal中的connect过程(上)

发表于 2007-12-13   |   分类于 c++/c++ template/gp/boost
connect 过程中 slot 的创建    template<        typename R,        typename T1, typename T2        ,        typename Combiner,        typename Group,    &n ...
阅读全文 »

boost代码分析:IF Selector

发表于 2007-12-12   |   分类于 c++/c++ template/gp/boost
namespace intimate {    struct SelectThen    {        template<typename Then, typename Else>        struct Result        {            typedef Then type;        };    };    struct SelectElse    {        tem ...
阅读全文 »

boost代码分析:signal中的回调及combiner(最终返回值)

发表于 2007-12-12   |   分类于 c++/c++ template/gp/boost
用 cd boost_1_34_1/boost; cpp -I /home/Administrator/boost_1_34_1 signal.hpp 产生预处理过的代码combiner中要遍历并dereference每个元素,在dereference时用户connect上的函数才真正被调用,因此发生形如下面的sig(5,3)的调用时,实际上调用connect连接的函数的责任落在maximum身上(++和操作)template<typename T>struct maximum{ typedef T result_type; template<typename InputIterator> T operator()(InputIterator first, InputIterator last) const { // If there are no slots to call, just return the // default-constructed value if (first == last) return T() ...
阅读全文 »

【zz】X Forwarding with Putty on Windows

发表于 2007-12-10   |   分类于 Linux App
X Forwarding with Putty on Windows Intro to X ForwardingUnix machines have been able to run software on a remote machine and display the GUI locally for almost two decades. Linux and Mac OS X support X Forwarding with no extra software. Any terminal on Linux should do X Forwarding, Mac users need to run "Applications > Utilities > XTerm". In a command line terminal run "ssh -Y jdoe@compute.example.edu matlab" and you’ ...
阅读全文 »

dlopen

发表于 2007-11-29   |   分类于 gcc/binutils/make/共享库
glibc-2.3.2http://docs.google.com/Doc?id=dnc5d3v_54g68p74Intel平台下Linux中ELF文件动态链接的加载、解析及实例分析(一): 加载http://www.ibm.com/developerworks/cn/linux/l-elf/part1/index.htmlIntel平台下linux中ELF文件动态链接的加载、解析及实例分析(二): 函数解析与卸载http://www.ibm.com/developerworks/cn/linux/l-elf/part2/index.html
阅读全文 »

Call graph: g2v、vco、xvcg/mkinput、mkgraph/mkgraph0.sh、dot/__cyg_profile_func_enter、pvtrace、dot

发表于 2007-11-20   |   分类于 Linux Debug
对于内核的函数调用关系参见:http://tree.celinuxforum.org/CelfPubWiki/KernelFunctionTracehttp://www.csn.ul.ie/~mel/projects/codeviz/ [jfo@Fedora4 debug]$ ls main.c [jfo@Fedora4 debug]$ cat main.c /////////////////////////////////////////////////// //main.c #include <stdio.h> #include <stdlib.h> void f1(int); void f12(int i) {     printf(&qu ...
阅读全文 »

gprof、mkgraph、Graphviz 可视化函数调用

发表于 2007-11-20   |   分类于 Linux Debug
http://oss.lzu.edu.cn/modules/newbb/viewtopic.php?topic_id=884gprof用法gprof -b cflow gmon.out | lesscflowcflow parser.cmkgraph:从gmon.out中提取调用关系,生产.dot文件和graphic文件mkgraph0.sh cflow gmon.outKFT(kernel function trace)http://tree.celinuxforum.org/CelfPubWiki/KernelFunctionTraceCodeViz - A call graph generation utility for C/C++http://www.csn.ul.ie/~mel/projects/codeviz/作者: 姜洪庆 出处:51CTO.com关 键 词:gprof callgraph 函数消耗的时间 Linux应用分析阅读提示:本文介绍了如何使用Gnu gprof 对Linux平台下的现有程序进行优化分析和生成程序调用图。主要偏重于对生成和使用流程图作介绍 ...
阅读全文 »
1…454647…61
jfo

jfo

605 日志
38 分类
4 标签
RSS
GitHub 微博
友情链接
  • 收藏夹
  • 网络剪贴板
  • 爱逛吧
© 2007 - 2018 jfo
由 Hexo 强力驱动
主题 - NexT.Pisces