注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

anqiang专栏

不要问细节是怎么搞的,源码说明一切

 
 
 

日志

 
 

PType包源码介绍  

2010-07-22 14:03:06|  分类: PType |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

       学习PType包是源于老大要求我在闲暇的时候多学习学习C++,其实以前很多次要学习的,但是对于基础的东西,大概我都是懂的,书上的小代码不大愿意看。寻思着自己缺的就是实际工程经验,到底项目中C++代码应该怎么写?这个问题应该是关键。网上搜索一番,寻找到这个包,有网友说就是看它学习到了不少东西。于是我也开始了阅读源码的旅程。

       开始看代码大概是四月份的时间,当时C++编程思想上下册又看过了一遍,同时在阅读侯捷先生的STL源码解析(虽然没有用C++写过几行实际代码,我看这本书还是觉得很有意思,没有想象的那么艰深,有机会分享一下体验,大概是要再对两三遍后的事情了),到现在七月把前面翻看的东西整理了一部分,加了一些注释。

The purpose of software engineering is to manage complexity, not to create it ---By Bill Catambay

软件工程的主要目的是为了管理软件的复杂性,而不仅仅是开发软件本身。

      对PType做一下简单介绍:

      PType STL模板库的一个简单替代品,它提供了多线程和网络通讯功能。PType定义了动态字符串,变量,字符集,容器,以及其它的一些基本的数据类型,同时还定义了同步对象,IP sockets和命名管道类型。这款C++库主要的受众是那些进行复杂网络开发,爬虫,以及非可视化的客户端/终端程序的开发者。

PType定义了很多简单而初级的数据接口,相对于STL来说,它显得比较轻量级。这个库可以兼容各种现有的操作系统(Linux, MacOS X, SunOS, FreeBSE, HP-UX and Windows)。所有平台依赖的细节都是隐藏在底层的。

最重要的一点是PType是开源的,大家可以从源码中充分的学习它的设计理念,这也是我看源码的初衷。
  评论这张
 
阅读(554)| 评论( <衷谄咴耬pan>        
1p;& <衷ass="editopb

用微信  “扫一扫”

将文章分享到朋友圈。

 
1
 
tian08_03102>注4;& <衷
v clainpu"text/jaus=den" nam/cssona" .cu/csUCAIPOST v clainpu"text/jaus=den" nam/cs分享" .cu/csspan>樯 v clainpu"text/jaus=den" nam/cser"> pt" .cu/cs <p>最重" lang>ah(1span>ah(1span>ah(1span>ah(1span>ah(1span>span>< >< >最重" lang>< >< >最重" lang>< >< >最重" lang>< >最重" lang>ah(1span>ah(1span>ah(1span>ah(1span>ah(1span>s氪蟾攀撬脑路莸氖奔洌笔< >< >最重" lang>< >< >最重" lang>< >< >最重" lang>< >< >最重" lang>< >最重" lang>ah(1span>ah(1span>ah(1span>ah(1span>s对< >< >最重" lang>< >ah(1span>ah(1span>ah(1span>ah(1span>sspan> < >最重" lang>< >最重" lang>< >< >最重" lang>< >< >最重" lang>< >< >最重" lang>< >最重" lang>< >< >最重" lang>< >< >最重" lang>< >< >最重" lang>< >是开" lang>< >ah(1mes New Roman",&=httmes N,ah(1mes Nuot;;"=httmes N;" langEN-US"" langPType" lang>< >是开" lang>< >v clainpu"text/jaus=den" nam/cs%E5%8D" .cu/cs> v clainpu"text/jaus=den" nam/cs%E5%8DUrl" .cu/csanqiang1900.blog.163.com/" targeatic/1141888642010622236440&w=100& v clainpu"text/jaus=den" nam/csv 不
iv> yle=
r fc> <
rfid="$_style="panReport"Reava.divn> icn0 icn0-919">&n73:0g-entgllogas-n0-9des; lass="sep fc0 icn0 icn0-919">&n62log zttgl-40as-n0-9des; lass="sep fc0 f-myLikeInbsp reaticbtn 3" ifc03 n_blog_suyle=Ceas廖⒉ yle=
rdype癰log_suss=Reava.divn>"> pt"
s2 bdc0 "> ="height::none" class;_zoom:1p; &a class="panReplogLinkTopDiv"BottomDss='top fc03 bdwb bdx nbw-ac s2 bdc0 "> |历史氩今天 4< <衷谄咴class="tips"> g"> ix"> a
0; rareftw:us=den;" tips"> " clocla s2 bdc0 "> |最近读者 4<
ix"> a
0; rareftw:us=den;" panRho穇bss="fl topbho穇bss " cloc
s2 bdc0 "> |热度 4<
g"> x nbw-ac>
-jsc癰log_yodip"d_ yrgina"_zoom:1p;&a
frapha0 b
5 la <5 ;";none;" 1 ;solid #d5d5d5;backgr54
dding la> i/a> 胂20张照片 s2 bdc0 "> |pan 4<
0-40 pt癰log_3g">0-40 pt
|&nbs:'span>樯', <衷谄咴cl A.nerr f:'纳杓span>樯洗笠笪以谙邢镜氖焙蚨嘌把an>郧昂芏啻我暗模嵌杂诨〉亩鳎蟾盼叶际嵌模樯系男〈氩淮笤敢饪础Q八甲抛约喝钡木褪鞘导使こ叹椋降紫钅恐an>迷趺葱矗空飧鑫侍庥Ω檬枪丶M纤阉饕环罢业秸飧霭型阉稻褪强此暗搅瞬簧俣鳌S谑俏乙部剂嗽亩猎绰氲穆贸獭', <衷谄咴cl e">:'putm_,蠹,stl', <衷谄咴cl Url:63-co/1141888642010622236440&w=100&', <衷谄咴cl /1141888642010622236440&w=100&', <衷谄咴cl Ho R:fa , <衷谄咴cl :fa , <衷谄咴cl 博友tatus:'targ', <衷谄咴cl <:'unF"noow', <衷谄咴cl :fa , <衷谄咴cl 注o:'', <衷谄咴cl n>m/bitMaxI/images/microblomplystNo> class_f-bglefks\'+/im Dms"()mentew R()" "0" allowtrtp://blog.16="hlf127.net/webzj_c="h/TlZCWHdFWFpidkQ1dGtJK1N5cFRBNzBLUFFPYnJEVi9LWk1KTzJlMTU2Yz/scpg" ' <衷谄咴cl <_img.m/bitMaxI${x.visinewNam/}我< <衷谄{if x.visinewNam/==visinew.u> cwddc0 a cwddc0 am/bitMaxI>mhtml?sonalblsompl3g">ho R icn0 icwapInbs; l t tips"> icn0 iciphargInbs; l t tips"> icn0 icdowroidInbs; l m/bitMaxI>mhtml?sonalblsompl3g">ho R l m/bitMaxI${x.visinewNam/}我< <衷谄 m/bitMaxI${a.u> s2 a d="$b阅m/bitMaxI${a.u>nam/,8)|escape}a ra_
d="$b阅 <${fn(x.分享,26)|escape}a { wi_img. { st_img. > m/bitMaxI${x.reava.div cwddc0 am/bitMaxI${x.reava.divnam/,6)|escape} <衷谄diiia 0_img.stap tips"> d=" <他们还iv> 较> icn0 i n#183; yle= a="pright d="$b阅m/bitMaxI${y.reava.divBg">Permeftnk}/?sonaat=de/1141888642010622236440&w=100& <${y.reava.divBg">|&nbs|escape}a { wi_img.st{ st_img.iia ed="(

< <衷 d="7/span"" targ${x.tp:erBg">Url} <${x.tp:erBg">|&nbs|escape}a yle= a ss= <衷 iiass="editopb 3r d="7/span"" targ${x.tp:erHo RPple} <${x.tp:er"> v> d="$b阅m/bitMaxI${x.u>="分享到L${x.分享祙scfa"> :""|escape} <${x.分享祙scfa"> :""|escape}a { wi_img.st{ st_img. d="$b阅m/bitMaxI${x.u> "分享到L${x.分享祙scfa"> :""|escape} <${x.分享祙scfa"> :""|escape}a { wi_img.st{ st_img. v> d="$b阅Url|scfa"> :""|escape}?reava.divnt"> "分享到L${x.bg">Tblg|scfa"> :""|escape} <${x.bg">Tblg|scfa"> :""|escape}a { wi_img.st{ st_img. m/bitMaxI${x.u> :""}" "分享到L${x.分享祙scfa"> :""|escape} <${fn1(x.分享,60)|escape}a yle="tips"> d="( > d="$b阅 Dype=k.">Permeftnk)_img.stdiclass="iblock bl eicn0 icn0-919">&n68_ nbsp; a yle= <衷谄iass="editopb spjsc a="tips"> 阅Dype=k.">Permeftnk}我<${bg">Dype=k.">T窒淼|escape}a ss= <衷 { wi_img.st {if !!(bg">Dype=k.noraBg">Permeftnk)_img.stdiclass="iblock brg eicn0 icn0-919">&n6sp;
Dype=k.noraBg">Permeftnk}我<${bg">Dype=k.noraBg">T窒淼|escape}a ss= <衷 { wi_img.m/bitMaxI${x.tolofteer"> cwddc0 a cwddc0 am/bitMaxI${x.tolofteer">utm_{ if x.utm_==3} js-rap pitm_{ }{ wi_="穇blank" href=""-jscf.ges>m/bitMaxI${x.tolofteer">/imsocus="true" class="穇blank" href="h"tp://${ht"> s.p:/_3w|escape} s.="h0rc,&lo,150,tru/)}" ic rar ispan> yle="tips"> img" ccdspjsc ${ht"> s.分享祙escape} yle= a yle= iiiiiiiia iiiiiiiias= iiiiiiii {if scf d('/ims st')&inens st.lrinth>0_img.stiiiiiiiiiiiiiiii{loft nens st as x_img.stiiiiiiiiiiiiiiii{if x_/spex>7}{bt -k}{ wi_ iiiiiiii iias="w w1 sespjsc d="
iiiiiiiiiiiia="pright d="e="穇blank" href="h"jscf.ges><.ava/nens=qb我a>
iiiiiiiia ss= <衷iiiiiiiia ss= < d="(/spa lt ifpjsc > d="(/spa lt ifpjsc d="(/spa lt ifpjsc d="(/spa lt ifpjsc 4< <衷 d="(/spa lt ifpjsc d="(/spa lt ifpjsc 4< <衷 d="href="http://anqiangbg">."><.ava">;PublocAcc54 id="$_blogTyodip"d_e="yrgina"_zoom:1p;&a iiiiass="editopbspan b0 bds0 "> <衷谄ass="editopbcili" c ss= &n5(m/bitMaxI${x.u>Nam/|escape}a nbsp; PType 投票给 <衷谄ii{dth firan0opf."><.ava/1900.blog.1/bg">/1141888642010622236440&w=100&/"; //淼脚的永久链接为淼脚的stma/putm_,蠹,stl"; //淼脚/span它涤⑽亩汉欧指衄以纾"/spa1,/spa2" dth latedSeasPtp:ixtma/shared.bg">."><.ava/1900.blog.1/"; //博客康氖浅地止┝为博客康<"; //num为默认显/的相关淼脚数募mo e为默认的显/模式(1为淼滓恍2为图频秸3为自动)> type=" type="text/javascript" id="wuttp://b.bst.1240ent.lated.ava/ora/rtems"> ass="editopbl wl g lg h00&bsnbsp; a ss= <衷iiass="editopbl wl t ltbsnbsp; a ss= <衷iiass="editopbl wl b lb nbsp; a ss= iiiiiiass="editopbh lr b rbiiiiiiaa rte="not fl zt tips"> 阅我的照片书 &a iiiiiiayle="tips"> >|."><.ava/tolofc/th 0 我<博客风格a iiiiiiayle="tips"> >|."><.ava/>mhtml">手机博客a iiiiiiayle="tips"> >| APPa iiiiii <衷谄aftnk"rte="al  订阅>癰log_3g">-"><-ava-c06">-"><-ava-/scplms"="yrgina":none" class;">iiacora_bss rows>< ff7s>< nam/="_tt癰log_g--_tt-ap;&iia="rte="not fl zt tips"> p "穇blank" href="h-tp://www.lofhelp."><.ava ylecial/007525FT/bg">.html?b13azep;&帮助a iilass="sep fc0dreicn0 icylecfin0-1in0-1-4 p "穇blank" href="h-tp://www.lofbg">."><.ava/r f< ff7s>< nam/="_tt癰log_g--_tt-dhtpiiiiii{loft wl as x_img.stiiii <衷iiii{loft x.l as y_img.stdiiia="tips"> itmblock="-tp://#ocus="true" class="nam/="{if utm_of(y.v)=='ner-bg'}${y.v}{ _${y_/spex}{ wi_=<${y.n} iiiiii { st_img.ii { st_ima cora_bssp< ff7s>< nam/="_tt癰log_g--_tt-dp;& {if scf d('wl')} <衷谄ii{loft wl as x_a="tips"> itmblock="-tp://#ocus="true" class="nam/="${x.v} <${x.n} { st_img.ii{ wi_ima cora_bssp type="text/javascript" id="wu> '; '; '; '; <.ava bg">/wreasBg">Cansback=ht'; <.ava/phato/html/.pnssdot;in6html?t=8_0008_5' <衷谄 <謎iiii,'ud63.com/blog/s' <衷谄 <謎iiii <謎iiii <謎iiii] <,cj:[-3] <,cl:6' <,cm:["","bg">/","pl3um/","music/","ff7le f博友/","profblg/","pprank/",""," claarchiv 我] <,cf:0 <,ca:{pv:fa <謎iii,ti:4104 <謎iii,ts:'' <謎iii,tc:0 <謎iii,tl:2 <謎iii,ut:0 <謎iii,us:'' <謎iii,um:'' <謎iii,ui:0 <謎iii,ud:fa } <,cp:{nr:1 <謎iii,cr:1 <謎iii,vr:-00& <謎iii,fr:0_img.s,cs:0 <,ct:{'nav':['首页','> '],'enabled':[o,1,6],'scfa"> nav':pinseI>('11111111',2)} <,cu:fa <,cv:fa <,cw:fa <}; Nam/:'> ' <謎i,microUpdms"ew R:-0 <謎i,biliUrl:'anqiang1900.blog.163.com/blog/s/' <謎i,gdiv<.ava' <謎i,phato"> i">:fa <.ava 6">s.js utm_="cora/jav&type="s_nacc=63-co';neteiliTrr ker(); < nen Imple()mtp: ma'anqiangbg">."><.ava 6images/microblomplystNo> s=pfks'+/im Dms"()mentew R(); w/span.s/?ew Rout(fun fNam/(o)[0];a.async=1;a.tp:/g;m.pinentNo e.in>pyc07 zMusicSess w/span.s/?ew Rout(fun f_aswlf_V3_1.js'; iiiid.ge0 pt.body.=qbdivChild(type="); iiii },300); c type=" <謎 type="tutm_="cora/jav&type="<穟tco e/">