Web Analytics

APR源代码分析-设计篇

作为一个可移植的运行时环境,APR的设计当然是很精妙的,但精妙的同时对使用者有一些限制。 APR附带一个简短的设计文档,文字言简意赅,其中很多的设计思想都值得我们所借鉴,主要从三个方面谈。 1、类型 1) APR提供并建议用户使用APR自定义的数据类型,好处很多,比如便于代码移植,避免数据间进行不必要的类型转换(如果你不使用APR自定义的数据类型,你在使用某些APR提供的接口时,就需要进行一些参数的类型转换);自定义数据类型的名字更加具有自描述性,提高代码可读性。APR提供的基本自定义数据类型包括: typedef unsigned char apr_byte_t; typedef short apr_int16_t; typedef unsigned short apr_uint16_t; typedef int apr_int32_t; typedef unsigned int apr_uint32_t; typedef long long apr_int64_t; typedef unsigned long long apr_uint64_t; 这些都是在apr.h中定义的,而apr.h在UNIX平台是通过configure程序生成的,在不同平台APR自定义类型的实际类型是完全有可能不一致的。 ...

August 30, 2005 · 5 min · Tony Bai

APR源代码分析-整体篇

由于部门所使用的底层库与Apache Server有着“一定的渊源”,所以总有一种想看看Apache的实现的冲动。最近项目收尾,愿望终可实现。 一、何为APR? Apache Server经过这么多年的发展后,将一些通用的运行时接口封装起来提供给大家,这就是Apache Portable Run-time libraries, APR。 ...

August 25, 2005 · 3 min · Tony Bai

CppUnit入门实践-Tony与Alex的对话系列

Tony : Hi Alex ! you just looks like drowing in your project. what is up? Alex : 我们的项目要求引入单元测试,but i’ve no experience in unit test. Tony : i think cppunit is your best choice. Alex : 是的,我刚从网上把它down了下来,正准备研究它呢。 Tony : Really ? I have done some practice on unit test before. would you like me to join you? Alex : Oh Tony, I’m so glad that you could help me ! Tony : My pleasue ! Alex : 我们从哪里开始呢? Tony : The simplest case! 我们拿一个最简单的例子吧。now we have a class with the name “SimpleCalculator” and it has four basic methods ‘add’, ‘sub’, ‘mul’ and ‘div’, All we should do is to test whether these methods run as same as we expect. First of all , complete the “SimpleCalculator” class, Alex. Alex : It is simple! ...

May 30, 2005 · 4 min · Tony Bai

看完“程序员”2005-04期一些想法

每次看完《程序员》杂志都会有些新的收获,这次看的是《程序员》2005年第4期,顺便把一些阅读过程中产生的想法记录了下来。 [软件建模,大势所趋] 看完微软、IBM、Borland等公司的最新动态,感觉软件建模是大势所趋,以前虽然也有众多建模工具,但是由工具支持得不好,建模的各个阶段彼此脱节,使用户体验(user experience)很差。随着Microsoft VSTS(Visual Studio Team System)的发布在即、随着Borland的ALM(Application Lifecycle Management )工具及基于Eclipse的产品计划的实施,相信在不久的将来软件建模会有一个很大的改观。 ...

April 20, 2005 · 4 min · Tony Bai

Boost_1_32_0版源代码编译

著名的C++准标准库boost在2004年末发布了1.32.0版本,作为C++的忠实Fans怎能“袖手旁观”,趁闲暇时download it and build it。[注]:由于没有公司Unix服务器的管理员权限,所以只能在自己的Windows平台上编译了。 ...

January 28, 2005 · 3 min · Tony Bai