锘??xml version="1.0" encoding="utf-8" standalone="yes"?>一区二区三区在线看,国产精品入口66mio,99精品国产在热久久http://m.shnenglu.com/sunicdavy/category/12572.html璁ㄨ緹?309800774 鐭ヤ箮鍏蟲敞:http://zhihu.com/people/sunicdavy 寮婧愰」鐩?https://github.com/davyxuzh-cnMon, 27 Dec 2021 16:42:06 GMTMon, 27 Dec 2021 16:42:06 GMT60鍙傛暟Component閫氳繃Entity浼犻掑埌System澶勭悊http://m.shnenglu.com/sunicdavy/archive/2021/12/27/217894.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Mon, 27 Dec 2021 11:04:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2021/12/27/217894.htmlhttp://m.shnenglu.com/sunicdavy/comments/217894.htmlhttp://m.shnenglu.com/sunicdavy/archive/2021/12/27/217894.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/217894.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/217894.html http://zhidao.baixing.com/question/11522863.html

http://zhidao.baixing.com/question/11522867.html

http://zhidao.baixing.com/question/11522873.html

http://zhidao.baixing.com/question/11522877.html

http://zhidao.baixing.com/question/11522881.html

http://zhidao.baixing.com/question/11522889.html

http://zhidao.baixing.com/question/11522891.html

http://zhidao.baixing.com/question/11522896.html

http://zhidao.baixing.com/question/11522897.html

http://zhidao.baixing.com/question/11522899.html

http://zhidao.baixing.com/question/11522901.html

http://zhidao.baixing.com/question/11522904.html

http://zhidao.baixing.com/question/11522910.html

http://zhidao.baixing.com/question/11522911.html

http://zhidao.baixing.com/question/11522912.html

http://zhidao.baixing.com/question/11522913.html

http://zhidao.baixing.com/question/11522916.html

http://zhidao.baixing.com/question/11522917.html

http://zhidao.baixing.com/question/11522923.html

http://zhidao.baixing.com/question/11522925.html

http://zhidao.baixing.com/question/11522931.html

http://zhidao.baixing.com/question/11522935.html

http://zhidao.baixing.com/question/11522936.html

http://zhidao.baixing.com/question/11522942.html

http://zhidao.baixing.com/question/11522945.html

http://zhidao.baixing.com/question/11522949.html

http://zhidao.baixing.com/question/11522952.html

http://zhidao.baixing.com/question/11522957.html

http://zhidao.baixing.com/question/11522962.html

http://zhidao.baixing.com/question/11522966.html

http://zhidao.baixing.com/question/11522968.html

http://zhidao.baixing.com/question/11522969.html

http://zhidao.baixing.com/question/11522971.html

http://zhidao.baixing.com/question/11522972.html

http://zhidao.baixing.com/question/11522976.html

http://zhidao.baixing.com/question/11522977.html

http://zhidao.baixing.com/question/11522979.html

http://zhidao.baixing.com/question/11522981.html

http://zhidao.baixing.com/question/11522982.html

http://zhidao.baixing.com/question/11522986.html

http://zhidao.baixing.com/question/11522990.html

http://zhidao.baixing.com/question/11522991.html

http://zhidao.baixing.com/question/11522993.html

http://zhidao.baixing.com/question/11522994.html

http://zhidao.baixing.com/question/11522999.html

http://zhidao.baixing.com/question/11523001.html

http://zhidao.baixing.com/question/11523002.html

http://zhidao.baixing.com/question/11523008.html

http://zhidao.baixing.com/question/11523011.html

http://zhidao.baixing.com/question/11523014.html

http://zhidao.baixing.com/question/11523017.html

http://zhidao.baixing.com/question/11523020.html

http://zhidao.baixing.com/question/11523023.html

http://zhidao.baixing.com/question/11523025.html

http://zhidao.baixing.com/question/11523028.html

http://zhidao.baixing.com/question/11523029.html

http://zhidao.baixing.com/question/11523035.html

http://zhidao.baixing.com/question/11523038.html

http://zhidao.baixing.com/question/11523042.html

http://zhidao.baixing.com/question/11523044.html

http://zhidao.baixing.com/question/11523045.html

http://zhidao.baixing.com/question/11523047.html

http://zhidao.baixing.com/question/11523049.html

http://zhidao.baixing.com/question/11523061.html

http://zhidao.baixing.com/question/11523063.html

http://zhidao.baixing.com/question/11523065.html

http://zhidao.baixing.com/question/11523066.html

http://zhidao.baixing.com/question/11523068.html

http://zhidao.baixing.com/question/11523076.html

http://zhidao.baixing.com/question/11523077.html

http://zhidao.baixing.com/question/11523082.html

http://zhidao.baixing.com/question/11523085.html

http://zhidao.baixing.com/question/11523086.html

http://zhidao.baixing.com/question/11523088.html

http://zhidao.baixing.com/question/11523093.html

http://zhidao.baixing.com/question/11523097.html

http://zhidao.baixing.com/question/11523098.html

http://zhidao.baixing.com/question/11523100.html

http://zhidao.baixing.com/question/11523102.html

http://zhidao.baixing.com/question/11523106.html

http://zhidao.baixing.com/question/11523109.html

http://zhidao.baixing.com/question/11523111.html

http://zhidao.baixing.com/question/11523113.html

http://zhidao.baixing.com/question/11523115.html

http://zhidao.baixing.com/question/11523116.html

http://zhidao.baixing.com/question/11523119.html

http://zhidao.baixing.com/question/11523121.html

http://zhidao.baixing.com/question/11523123.html

http://zhidao.baixing.com/question/11523125.html

http://zhidao.baixing.com/question/11523127.html

http://zhidao.baixing.com/question/11523132.html

http://zhidao.baixing.com/question/11523134.html

http://zhidao.baixing.com/question/11523136.html

http://zhidao.baixing.com/question/11523137.html

http://zhidao.baixing.com/question/11523139.html

http://zhidao.baixing.com/question/11523144.html

http://zhidao.baixing.com/question/11523147.html

http://zhidao.baixing.com/question/11523150.html

http://zhidao.baixing.com/question/11523151.html

http://zhidao.baixing.com/question/11523153.html

http://zhidao.baixing.com/question/11523155.html

http://zhidao.baixing.com/question/11523156.html

http://zhidao.baixing.com/question/11523159.html

http://zhidao.baixing.com/question/11523161.html

http://zhidao.baixing.com/question/11523164.html

http://zhidao.baixing.com/question/11523165.html

http://zhidao.baixing.com/question/11523168.html

http://zhidao.baixing.com/question/11523170.html

http://zhidao.baixing.com/question/11523171.html

http://zhidao.baixing.com/question/11523172.html

http://zhidao.baixing.com/question/11523173.html

http://zhidao.baixing.com/question/11523182.html

http://zhidao.baixing.com/question/11523184.html

http://zhidao.baixing.com/question/11523186.html

http://zhidao.baixing.com/question/11523188.html

http://zhidao.baixing.com/question/11523190.html

http://zhidao.baixing.com/question/11523196.html

http://zhidao.baixing.com/question/11523201.html

http://zhidao.baixing.com/question/11523203.html

http://zhidao.baixing.com/question/11523204.html

http://zhidao.baixing.com/question/11523206.html

http://zhidao.baixing.com/question/11523207.html

http://zhidao.baixing.com/question/11523213.html

http://zhidao.baixing.com/question/11523217.html

http://zhidao.baixing.com/question/11523220.html

http://zhidao.baixing.com/question/11523223.html

http://zhidao.baixing.com/question/11523225.html

http://zhidao.baixing.com/question/11523228.html

http://zhidao.baixing.com/question/11523230.html

http://zhidao.baixing.com/question/11523232.html

http://zhidao.baixing.com/question/11523234.html

http://zhidao.baixing.com/question/11523235.html

http://zhidao.baixing.com/question/11523237.html

http://zhidao.baixing.com/question/11523240.html

http://zhidao.baixing.com/question/11523242.html

http://zhidao.baixing.com/question/11523245.html

http://zhidao.baixing.com/question/11523248.html

http://zhidao.baixing.com/question/11523251.html

http://zhidao.baixing.com/question/11523254.html

http://zhidao.baixing.com/question/11523258.html

http://zhidao.baixing.com/question/11523262.html

http://zhidao.baixing.com/question/11523267.html

http://zhidao.baixing.com/question/11523268.html

http://zhidao.baixing.com/question/11523272.html

http://zhidao.baixing.com/question/11523277.html

http://zhidao.baixing.com/question/11523280.html

http://zhidao.baixing.com/question/11523281.html

http://zhidao.baixing.com/question/11523282.html

http://zhidao.baixing.com/question/11523287.html

http://zhidao.baixing.com/question/11523292.html

http://zhidao.baixing.com/question/11523298.html

http://zhidao.baixing.com/question/11523299.html

http://zhidao.baixing.com/question/11523301.html

http://zhidao.baixing.com/question/11523304.html

http://zhidao.baixing.com/question/11523305.html

http://zhidao.baixing.com/question/11523310.html

http://zhidao.baixing.com/question/11523312.html

http://zhidao.baixing.com/question/11523316.html

http://zhidao.baixing.com/question/11523320.html

http://zhidao.baixing.com/question/11523323.html

http://zhidao.baixing.com/question/11523325.html

http://zhidao.baixing.com/question/11523328.html

http://zhidao.baixing.com/question/11523330.html

http://zhidao.baixing.com/question/11523333.html

http://zhidao.baixing.com/question/11523337.html

http://zhidao.baixing.com/question/11523341.html

http://zhidao.baixing.com/question/11523345.html

http://zhidao.baixing.com/question/11523351.html

http://zhidao.baixing.com/question/11523355.html

http://zhidao.baixing.com/question/11523358.html

http://zhidao.baixing.com/question/11523360.html

http://zhidao.baixing.com/question/11523363.html

http://zhidao.baixing.com/question/11523367.html

http://zhidao.baixing.com/question/11523371.html

http://zhidao.baixing.com/question/11523375.html

http://zhidao.baixing.com/question/11523378.html

http://zhidao.baixing.com/question/11523380.html

http://zhidao.baixing.com/question/11523383.html

http://zhidao.baixing.com/question/11523386.html

http://zhidao.baixing.com/question/11523389.html

http://zhidao.baixing.com/question/11523394.html

http://zhidao.baixing.com/question/11523396.html

http://zhidao.baixing.com/question/11523399.html

http://zhidao.baixing.com/question/11523400.html

http://zhidao.baixing.com/question/11523404.html

http://zhidao.baixing.com/question/11523406.html

http://zhidao.baixing.com/question/11523412.html

http://zhidao.baixing.com/question/11523418.html

http://zhidao.baixing.com/question/11523422.html

http://zhidao.baixing.com/question/11523425.html

http://zhidao.baixing.com/question/11523428.html

http://zhidao.baixing.com/question/11523430.html

http://zhidao.baixing.com/question/11523432.html

http://zhidao.baixing.com/question/11523437.html

http://zhidao.baixing.com/question/11523441.html

http://zhidao.baixing.com/question/11523445.html

http://zhidao.baixing.com/question/11523446.html

http://zhidao.baixing.com/question/11523449.html

http://zhidao.baixing.com/question/11523452.html

http://zhidao.baixing.com/question/11523454.html

http://zhidao.baixing.com/question/11523460.html

http://zhidao.baixing.com/question/11523461.html

http://zhidao.baixing.com/question/11523468.html

http://zhidao.baixing.com/question/11523472.html

http://zhidao.baixing.com/question/11523475.html

http://zhidao.baixing.com/question/11523478.html

http://zhidao.baixing.com/question/11523481.html

http://zhidao.baixing.com/question/11523482.html

http://zhidao.baixing.com/question/11523485.html

http://zhidao.baixing.com/question/11523487.html

http://zhidao.baixing.com/question/11523492.html

http://zhidao.baixing.com/question/11523494.html

http://zhidao.baixing.com/question/11523500.html

http://zhidao.baixing.com/question/11523501.html

http://zhidao.baixing.com/question/11523502.html

http://zhidao.baixing.com/question/11523506.html

http://zhidao.baixing.com/question/11523509.html

http://zhidao.baixing.com/question/11523516.html

http://zhidao.baixing.com/question/11523521.html

http://zhidao.baixing.com/question/11523525.html

http://zhidao.baixing.com/question/11523530.html

http://zhidao.baixing.com/question/11523533.html

http://zhidao.baixing.com/question/11523534.html

http://zhidao.baixing.com/question/11523537.html

http://zhidao.baixing.com/question/11523539.html

http://zhidao.baixing.com/question/11523541.html

http://zhidao.baixing.com/question/11523543.html

http://zhidao.baixing.com/question/11523547.html

http://zhidao.baixing.com/question/11523550.html

http://zhidao.baixing.com/question/11523551.html

http://zhidao.baixing.com/question/11523554.html

http://zhidao.baixing.com/question/11523555.html

http://zhidao.baixing.com/question/11523561.html

http://zhidao.baixing.com/question/11523565.html

http://zhidao.baixing.com/question/11523572.html

http://zhidao.baixing.com/question/11523574.html

http://zhidao.baixing.com/question/11523580.html

http://zhidao.baixing.com/question/11523581.html

http://zhidao.baixing.com/question/11523583.html

http://zhidao.baixing.com/question/11523584.html

http://zhidao.baixing.com/question/11523592.html

http://zhidao.baixing.com/question/11523596.html

http://zhidao.baixing.com/question/11523599.html

http://zhidao.baixing.com/question/11523601.html

http://zhidao.baixing.com/question/11523605.html

http://zhidao.baixing.com/question/11523607.html

http://zhidao.baixing.com/question/11523613.html

http://zhidao.baixing.com/question/11523614.html

http://zhidao.baixing.com/question/11523616.html

http://zhidao.baixing.com/question/11523617.html

http://zhidao.baixing.com/question/11523620.html

http://zhidao.baixing.com/question/11523622.html

http://zhidao.baixing.com/question/11523623.html

http://zhidao.baixing.com/question/11523624.html

http://zhidao.baixing.com/question/11523625.html

http://zhidao.baixing.com/question/11523630.html

http://zhidao.baixing.com/question/11523633.html

http://zhidao.baixing.com/question/11523637.html

http://zhidao.baixing.com/question/11523638.html

http://zhidao.baixing.com/question/11523640.html

http://zhidao.baixing.com/question/11523641.html

http://zhidao.baixing.com/question/11523642.html

http://zhidao.baixing.com/question/11523643.html

http://zhidao.baixing.com/question/11523646.html

http://zhidao.baixing.com/question/11523648.html

http://zhidao.baixing.com/question/11523651.html

http://zhidao.baixing.com/question/11523653.html

http://zhidao.baixing.com/question/11523655.html

http://zhidao.baixing.com/question/11523656.html

http://zhidao.baixing.com/question/11523657.html

http://zhidao.baixing.com/question/11523660.html

http://zhidao.baixing.com/question/11523661.html

http://zhidao.baixing.com/question/11523665.html

http://zhidao.baixing.com/question/11523666.html

http://zhidao.baixing.com/question/11523669.html

http://zhidao.baixing.com/question/11523670.html

http://zhidao.baixing.com/question/11523673.html

http://zhidao.baixing.com/question/11523676.html

http://zhidao.baixing.com/question/11523678.html

http://zhidao.baixing.com/question/11523680.html

http://zhidao.baixing.com/question/11523685.html

http://zhidao.baixing.com/question/11523689.html

http://zhidao.baixing.com/question/11523693.html

http://zhidao.baixing.com/question/11523697.html

http://zhidao.baixing.com/question/11523700.html

http://zhidao.baixing.com/question/11523707.html

http://zhidao.baixing.com/question/11523711.html

http://zhidao.baixing.com/question/11523716.html

http://zhidao.baixing.com/question/11523719.html

http://zhidao.baixing.com/question/11523722.html

http://zhidao.baixing.com/question/11523724.html

http://zhidao.baixing.com/question/11523726.html

http://zhidao.baixing.com/question/11523728.html

http://zhidao.baixing.com/question/11523729.html

http://zhidao.baixing.com/question/11523736.html

http://zhidao.baixing.com/question/11523740.html

http://zhidao.baixing.com/question/11523742.html

http://zhidao.baixing.com/question/11523744.html

http://zhidao.baixing.com/question/11523746.html

http://zhidao.baixing.com/question/11523748.html

http://zhidao.baixing.com/question/11523753.html

http://zhidao.baixing.com/question/11523756.html

http://zhidao.baixing.com/question/11523757.html

http://zhidao.baixing.com/question/11523758.html

http://zhidao.baixing.com/question/11523759.html

http://zhidao.baixing.com/question/11523761.html

http://zhidao.baixing.com/question/11523763.html

http://zhidao.baixing.com/question/11523765.html

http://zhidao.baixing.com/question/11523767.html

http://zhidao.baixing.com/question/11523770.html

http://zhidao.baixing.com/question/11523772.html

http://zhidao.baixing.com/question/11523778.html

http://zhidao.baixing.com/question/11523779.html

http://zhidao.baixing.com/question/11523780.html

http://zhidao.baixing.com/question/11523783.html

http://zhidao.baixing.com/question/11523787.html

http://zhidao.baixing.com/question/11523791.html

http://zhidao.baixing.com/question/11523792.html

http://zhidao.baixing.com/question/11523794.html

http://zhidao.baixing.com/question/11523795.html

http://zhidao.baixing.com/question/11523796.html

http://zhidao.baixing.com/question/11523798.html

http://zhidao.baixing.com/question/11523802.html

http://zhidao.baixing.com/question/11523804.html

http://zhidao.baixing.com/question/11523805.html

http://zhidao.baixing.com/question/11523807.html

http://zhidao.baixing.com/question/11523812.html

http://zhidao.baixing.com/question/11523816.html

http://zhidao.baixing.com/question/11523819.html

http://zhidao.baixing.com/question/11523820.html

http://zhidao.baixing.com/question/11523822.html

http://zhidao.baixing.com/question/11523825.html

http://zhidao.baixing.com/question/11523826.html

http://zhidao.baixing.com/question/11523828.html

http://zhidao.baixing.com/question/11523830.html

http://zhidao.baixing.com/question/11523832.html

http://zhidao.baixing.com/question/11523834.html

http://zhidao.baixing.com/question/11523835.html

http://zhidao.baixing.com/question/11523839.html

http://zhidao.baixing.com/question/11523841.html

http://zhidao.baixing.com/question/11523845.html

http://zhidao.baixing.com/question/11523848.html

http://zhidao.baixing.com/question/11523849.html

http://zhidao.baixing.com/question/11523850.html

http://zhidao.baixing.com/question/11523851.html

http://zhidao.baixing.com/question/11523859.html

http://zhidao.baixing.com/question/11523861.html

http://zhidao.baixing.com/question/11523863.html

http://zhidao.baixing.com/question/11523864.html

http://zhidao.baixing.com/question/11523865.html

http://zhidao.baixing.com/question/11523867.html

http://zhidao.baixing.com/question/11523869.html

http://zhidao.baixing.com/question/11523874.html

http://zhidao.baixing.com/question/11523879.html

http://zhidao.baixing.com/question/11523884.html

http://zhidao.baixing.com/question/11523885.html

http://zhidao.baixing.com/question/11523887.html

http://zhidao.baixing.com/question/11523889.html

http://zhidao.baixing.com/question/11523891.html

http://zhidao.baixing.com/question/11523894.html

http://zhidao.baixing.com/question/11523895.html

http://zhidao.baixing.com/question/11523897.html

http://zhidao.baixing.com/question/11523899.html

http://zhidao.baixing.com/question/11523900.html

http://zhidao.baixing.com/question/11523905.html

http://zhidao.baixing.com/question/11523907.html

http://zhidao.baixing.com/question/11523911.html

http://zhidao.baixing.com/question/11523917.html

http://zhidao.baixing.com/question/11523919.html

http://zhidao.baixing.com/question/11523922.html

http://zhidao.baixing.com/question/11523923.html

http://zhidao.baixing.com/question/11523925.html

http://zhidao.baixing.com/question/11523928.html

http://zhidao.baixing.com/question/11523931.html

http://zhidao.baixing.com/question/11523932.html

http://zhidao.baixing.com/question/11523935.html

http://zhidao.baixing.com/question/11523939.html

http://zhidao.baixing.com/question/11523942.html

http://zhidao.baixing.com/question/11523945.html

http://zhidao.baixing.com/question/11523947.html

http://zhidao.baixing.com/question/11523948.html

http://zhidao.baixing.com/question/11523950.html

http://zhidao.baixing.com/question/11523958.html

http://zhidao.baixing.com/question/11523965.html

http://zhidao.baixing.com/question/11523970.html

http://zhidao.baixing.com/question/11523975.html

http://zhidao.baixing.com/question/11523977.html

http://zhidao.baixing.com/question/11523979.html

http://zhidao.baixing.com/question/11523980.html

http://zhidao.baixing.com/question/11523982.html

http://zhidao.baixing.com/question/11523988.html

http://zhidao.baixing.com/question/11523993.html

http://zhidao.baixing.com/question/11523997.html

http://zhidao.baixing.com/question/11523998.html

http://zhidao.baixing.com/question/11524005.html

http://zhidao.baixing.com/question/11524008.html

http://zhidao.baixing.com/question/11524009.html

http://zhidao.baixing.com/question/11524017.html

http://zhidao.baixing.com/question/11524023.html

http://zhidao.baixing.com/question/11524025.html

http://zhidao.baixing.com/question/11524029.html

http://zhidao.baixing.com/question/11524031.html

http://zhidao.baixing.com/question/11524032.html

http://zhidao.baixing.com/question/11524033.html

http://zhidao.baixing.com/question/11524035.html

http://zhidao.baixing.com/question/11524040.html

http://zhidao.baixing.com/question/11524045.html

http://zhidao.baixing.com/question/11524048.html

http://zhidao.baixing.com/question/11524053.html

http://zhidao.baixing.com/question/11524055.html

http://zhidao.baixing.com/question/11524059.html

http://zhidao.baixing.com/question/11524063.html

http://zhidao.baixing.com/question/11524065.html

http://zhidao.baixing.com/question/11524067.html

http://zhidao.baixing.com/question/11524069.html

http://zhidao.baixing.com/question/11524071.html

http://zhidao.baixing.com/question/11524077.html

http://zhidao.baixing.com/question/11524082.html

http://zhidao.baixing.com/question/11524084.html

http://zhidao.baixing.com/question/11524087.html

http://zhidao.baixing.com/question/11524088.html

http://zhidao.baixing.com/question/11524089.html

http://zhidao.baixing.com/question/11524092.html

http://zhidao.baixing.com/question/11524094.html

http://zhidao.baixing.com/question/11524097.html

http://zhidao.baixing.com/question/11524098.html

http://zhidao.baixing.com/question/11524099.html

http://zhidao.baixing.com/question/11524100.html

http://zhidao.baixing.com/question/11524104.html

http://zhidao.baixing.com/question/11524106.html

http://zhidao.baixing.com/question/11524113.html

http://zhidao.baixing.com/question/11524114.html

http://zhidao.baixing.com/question/11524115.html

http://zhidao.baixing.com/question/11524118.html

http://zhidao.baixing.com/question/11524121.html

http://zhidao.baixing.com/question/11524131.html

http://zhidao.baixing.com/question/11524133.html

http://zhidao.baixing.com/question/11524136.html

http://zhidao.baixing.com/question/11524137.html

http://zhidao.baixing.com/question/11524139.html

http://zhidao.baixing.com/question/11524141.html

http://zhidao.baixing.com/question/11524142.html

http://zhidao.baixing.com/question/11524144.html

http://zhidao.baixing.com/question/11524149.html

http://zhidao.baixing.com/question/11524151.html

http://zhidao.baixing.com/question/11524156.html

http://zhidao.baixing.com/question/11524159.html

http://zhidao.baixing.com/question/11524160.html

http://zhidao.baixing.com/question/11524162.html

http://zhidao.baixing.com/question/11524163.html

http://zhidao.baixing.com/question/11524165.html

http://zhidao.baixing.com/question/11524169.html

http://zhidao.baixing.com/question/11524172.html

http://zhidao.baixing.com/question/11524177.html

http://zhidao.baixing.com/question/11524179.html

http://zhidao.baixing.com/question/11524183.html

http://zhidao.baixing.com/question/11524186.html

http://zhidao.baixing.com/question/11524188.html

http://zhidao.baixing.com/question/11524189.html

http://zhidao.baixing.com/question/11524193.html

http://zhidao.baixing.com/question/11524195.html

http://zhidao.baixing.com/question/11524196.html

http://zhidao.baixing.com/question/11524197.html

http://zhidao.baixing.com/question/11524199.html

http://zhidao.baixing.com/question/11524200.html

http://zhidao.baixing.com/question/11524204.html

http://zhidao.baixing.com/question/11524206.html

http://zhidao.baixing.com/question/11524208.html

http://zhidao.baixing.com/question/11524210.html

http://zhidao.baixing.com/question/11524211.html

http://zhidao.baixing.com/question/11524213.html

http://zhidao.baixing.com/question/11524216.html

http://zhidao.baixing.com/question/11524217.html

http://zhidao.baixing.com/question/11524218.html

http://zhidao.baixing.com/question/11524220.html

http://zhidao.baixing.com/question/11524221.html

http://zhidao.baixing.com/question/11524222.html

http://zhidao.baixing.com/question/11524224.html

http://zhidao.baixing.com/question/11524227.html

http://zhidao.baixing.com/question/11524228.html

http://zhidao.baixing.com/question/11524229.html

http://zhidao.baixing.com/question/11524230.html

http://zhidao.baixing.com/question/11524231.html

http://zhidao.baixing.com/question/11524233.html

http://zhidao.baixing.com/question/11524235.html

http://zhidao.baixing.com/question/11524238.html

http://zhidao.baixing.com/question/11524239.html

http://zhidao.baixing.com/question/11524242.html

http://zhidao.baixing.com/question/11524243.html

http://zhidao.baixing.com/question/11524245.html

http://zhidao.baixing.com/question/11524246.html

http://zhidao.baixing.com/question/11524247.html

http://zhidao.baixing.com/question/11524248.html

http://zhidao.baixing.com/question/11524251.html

http://zhidao.baixing.com/question/11524255.html

http://zhidao.baixing.com/question/11524259.html

http://zhidao.baixing.com/question/11524260.html

http://zhidao.baixing.com/question/11524262.html

http://zhidao.baixing.com/question/11524264.html

http://zhidao.baixing.com/question/11524266.html

http://zhidao.baixing.com/question/11524267.html

http://zhidao.baixing.com/question/11524268.html

http://zhidao.baixing.com/question/11524269.html

http://zhidao.baixing.com/question/11524271.html

http://zhidao.baixing.com/question/11524272.html

http://zhidao.baixing.com/question/11524273.html

http://zhidao.baixing.com/question/11524274.html

http://zhidao.baixing.com/question/11524277.html

http://zhidao.baixing.com/question/11524278.html

http://zhidao.baixing.com/question/11524279.html

http://zhidao.baixing.com/question/11524280.html

http://zhidao.baixing.com/question/11524281.html

http://zhidao.baixing.com/question/11524282.html

http://zhidao.baixing.com/question/11524283.html

http://zhidao.baixing.com/question/11524285.html

http://zhidao.baixing.com/question/11524288.html

http://zhidao.baixing.com/question/11524289.html

http://zhidao.baixing.com/question/11524290.html

http://zhidao.baixing.com/question/11524291.html

http://zhidao.baixing.com/question/11524294.html

http://zhidao.baixing.com/question/11524295.html

http://zhidao.baixing.com/question/11524297.html

http://zhidao.baixing.com/question/11524298.html

http://zhidao.baixing.com/question/11524299.html

http://zhidao.baixing.com/question/11524301.html

http://zhidao.baixing.com/question/11524302.html

http://zhidao.baixing.com/question/11524304.html

http://zhidao.baixing.com/question/11524305.html

http://zhidao.baixing.com/question/11524308.html

http://zhidao.baixing.com/question/11524309.html

http://zhidao.baixing.com/question/11524312.html

http://zhidao.baixing.com/question/11524313.html

http://zhidao.baixing.com/question/11524314.html

http://zhidao.baixing.com/question/11524315.html

http://zhidao.baixing.com/question/11524316.html

http://zhidao.baixing.com/question/11524317.html

http://zhidao.baixing.com/question/11524319.html

http://zhidao.baixing.com/question/11524320.html

http://zhidao.baixing.com/question/11524321.html

http://zhidao.baixing.com/question/11524322.html

http://zhidao.baixing.com/question/11524323.html

http://zhidao.baixing.com/question/11524324.html

http://zhidao.baixing.com/question/11524325.html

http://zhidao.baixing.com/question/11524328.html

http://zhidao.baixing.com/question/11524329.html

http://zhidao.baixing.com/question/11524330.html

http://zhidao.baixing.com/question/11524332.html

http://zhidao.baixing.com/question/11524334.html

http://zhidao.baixing.com/question/11524336.html

http://zhidao.baixing.com/question/11524338.html

http://zhidao.baixing.com/question/11524339.html

http://zhidao.baixing.com/question/11524341.html

http://zhidao.baixing.com/question/11524342.html

http://zhidao.baixing.com/question/11524343.html

http://zhidao.baixing.com/question/11524345.html

http://zhidao.baixing.com/question/11524347.html

http://zhidao.baixing.com/question/11524349.html

http://zhidao.baixing.com/question/11524350.html

http://zhidao.baixing.com/question/11524351.html

http://zhidao.baixing.com/question/11524352.html

http://zhidao.baixing.com/question/11524353.html

http://zhidao.baixing.com/question/11524354.html

http://zhidao.baixing.com/question/11524356.html

http://zhidao.baixing.com/question/11524357.html

http://zhidao.baixing.com/question/11524358.html

http://zhidao.baixing.com/question/11524359.html

http://zhidao.baixing.com/question/11524361.html

http://zhidao.baixing.com/question/11524362.html

http://zhidao.baixing.com/question/11524364.html

http://zhidao.baixing.com/question/11524366.html

http://zhidao.baixing.com/question/11524370.html

http://zhidao.baixing.com/question/11524373.html

http://zhidao.baixing.com/question/11524374.html

http://zhidao.baixing.com/question/11524375.html

http://zhidao.baixing.com/question/11524376.html

http://zhidao.baixing.com/question/11524377.html

http://zhidao.baixing.com/question/11524378.html

http://zhidao.baixing.com/question/11524380.html

http://zhidao.baixing.com/question/11524381.html

http://zhidao.baixing.com/question/11524382.html

http://zhidao.baixing.com/question/11524385.html

http://zhidao.baixing.com/question/11524387.html

http://zhidao.baixing.com/question/11524388.html

http://zhidao.baixing.com/question/11524389.html

http://zhidao.baixing.com/question/11524390.html

http://zhidao.baixing.com/question/11524391.html

http://zhidao.baixing.com/question/11524392.html

http://zhidao.baixing.com/question/11524393.html

http://zhidao.baixing.com/question/11524394.html

http://zhidao.baixing.com/question/11524395.html

http://zhidao.baixing.com/question/11524397.html

http://zhidao.baixing.com/question/11524398.html

http://zhidao.baixing.com/question/11524400.html

http://zhidao.baixing.com/question/11524401.html

http://zhidao.baixing.com/question/11524403.html

http://zhidao.baixing.com/question/11524404.html

http://zhidao.baixing.com/question/11524406.html

http://zhidao.baixing.com/question/11524407.html

http://zhidao.baixing.com/question/11524408.html

http://zhidao.baixing.com/question/11524409.html

http://zhidao.baixing.com/question/11524410.html

http://zhidao.baixing.com/question/11524411.html



鎴橀瓊灝忕瓚 2021-12-27 19:04 鍙戣〃璇勮
]]>
浣嗘槸GPU鐨勬ц兘渚濈劧榪樻槸DrawCall浼樺寲閭d竴濂?/title><link>http://m.shnenglu.com/sunicdavy/archive/2021/12/27/217892.html</link><dc:creator>鎴橀瓊灝忕瓚</dc:creator><author>鎴橀瓊灝忕瓚</author><pubDate>Mon, 27 Dec 2021 11:01:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2021/12/27/217892.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/217892.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2021/12/27/217892.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/217892.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/217892.html</trackback:ping><description><![CDATA[ Entitas鐨凟CS緋葷粺 1. 鏈潵鍦ㄤ竴涓璞′腑娣誨姞涓涓被瀛楁鐨勮繃紼嬶紝ECS闇瑕佹坊鍔犱竴涓被浠h〃Component錛屽茍涓斾唬鐮佺敓鎴愩? 榪欎釜瀛楁涓鑸敤浜庢弿榪板璞$殑璧勬簮錛屽鐞嗘樉紺虹殑GameObject錛?琛ㄧず瀵硅薄鐨勭被鍨嬬瓑銆? 2. 鏈潵涓涓璞$殑涓氬姟閫昏緫澶勭悊榪囩▼鐩存帴鐢ㄦ柟娉曡В鍐崇殑錛?ECS闇瑕佹柊鍔犱竴涓猄ystem錛岃屾搷浣滃璞¢渶瑕佷嬌鐢‵ilter鎴朑roup鏌ヨ鑾峰緱銆? 3. 涓緋誨垪鐨勬搷浣滐紝 闇瑕佹媶鍒嗕負澶氫釜System鍜孋omponent鎷嗗垎澶勭悊銆傚鏋淪ystem欏哄簭涓嶅錛?浼氶犳垚涓浜涜寮傜殑bug銆? 4. Component涓嶄粎浠呮槸Model鎵胯澆浣擄紝 涔熷彲浠ユ槸鍙傛暟鐨勬暟鎹粨鏋勩傚弬鏁癈omponent閫氳繃Entity浼犻掑埌System澶勭悊銆?渚嬪錛?閫氳繃ECS鍒涘緩涓涓柟鍧楃殑榪囩▼錛屼嬌鐢–reateTileComponent錛屽寘鍚垱寤篢ile鐨勪綅緗紝 鍒涘緩Entity騫舵坊鍔燙reateTileComponent錛?鍦–reateTileSystem涓鐞嗗氨鍒涘緩浜員ile錛屽鐞嗗畬鎴愭椂錛?闇瑕佸皢浼犲叆鐨凟ntity.Destroy鎺夈? 6. Entity涓婁慨鏀笴omponent鐨勮繃紼嬶紝 浼氳Е鍙戜簨浠躲備慨鏀圭殑榪囩▼闇瑕佷嬌鐢≧elaceXXX錛孹XX琛ㄧず緇勪歡鍚嶃傜粍浠跺彲浠ラ綣佷慨鏀癸紝 涓嶇敤鎷呭績娣誨姞鍜屽垹闄ょ粍浠惰繃紼嬬殑鎬ц兘錛?Entitas搴曞眰澶勭悊鎬ц兘鍙浉褰撲簬鎸囬拡璧嬪肩殑鎬ц兘銆? ECS鍍忎粈涔堬紵 1. ECS涓殑System綾諱技瑙﹀彂鍣ㄧ郴緇燂紙Event-Condition-Action錛夛紝鍏朵腑錛孍vent瀵瑰簲Entitas鐨凣etTrigger+Collector錛岃〃紺鴻Е鍙戜簨浠躲侰ondition瀵瑰簲Filter琛ㄧず鍦ㄤ簨浠舵潵婧愬璞′腑鎵懼埌闇瑕佺殑瀵硅薄銆?Action瀵瑰簲Execute錛岃〃紺哄疄闄呯殑鎿嶄綔銆? 2. ECS涓殑Component綾諱技涓嶇敤lua鎵╁睍鐨凴edis鎴栬呬笉鐢ㄥ瓨鍌ㄨ繃紼嬬殑MySQL錛?綰補綰暟鎹紝 鑰屼笉鑳藉鏁版嵁鏈変換浣曞皝瑁呮搷浣溿傛病鏈塴ua鍜屽瓨鍌ㄨ繃紼嬫敮鎸佺殑db鍐欒搗鏉ヨ繕鏄瘮杈冭垂鍔茬殑錛屼絾ECS灝辨槸閭d箞鐨勭函銆? 3. ECS涓殑Entity寰堝按灝紝鍥犱負Component鏄寜綾誨埆榪炵畫瀛樺偍鐨勪互淇濊瘉鎬ц兘銆?閫昏緫鍙堥渶瑕丒ntity緇勫悎鎴愰昏緫闇瑕佺殑澶嶅悎瀵硅薄銆?涓よ竟閮借鐓ч【錛屾墍浠ヨ繖縐嶈璁″氨璁╀唬鐮侀噺宸ㄥ錛屽彲璇繪т笅闄嶃? ECS浼佸浘鐢ㄤ竴濂楁鏋剁伃鎺夎璁℃ā寮? 1. 鍗曚歡錛圫ingleton錛夊湪Entitas鐢║nique鏍囩鏍囪Component錛?鍦–ontext涓氨鏄敮涓鐨勶紝 鍏跺疄涔熷氨鏄疭ingleton銆? 2. ECS騫叉帀浜嗕紶緇熺殑宸ュ巶妯″紡錛屽簳灞傜粺涓瀵瑰璞★紙Entity錛夊拰灞炴э紙Component錛夌粺涓綆$悊銆傞渶瑕佹寜Component涓殑鍊兼壘鍥濫ntity鏃訛紝 鍙互浣跨敤EntityIndex銆? 3. Entity鎼哄甫涓嶅悓鐨勭粍浠舵椂錛屾暣涓垱寤哄拰閿姣佽繃紼嬭璁板綍騫舵仮澶嶏紝鍏跺疄灝辨槸Command妯″紡 ECS閫傚悎鍋歎I妗嗘灦錛堢被浼糓VVM錛孧VC,MVP錛変箞錛? ECS涓嶆槸涓撶敤鐨刄I妗嗘灦錛屼絾鏄彲浠ュ涓嶅悓緋葷粺鍜屾暟鎹棿瑙h︺備紶緇熶唬鐮佷腑鏁版嵁淇敼鍚庣殑Callback錛孍CS涔熷彲浠ョ敤Listener鍋氾紝 浣哃istener鍥犱負鑳戒繚瀛樻暟鎹紝 灝遍渶瑕佺敤Component淇濆瓨銆?鎵浠ヤ綘闇瑕侀潰瀵圭殑鏄紝涓涓狟utton錛屽搷搴斿垱寤轟竴涓弬鏁扮敤鐨凜omponent鍜孲ystem錛岃繕瑕佷負鏁版嵁鏀瑰彉鍐欎竴濂桳istenComponent鍜孡istener澶勭悊鐨凷ystem錛岄吀鐖藉惂錛? Minecraft閫傚悎ECS鏉ュ仛涔堬紵 鍙互錛屾ц兘搴旇鑳芥彁鍗囦笉灝戯紝浣嗘槸浠g爜浼氭洿綣佺悙錛岀壒鍒儚Java榪欑鍟板棪璇█閰嶄笂ECS榪欑鍟板棪妗嗘灦錛屼及璁′唬鐮侀噺緲葷炕榪樻槸寰堣交鏉劇殑銆侻C灞炰簬鐗規畩綾誨瀷鐨勬父鎴忥紝閫傚悎鐗規畩棰嗗煙鐗瑰埆浼樺寲錛屼篃灝辨槸涓撻棬涓烘柟鍧楀仛鍑虹壒鍒殑璁捐鏉ュ仛浼樺寲銆侲CS灞炰簬閫氱敤妗嗘灦錛屽嵆渚挎ц兘OK錛屼絾鏄唬鐮佹湭蹇呰兘鏈夎壇濂界殑鍙鎬с? 浣撻噺灝忕殑娓告垙閫傚悎鐢‥CS鏉ュ仛涔堬紵 鍙互錛屼絾涓嶅緩璁傜壒鍒槸鍙湁鍑犱釜浜虹淮鎶ょ殑宸ョ▼錛岃錘鐒朵笂ECS緋葷粺錛屼細璁╃郴緇熷彉鐨勬瀬涓哄鏉傘傚綋鐒朵綘浼氳錛屽鏋滃紑鍙戝埌鍚庢湡錛屼紶緇熷紑鍙戞ā寮忎細瀵艱嚧浠g爜浼氫貢錛孍CS浼氬ソ浜涘惂銆傛帉鎻CS涔熶笉鏄竴澶╀袱澶╃殑浜嬫儏錛屼笉鐔熸倝ECS鐨勭▼搴忓憳璁捐鍑烘潵鐨勭郴緇熻幏寰楃殑浼樺娍鍙兘榪樹笉濡傜敤浼犵粺璁捐鏂規硶濂藉憿銆? 鏋舵瀯瑙e喅鐨勬槸浜虹殑闂錛?浜洪兘鏈夐棶棰橈紝鐢ㄤ粈涔堟鏋墮兘娌″姙娉曘? 鍒板簳浠涔堥」鐩傚悎鐢‥CS錛? 1. 澶ч噺鐨勫皬涓綋涓嶆柇鐨勭敓鎴愬拰閿姣佷互鍙婃樉紺猴紝渚嬪錛?鏀誨煄鎴樹腑錛岃浣撶幇姣忎釜瑙掕壊鐨勭Щ鍔紝鎴樻枟銆? 2. 澶氫簬5涓漢緙栧啓鏍稿績鎴樻枟閫昏緫銆備簰鐩稿崗浣滃拰妯″潡鍒囧垎錛岄渶瑕佷竴涓ぇ瀹墮兘鑳戒俊鏈嶇殑妗嗘灦錛孍CS鍙互閫夋嫨銆? P.S. 涓嶈閫燛CS鐨勮疆瀛愶紒 寰堝鍚屽鐪嬩簡ECS鍩烘湰鍘熺悊錛屽湪娌℃湁娣卞叆浣跨敤榪囦換浣旹CS緋葷粺鏃墮┈涓婃搷鍒閫犺疆瀛愩侲CS緋葷粺紜疄鐪嬭搗鏉ョ畝鍗曘傚疄闄呴犱笅鏉ヤ綘浼氬彂鐜幫紝鎬ц兘闈炲父緋熺硶浠ュ強涓嶇煡閬撲竴浜涢昏緫濡備綍鐢‥CS鏉ヨВ鍐熾? 鎬葷粨錛? 1. ECS紜疄涓烘ц兘鑰岀敓錛屾病鏈夊茍鍙戝姞鎸佹ц兘鐨凟CS閮芥槸鑰嶆祦姘擄紝瑕佸揩灝辮蹇埌鏋佽嚧銆? 2. Unity涓紝ECS騫跺彂鑳芥墿灞旵PU鐨勫埄鐢ㄧ巼錛屼絾鏄疓PU鐨勬ц兘渚濈劧榪樻槸DrawCall浼樺寲閭d竴濂楋紝鍒湡鏈汦CS浼氶瑕哢nity錛屾ц兘涔熶笉浼氬揩鍒伴璧鳳紝鍏抽敭榪樻槸瑕佺湅鍏蜂綋鐨勯」鐩拰浜恒? 3. ECS鏄竾鑳芥鏋訛紝浣嗕笉鍏ㄨ兘銆備紶緇熸灦鏋勫拰璁捐鎬濇兂涔熶笉鏄竴鏃犳槸澶勶紝鐔熷暐鐢ㄥ暐錛屾庝箞蹇庝箞鏉ワ紒 https://mip.bmlink.com/wu19870821/news/2611408.html https://mip.bmlink.com/wu19870821/news/2611409.html https://mip.bmlink.com/wu19870821/news/2611410.html https://mip.bmlink.com/wu19870821/news/2611411.html https://mip.bmlink.com/wu19870821/news/2611412.html https://mip.bmlink.com/wu19870821/news/2611413.html https://mip.bmlink.com/wu19870821/news/2611414.html https://mip.bmlink.com/wu19870821/news/2611415.html https://mip.bmlink.com/wu19870821/news/2611416.html https://mip.bmlink.com/wu19870821/news/2611417.html https://m.bmlink.com/wu19870821/news/2611408.html https://m.bmlink.com/wu19870821/news/2611409.html https://m.bmlink.com/wu19870821/news/2611410.html https://m.bmlink.com/wu19870821/news/2611411.html https://m.bmlink.com/wu19870821/news/2611412.html https://m.bmlink.com/wu19870821/news/2611413.html https://m.bmlink.com/wu19870821/news/2611414.html https://m.bmlink.com/wu19870821/news/2611415.html https://m.bmlink.com/wu19870821/news/2611416.html https://m.bmlink.com/wu19870821/news/2611417.html https://wu19870821.bmlink.com/news/2611408.html https://wu19870821.bmlink.com/news/2611409.html https://wu19870821.bmlink.com/news/2611410.html https://wu19870821.bmlink.com/news/2611411.html https://wu19870821.bmlink.com/news/2611412.html https://wu19870821.bmlink.com/news/2611413.html https://wu19870821.bmlink.com/news/2611414.html https://wu19870821.bmlink.com/news/2611415.html https://wu19870821.bmlink.com/news/2611416.html https://wu19870821.bmlink.com/news/2611417.html https://www.bmlink.com/wu19870821/news/2611408.html https://www.bmlink.com/wu19870821/news/2611409.html https://www.bmlink.com/wu19870821/news/2611410.html https://www.bmlink.com/wu19870821/news/2611411.html https://www.bmlink.com/wu19870821/news/2611412.html https://www.bmlink.com/wu19870821/news/2611413.html https://www.bmlink.com/wu19870821/news/2611414.html https://www.bmlink.com/wu19870821/news/2611415.html https://www.bmlink.com/wu19870821/news/2611416.html https://www.bmlink.com/wu19870821/news/2611417.html https://mip.bmlink.com/chaoweifensuiji/news/2611407.html https://mip.bmlink.com/chaoweifensuiji/news/2611406.html https://mip.bmlink.com/chaoweifensuiji/news/2558756.html https://mip.bmlink.com/chaoweifensuiji/news/2558753.html https://mip.bmlink.com/chaoweifensuiji/news/2558748.html https://mip.bmlink.com/chaoweifensuiji/news/2558743.html https://mip.bmlink.com/chaoweifensuiji/news/2558740.html https://mip.bmlink.com/chaoweifensuiji/news/2558737.html https://mip.bmlink.com/chaoweifensuiji/news/2558731.html https://m.bmlink.com/chaoweifensuiji/news/2611407.html https://m.bmlink.com/chaoweifensuiji/news/2611406.html https://m.bmlink.com/chaoweifensuiji/news/2558756.html https://m.bmlink.com/chaoweifensuiji/news/2558753.html https://m.bmlink.com/chaoweifensuiji/news/2558748.html https://m.bmlink.com/chaoweifensuiji/news/2558743.html https://m.bmlink.com/chaoweifensuiji/news/2558740.html https://m.bmlink.com/chaoweifensuiji/news/2558737.html https://m.bmlink.com/chaoweifensuiji/news/2558731.html https://chaoweifensuiji.bmlink.com/news/2611407.html https://chaoweifensuiji.bmlink.com/news/2611406.html https://chaoweifensuiji.bmlink.com/news/2558756.html https://chaoweifensuiji.bmlink.com/news/2558753.html https://chaoweifensuiji.bmlink.com/news/2558748.html https://chaoweifensuiji.bmlink.com/news/2558743.html https://chaoweifensuiji.bmlink.com/news/2558740.html https://chaoweifensuiji.bmlink.com/news/2558737.html https://chaoweifensuiji.bmlink.com/news/2558731.html https://www.bmlink.com/chaoweifensuiji/news/2611407.html https://www.bmlink.com/chaoweifensuiji/news/2611406.html https://www.bmlink.com/chaoweifensuiji/news/2558756.html https://www.bmlink.com/chaoweifensuiji/news/2558753.html https://www.bmlink.com/chaoweifensuiji/news/2558748.html https://www.bmlink.com/chaoweifensuiji/news/2558743.html https://www.bmlink.com/chaoweifensuiji/news/2558740.html https://www.bmlink.com/chaoweifensuiji/news/2558737.html https://www.bmlink.com/chaoweifensuiji/news/2558731.html https://mip.bmlink.com/towercrane/news/2541940.html https://mip.bmlink.com/towercrane/news/2541945.html https://mip.bmlink.com/towercrane/news/2541950.html https://mip.bmlink.com/towercrane/news/2541966.html https://mip.bmlink.com/towercrane/news/2541991.html https://mip.bmlink.com/towercrane/news/2541992.html https://mip.bmlink.com/towercrane/news/2541993.html https://mip.bmlink.com/towercrane/news/2541994.html https://mip.bmlink.com/towercrane/news/2541995.html https://m.bmlink.com/towercrane/news/2541940.html https://m.bmlink.com/towercrane/news/2541945.html https://m.bmlink.com/towercrane/news/2541950.html https://m.bmlink.com/towercrane/news/2541966.html https://m.bmlink.com/towercrane/news/2541991.html https://m.bmlink.com/towercrane/news/2541992.html https://m.bmlink.com/towercrane/news/2541993.html https://m.bmlink.com/towercrane/news/2541994.html https://m.bmlink.com/towercrane/news/2541995.html https://towercrane.bmlink.com/news/2541940.html https://towercrane.bmlink.com/news/2541945.html https://towercrane.bmlink.com/news/2541950.html https://towercrane.bmlink.com/news/2541966.html https://towercrane.bmlink.com/news/2541991.html https://towercrane.bmlink.com/news/2541992.html https://towercrane.bmlink.com/news/2541993.html https://towercrane.bmlink.com/news/2541994.html https://towercrane.bmlink.com/news/2541995.html https://www.bmlink.com/towercrane/news/2541940.html https://www.bmlink.com/towercrane/news/2541945.html https://www.bmlink.com/towercrane/news/2541950.html https://www.bmlink.com/towercrane/news/2541966.html https://www.bmlink.com/towercrane/news/2541991.html https://www.bmlink.com/towercrane/news/2541992.html https://www.bmlink.com/towercrane/news/2541993.html https://www.bmlink.com/towercrane/news/2541994.html https://www.bmlink.com/towercrane/news/2541995.html https://mip.bmlink.com/xxmjhw888/news/2611429.html https://mip.bmlink.com/xxmjhw888/news/2611428.html https://mip.bmlink.com/xxmjhw888/news/2611427.html https://mip.bmlink.com/xxmjhw888/news/2611426.html https://mip.bmlink.com/xxmjhw888/news/2611425.html https://mip.bmlink.com/xxmjhw888/news/2611424.html https://mip.bmlink.com/xxmjhw888/news/2611423.html https://mip.bmlink.com/xxmjhw888/news/2611422.html https://mip.bmlink.com/xxmjhw888/news/2611421.html https://mip.bmlink.com/xxmjhw888/news/2611420.html https://mip.bmlink.com/xxmjhw888/news/2611419.html https://mip.bmlink.com/xxmjhw888/news/2611418.html https://m.bmlink.com/xxmjhw888/news/2611429.html https://m.bmlink.com/xxmjhw888/news/2611428.html https://m.bmlink.com/xxmjhw888/news/2611427.html https://m.bmlink.com/xxmjhw888/news/2611426.html https://m.bmlink.com/xxmjhw888/news/2611425.html https://m.bmlink.com/xxmjhw888/news/2611424.html https://m.bmlink.com/xxmjhw888/news/2611423.html https://m.bmlink.com/xxmjhw888/news/2611422.html https://m.bmlink.com/xxmjhw888/news/2611421.html https://m.bmlink.com/xxmjhw888/news/2611420.html https://m.bmlink.com/xxmjhw888/news/2611419.html https://m.bmlink.com/xxmjhw888/news/2611418.html https://xxmjhw888.bmlink.com/news/2611429.html https://xxmjhw888.bmlink.com/news/2611428.html https://xxmjhw888.bmlink.com/news/2611427.html https://xxmjhw888.bmlink.com/news/2611426.html https://xxmjhw888.bmlink.com/news/2611425.html https://xxmjhw888.bmlink.com/news/2611424.html https://xxmjhw888.bmlink.com/news/2611423.html https://xxmjhw888.bmlink.com/news/2611422.html https://xxmjhw888.bmlink.com/news/2611421.html https://xxmjhw888.bmlink.com/news/2611420.html https://xxmjhw888.bmlink.com/news/2611419.html https://xxmjhw888.bmlink.com/news/2611418.html https://www.bmlink.com/xxmjhw888/news/2611429.html https://www.bmlink.com/xxmjhw888/news/2611428.html https://www.bmlink.com/xxmjhw888/news/2611427.html https://www.bmlink.com/xxmjhw888/news/2611426.html https://www.bmlink.com/xxmjhw888/news/2611425.html https://www.bmlink.com/xxmjhw888/news/2611424.html https://www.bmlink.com/xxmjhw888/news/2611423.html https://www.bmlink.com/xxmjhw888/news/2611422.html https://www.bmlink.com/xxmjhw888/news/2611421.html https://www.bmlink.com/xxmjhw888/news/2611420.html https://www.bmlink.com/xxmjhw888/news/2611419.html https://www.bmlink.com/xxmjhw888/news/2611418.html https://www.ixueyi.com/qinggan/a_Tl9sM38K.html https://www.ixueyi.com/falv/a_2I2ewPSh.html https://www.ixueyi.com/falv/a_Y1Un4tSK.html https://www.ixueyi.com/falv/a_9Q3N5R3R.html https://www.ixueyi.com/falv/a_A9E8Pvl3.html https://www.ixueyi.com/falv/a_2jy4G07C.html https://www.ixueyi.com/falv/a_W5r2as2P.html https://www.ixueyi.com/falv/a_a20P8p3T.html https://www.ixueyi.com/falv/a_5jl15mkU.html https://www.ixueyi.com/falv/a_C646nFN4.html https://www.ixueyi.com/falv/a_n71xa7a2.html https://www.ixueyi.com/falv/a_VCxaehV6.html https://www.ixueyi.com/falv/a_7JhXF2L0.html https://www.ixueyi.com/falv/a_y5tA5IdR.html https://www.ixueyi.com/falv/a_qn722hR8.html https://www.ixueyi.com/falv/a_yX5W85yK.html https://www.ixueyi.com/renshi/a_r569sY1C.html https://www.ixueyi.com/renshi/a_472EFKfF.html https://www.ixueyi.com/renshi/a_umemPeiO.html https://www.ixueyi.com/renshi/a_9o6T89n3.html https://www.ixueyi.com/renshi/a_GX26np9Q.html https://www.ixueyi.com/falv/a_4CAdyV14.html https://www.ixueyi.com/falv/a_i28019yM.html https://www.ixueyi.com/falv/a_b2fyO1od.html https://www.ixueyi.com/falv/a_oq1MYAeY.html https://www.ixueyi.com/falv/a_XSVSuYNm.html https://www.ixueyi.com/falv/a_LUxNT8oA.html https://www.ixueyi.com/falv/a_agNvlmr3.html<img src ="http://m.shnenglu.com/sunicdavy/aggbug/217892.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">鎴橀瓊灝忕瓚</a> 2021-12-27 19:01 <a href="http://m.shnenglu.com/sunicdavy/archive/2021/12/27/217892.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏈嶅姟鍣ㄥ紑鍙戣璦姣旇緝http://m.shnenglu.com/sunicdavy/archive/2016/01/05/212611.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Tue, 05 Jan 2016 08:51:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2016/01/05/212611.htmlhttp://m.shnenglu.com/sunicdavy/comments/212611.htmlhttp://m.shnenglu.com/sunicdavy/archive/2016/01/05/212611.html#Feedback10http://m.shnenglu.com/sunicdavy/comments/commentRss/212611.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/212611.html浠ヤ笅姣旇緝鐨勫熀紜閮芥槸鍩轟簬涓縐嶇紪紼嬭璦+涓瀹氱殑絎笁鏂規垨鑰呰嚜宸辯紪鍐欑殑緗戠粶搴撳拰搴曞眰榪涜鐨勶紝Skynet紼嶅井鐗規畩錛屼絾鎬諱綋姣旇緝鍚堥傛斁鍒版瘮杈冧腑鏉?/p>

C#

寮鍙戞晥鐜囷細Windows涓嬪彲浠ラ氳繃VisualStudio榪涜寮鍙戯紝鍏朵粬騫沖彴鍙互浣跨敤MonoDevelop錛岄潪甯告柟渚?/p>

榪愯鏁堢巼錛欽IT鐨勬ц兘浼樺寲姣旇緝鍒頒綅錛岃兘閫傚簲90%鎬ц兘鐜

閮ㄧ講渚挎嵎鎬э細鍙互閫氳繃浜ゅ弶緙栬瘧鐢熸垚鍏朵粬騫沖彴鐨勫彲鎵ц鏂囦歡錛岄氳繃mono榪愯鍙墽琛屾枃浠?/p>

璋冭瘯渚挎嵎鎬э細VisualStudio鍜孧onoDevelop璋冭瘯鍧囧緢鏂逛究錛?榪樺彲榪滅▼璋冭瘯

涓婃墜搴︼細瀵笴緋昏璦鐔熸倝鐨勫嚑澶╁氨鍙笂鎵?/p>

鐑洿鏂幫細鍙互閫氳繃DLL鏂瑰紡榪涜

Web瀵規帴錛氬彲鍋氾紝浠g爜姣旇緝鍟板棪

宕╂簝澶勭悊錛氬彲閫氳繃try catch鎹曡幏閿欒

緗戠粶搴撶紪鍐欓毦搴︼細涓鑸紝闇娉ㄦ剰gc闂

絎笁鏂圭綉緇滃簱鍙婃鏋舵暟閲忥細涓鑸?/p>

 

Golang

寮鍙戞晥鐜囷細楂?/p>

榪愯鏁堢巼錛氬茍鍙戜笂闈炲父鏈変紭鍔匡紝瀵笴PU鍒╃敤鐜囨瘮杈冮珮錛屽師鐢熻繍琛屾棤铏氭嫙鏈?/p>

閮ㄧ講渚挎嵎鎬э細涓嬈$紪璇戝埌澶勮繍琛岋紝鏃犱換浣曡繍琛屽簱渚濊禆

璋冭瘯渚挎嵎鎬э細瀹為檯鎿嶄綔涓紝鍗曠嚎紼嬫寕鎺ヨ皟璇曞櫒鍙錛?浣嗗彉閲忔樉紺轟笉姝g‘錛屽紑鍙戞湡鍩烘湰閲囩敤鏃ュ織鏂瑰紡榪涜鏌ラ敊

涓婃墜搴︼細璇█綆鍗曪紝鐗規у皯錛?鏂版墜1鍛ㄨ兘璐$尞浠g爜

鐑洿鏂幫細鏃犳硶榪涜鐑洿鏂幫紝璇█鏃犳硶緙栬瘧涓篋LL錛屼篃涓嶆敮鎸丏LL鍔犺澆錛坙inux騫沖彴鐨?so鍔犺澆蹇界暐涓嶈錛?/p>

Web瀵規帴錛氶潪甯告柟渚匡紝 浠g爜綺劇畝

宕╂簝澶勭悊錛氬穿婧冨悗浠ュ懡浠よ鏂瑰紡鎵撳嵃鍑烘爤錛岀▼搴忓唴鍙互鎹曡幏浠諱綍宕╂簝閿欒騫剁戶緇繍琛?/p>

緗戠粶搴撶紪鍐欓毦搴︼細綆鍗曪紝姣擟 socket鏇寸畝鍗?/p>

絎笁鏂圭綉緇滃簱鍙婃鏋舵暟閲忥細鍋忓皯

 

Skynet(lua+C)

寮鍙戞晥鐜囷細鍩轟簬鍔ㄦ佽璦鐨勫紑鍙戝垵嬈″啓姣旇緝蹇紝鍚庢湡緇存姢鍜岄噸鏋勪細鑰楄垂涓瀹氱殑鏃墮棿鍦ㄦ煡閿欎笂

榪愯鏁堢巼錛氬熀浜巐ua jit鐨勮繍琛屾晥鐜囪繕鏄兘鎺ュ彈鐨?/p>

閮ㄧ講渚挎嵎鎬э細鏂逛究錛?鍙湁搴曞眰淇敼闇瑕侀噸鏂扮紪璇戯紝 澶ч儴鍒嗘椂闂村彧鐢ㄦ洿鏂發ua鏂囦歡

璋冭瘯渚挎嵎鎬э細涓嶆槸寰堟柟渚匡紝鍩轟簬鏃ュ織鏂瑰紡榪涜鏌ラ敊

涓婃墜搴︼細lua璇█鐗規ф湁閮ㄥ垎鍜孋緋昏璦鏈変竴瀹氬樊寮傦紝鍩轟簬Actor妯″瀷鐨勬濇兂瀛︿範錛岄傚簲闇瑕佽楄垂涓瀹氱殑鏃墮棿

鐑洿鏂幫細綾諱技浜嶦rlang錛屽彲綺劇‘鍒板嚱鏁扮駭鐨勭儹鏇存柊

Web瀵規帴錛氭湁涓浜沨ttp鏀寔錛岄氳繃紺懼尯鎱㈡參榪涜瀹屽杽

宕╂簝澶勭悊錛歭ua澶╃敓鍙互鎹曡幏閿欒

緗戠粶搴撶紪鍐欓毦搴︼細鑷甫錛屾棤闇緙栧啓

絎笁鏂圭綉緇滃簱鍙婃鏋舵暟閲忥細閫氳繃紺懼尯鎱㈡參瀹屽杽

 

C++

寮鍙戞晥鐜囷細緙栬瘧鎱紝鏂囦歡澶氾紝閫氱敤搴撳皯

榪愯鏁堢巼錛歯ative閫熷害鏍囨潌

閮ㄧ講渚挎嵎鎬э細緙栧啓鍚勭被鐨刴ake闂ㄦ杈冮珮

璋冭瘯渚挎嵎鎬э細鍙氳繃VisualStudio榪涜Windows騫沖彴璋冭瘯

涓婃墜搴︼細2~3騫寸粡楠岀殑鐔熸墜浠嶇劧浼氬啓鍑哄穿婧冨拰娉勯湶浠g爜

鐑洿鏂幫細鍙氳繃DLL榪涜

Web瀵規帴錛氫唬鐮佸暟鍡︼紝絎笁鏂瑰簱灝?/p>

宕╂簝澶勭悊錛歐indows涓嬪彲浣跨敤SEH鎹曡幏孌靛紓甯革紝鍏朵粬騫沖彴鍙兘閫氳繃宕╂簝鍚庤繘琛宑oredump鍒嗘瀽錛屽閿欓潪甯稿樊

緗戠粶搴撶紪鍐欓毦搴︼細鍩轟簬asio緙栧啓杈冧負綆鍗曪紝浣嗘諱綋鐪嬫潵闅懼害涓嶄綆

絎笁鏂圭綉緇滃簱鍙婃鏋舵暟閲忥細杈冨

 

浠ヤ笅鏄緱鍒?/p>

image

 

浠庡彂鏂囨椂鐨勯」鐩榪欎簺璇█浣跨敤鐜囨潵璇達紝Java錛孍rlang錛孋++緙栧啓鐨勬湇鍔″櫒杈冨錛孏olang錛孞avaScript錛孋#鏄浜屾闃燂紝Skynet鐢變簬涓婃墜涓嶆槸寰堝鏄擄紝鎵浠ヤ粎鏈変袱浣嶆暟鐨勫洟闃熷湪浣跨敤錛屼絾鎬諱綋琛ㄧ幇榪樻槸姣旇緝鍑鴻壊鐨?

瀵逛簬鑰佸洟闃燂紝 C++鐨勬湇鍔″櫒宸ュ叿閾懼拰妗嗘灦宸茬粡鐩稿鎴愮啛錛?瀹屽叏娌″繀瑕佹洿鎹㈡柊璇█錛?鍙槸鍦ㄥ鎺dk鎰熻鍥伴毦鏃訛紝鍙互灝濊瘯Golang榪欎簺瀵箇eb鏈変紭鍔跨殑璇█榪涜娣峰悎璇█寮鍙?

瀵逛簬鏂板洟闃燂紝寮鍙戞晥鐜囷紝涓婃墜搴﹀拰閮ㄧ講鏁堢巼鏄紭鍏堥夋嫨鐨勶紝C#錛孏olang錛孞avaScript榪欎簺鏂板叴璇█浼氳浣犱簨鍗婂姛鍊?

瀵逛簬澶ц妯℃棤闇閫夋湇鐨勬湇鍔″櫒錛?Skynet鐨刟ctor妯″瀷瀵規墿灞曚細姣旇緝瀹規槗

瀵逛簬澶у叕鍙革紝濂介」鐩紝涓婄嚎鍚庨渶瑕侀氳繃鐑洿鏂拌繘琛宐ug淇ˉ鐨勶紝C#錛孋++錛孍rlang浼氭槸棣栭?

 

浣嗘葷殑涓鐐癸紝 榪樻槸鏍規嵁鍥㈤槦鐔熸倝搴︽潵閫夋嫨璇█錛岃錘鐒剁殑浣跨敤鏂拌璦鐨勯闄╀篃鏄緢澶х殑

鎴橀瓊灝忕瓚 2016-01-05 16:51 鍙戣〃璇勮
]]>
C/C++鏈嶅姟鍣ㄦ灦鏋勬満鍒惰璁℃葷粨http://m.shnenglu.com/sunicdavy/archive/2014/12/18/209225.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Thu, 18 Dec 2014 08:39:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2014/12/18/209225.htmlhttp://m.shnenglu.com/sunicdavy/comments/209225.htmlhttp://m.shnenglu.com/sunicdavy/archive/2014/12/18/209225.html#Feedback1http://m.shnenglu.com/sunicdavy/comments/commentRss/209225.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/209225.html榪戞湡鍦ㄥ啓鍩轟簬go鐨勬父鎴忔湇鍔″櫒妗嗘灦, 鍦ㄥ叏闈㈣劚紱籆/C++鍓? 闇瑕佸鑰佹灦鏋勮繘琛屼竴涓葷粨

鍩轟簬C/C++娓告垙鏈嶅姟鍣ㄦ鏋舵諱綋璁捐鐨勮繕鏄笉閿欑殑, 鍏勫紵浠諱綋浣跨敤鏁堟灉閮芥槸濂借瘎. 鍥犱負鍦ㄦ妧鏈笂鍠滄"鍋鋒噿", 鎵浠ュ湪寰堝璁捐涓? 閮芥槸鍔涙眰綆鍗? 楂樻晥(寮鍙戞晥鐜?.

鍩轟簬浠誨姟鐨勫紓姝B鏌ヨ緋葷粺, 甯﹀閲嶅紓姝ョ殑鍚屾

浠g爜紺轟緥:

   1:   
   2:  void BatchQueryPlayerInfo( uint32 ClientID, const std::string& AccountName, int64 CharID )
   3:  {
   4:      GDBExecutor->Commit
   5:          (    
   6:          dynamic_cast<DBDataTask*>( (new DBQueryCharInfo(  ClientID, CharID ) ) 
   7:          ->LinkAtomTask( new DBQueryQuest( ClientID, CharID ) )
   8:          ->LinkAtomTask( new DBQuerySkill( ClientID, CharID ) )
   9:          ->LinkAtomTask( new DBQueryHero( ClientID, CharID ) )
  10:          ->LinkAtomTask( new DBQueryAccountInfo( ClientID, AccountName ) )
  11:          ->LinkAtomTask( new DBQueryEquip( ClientID, CharID ) )
  12:          ->LinkAtomTask( new DBQueryObject( ClientID ,CharID ) )
  13:          ->LinkAtomTask( new DBQueryLevel(ClientID, CharID))
  14:          ->LinkAtomTask( new DBQueryChapter(ClientID, CharID))
  15:          ->LinkAtomTask( new DBQueryActivity( ClientID, CharID ))
  16:          )
  17:          );
  18:   
  19:  }

榪欐涓昏澶勭悊鐜╁鍦ㄧ櫥闄嗘椂, 闇瑕佷粠DB鏌ヨ澶ч噺鐨勪笉鍚屽垎綾葷殑鏁版嵁. 涓轟簡淇濊瘉鏁堢巼, 鎴戣姣忎釜Task騫惰鎵ц, 鐒跺悗閫氳繃涓涓満鍒? 璁╂墍鏈変換鍔″畬鎴愬悗, 鍥炶皟絎竴涓換鍔$殑涓涓嚱鏁? 榪欐牱灝辨棤闇鎵嬪姩瀹炵幇寰堝綺樺悎浠g爜, 閬垮厤浜嗗弽澶嶈皟璇曞拰閿欒

鍩轟簬protobuf鍙嶅皠鏈哄埗鐨勮鍙ヨ嚜鍔ㄥ悎鎴?/strong>

   1:  DBUpdateCharInfo::DBUpdateCharInfo( int64 CharID, const std::string& Buffer )
   2:  {
   3:      char buffer[256];
   4:   
   5:      sprintf( buffer, "update tb_char set $FIELD$ where charid = %lld;", CharID );
   6:          
   7:      ExecuteCommand( buffer, Buffer, dbopr::FET_Equation );
   8:  }

榪欐灝辨槸涓涓吀鍨嬬殑DB浠誨姟, 鏋勯犲嚱鏁版彁渚涗簡CharID鍜屼竴涓敱緇撴瀯浣撳簭鍒楀寲濂界殑buffer, $FIELD$瀛楁, 鏄氳繃鍙嶅皠鏍規嵁Buffer鍐呭, 鑷姩濉厖瀛楁

榪欐渚嬪瓙涓? $FIELD$鍙互濉厖涓?hp=100, mp=100涔嬬被鐨? 鑷姩濉厖閬垮厤浜嗗洜涓烘坊鍔犲瓧孌電殑鍒板娣誨姞浠g爜, 榪橀渶瑕佽皟璇? 瀹規槗鎼為敊

 

閰嶇疆緋葷粺姒傚康

鍩轟簬鍚屼竴涓厤緗郴緇? 鍒嗗眰瀹炵幇涓嶅悓鐨勯渶姹? 鏇寸畝鍗曠殑璇? 瑙e喅鐨?涓疄闄呴棶棰樻槸:

鑷繁鏀逛簡閰嶇疆鏂囦歡涓殑ip, 涓婁紶svn鍚? 瑕嗙洊浜嗗埆浜虹殑閰嶇疆, 寰堝浜虹殑瑙e喅鏂規硶閮芥槸, 鏈湴閰嶇疆涓嶆彁浜? 浣嗗悓鏃墮棶棰樺張鏉ヤ簡:

褰撻厤緗腑鏈夊埆浜烘柊鍔犵殑緋葷粺閰嶇疆, 鎬庝箞淇濊瘉姣忎釜浜洪兘鑳芥洿鏂板埌?

涓婄嚎鍚? 鏈嶅姟鍣ㄤ氦浠樿繍緇? 浠栦滑浼氬閰嶇疆鏈変竴瀹氱▼搴︾殑淇敼, 榪欎釜鏃跺欐庝箞鍚堝茍紼嬪簭閰嶇疆鍜岃繍緇撮厤緗?

鍏跺疄瀵逛簬鍐茬獊鐨勯渶姹? 鍙瀵圭郴緇熻繘琛屽垎灞傚氨鍙互瑙e喅闂,鎴戠殑澶勭悊鏂瑰紡:

閰嶇疆鍒嗕負:

鍏ㄥ眬閰嶇疆: 鎵鏈夋湇鍔$殑鎬諱綋閰嶇疆

鍗曟湇鍔¢厤緗? 鏈湇鍔$殑閰嶇疆, 娑夊強緗戠粶鍙婇昏緫

鏈湴閰嶇疆: 榪欎釜閰嶇疆姣忎釜浜轟竴浠? 涓嶄笂浼燬VN

鍛戒護琛岄厤緗? 鏍煎紡鍜屽墠闈㈢殑涓鑷? 榪欏潡灝卞彲浠ラ氳繃榪愮淮榪涜閰嶇疆

鎬諱綋緇撴瀯鍏跺疄灝辨槸OO鐨勬淳鐢熸蹇? 涓嬪眰鍙互瑕嗙洊, 淇敼涓婂眰鐨勯厤緗?/p>

 

鏈嶅姟鍣ㄤ簰鑱斿強璇嗗埆妗嗘灦

鍩烘湰鍔熻兘: 鍩轟簬涓浜涚畝鍗曠殑閰嶇疆灝卞彲浠ュ皢澶氬彴鏈嶅姟鍣? 鍚岀綾葷殑涓嶅悓鏈嶅姟鍣ㄤ簰鐩歌繛鎺ヨ搗鏉? 鏂嚎鑷姩閲嶈繛.

鏈嶅姟鍣ㄨ繛鎺ュ悗, 鎵鏈夋湇鍔″櫒鍙煡鏅撳茍鍙嚜鍔ㄦ寜闇榪炴帴

閫昏緫绔篃寰堟柟渚跨殑榪涜騫挎挱鎴栬呭崟鐙彂閫佺瓑

涔熷氨鏄, 姣忎釜鏈嶅姟鍣ㄧ殑榪炴帴鍜屾帴鍙楃閮芥槸甯﹁瘑鍒悕縐版垨id鐨?

鍚庨潰瑙夊緱榪欏涓滆タ瀹炲湪鏄仛鐨勫鏉? 澶氭暣鍑轟竴鍙頒腑蹇冩湇鍔″櫒鏉ュ仛. 浣嗗ソ姝規鏋剁ǔ瀹氫笅鏉ヤ簡, 涔熷氨濂戒簡.

 

鍩轟簬lua鐨勬湇鍔″櫒web鍚庡彴妗嗘灦

鎬濇兂鏄緢涓嶉敊鐨?  C++ 閰嶅悎lua鏈韓緇濆鏄釜澶辮觸

闂鍑哄湪web澶勭悊,鏈韓閮芥槸涓涓悓姝ラ樆濉炶繃紼? 鑰岃繖涓悗鍙版鏋舵槸寮傛鏂瑰紡鏉ュ仛, 鎵浠ョ壒鍒埆鎵?/p>

涓嶈繃姣旇搗浠ュ墠鐨勬湰鍦癎M緋葷粺, 榪欏潡鐨勮璁℃槸浼熷ぇ鐨勮繘姝?/p>

 

鐜板湪姝e湪璁捐鍩轟簬golang鐨勬湇鍔″櫒妗嗘灦, 鍩烘湰妗嗘灦宸茬粡瀹屽伐, 絳夊緟緙栧啓閫昏緫鍚庣殑瀹炴垬嫻嬭瘯

浠ヤ笂鐨勫緢澶氭濇兂鍦╣olang鐨勬湇鍔″櫒妗嗘灦閮芥湁鏀硅繘, 鐗瑰埆鏄痝olang鏈韓鍋歸eb涔熸槸浼樼鐨? 澶栧姞martini榪欑鐗沊妗嗘灦, 鏇存槸姘村埌娓犳垚

濡傛灉浣犲鏈嶅姟鍣ㄦ鏋惰璁℃湁鐗瑰埆鐨勮璇? 鎴栬呮兂紕版挒鎬濇兂, 鍙互鍔犲崥瀹㈢兢 309800774鎴栬呮垜鐨剄q: 20998333璁ㄨ



]]>
lua璋冭瘯鐨勫伐鍏烽夋嫨http://m.shnenglu.com/sunicdavy/archive/2014/09/28/208441.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Sun, 28 Sep 2014 07:19:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2014/09/28/208441.htmlhttp://m.shnenglu.com/sunicdavy/comments/208441.htmlhttp://m.shnenglu.com/sunicdavy/archive/2014/09/28/208441.html#Feedback7http://m.shnenglu.com/sunicdavy/comments/commentRss/208441.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/208441.html鏈榪戠湅鍒頒竴涓叧浜巚s鐨刲ua璋冭瘯鎻掍歡, 瑁呬簡vs2012璇曚簡涓? 蹇嶄笉浣忓彂姝ゆ枃鎬葷粨涓媗ua鍚勭璋冭瘯宸ュ叿

Decoda

    榪欐槸鐜頒粖鍦扮悆涓婅皟璇昹ua5.1鏈鏂逛究鐨勫伐鍏? 娌℃湁涔嬩竴. 寮哄ぇ鐨勬敞鍏ュ紡璋冭瘯, 鎬ц兘鏋侀珮.鏀寔 鎸傛帴榪涚▼, 鍙橀噺灞曞紑, 鏂偣絳夊悇縐嶆棩甯告墍闇.

鏃╂湡鐨凞ecoda鏄敹璐瑰伐鍏? 鍥犳璐ㄩ噺闈炲父楂?

    Decoda鐜板湪宸茬粡鍋滄寮鍙戝茍寮婧愪簡, 璋冭瘯lua5.2浼歝rash. 婧愪唬鐮佸彲浠ヤ綔涓轟竴縐嶆妧鏈弬鑰? 寰堝dll娉ㄥ叆淇敼鎶鏈? 鐏板父鐗沊

image

LuaStudio

   姣旇緝浼樼鐨勮皟璇曞伐鍏?鍥犱負鏀惰垂), 鍙互璋冭瘯lua5.1/5.2, 鐣岄潰灞炰簬vs2008綾誨瀷, 鍦熻豹鍙互鑰冭檻涔板嚑濂楄瘯璇?/p>

 

ZeroBrane Studio

瀵筶ua5.1鏀寔杈冨ソ, 5.2涔熻兘璋冧絾鍋跺皵榪樻槸浼歝rash, 鍩轟簬榪滅▼璋冭瘯鏂瑰紡, 鎵浠ユц兘鐣ヤ綆.

RemDebug

娌℃湁IDE, 綰懡浠よ鏂瑰紡璋冭瘯鍣? 浣嗗洜涓虹畝鍗? 鎵浠ュ彲浠ュ弬鑰冨悗鍐欎竴涓嚜宸辯殑紼嬪簭鍐呭緩璋冭瘯鍣?/p>

Babe Lua

鎶婅繖璐ф斁鍦ㄦ渶鍚庢槸鏈夊師鍥犵殑, 榪樿寰楅偅鍙ヨ佽瘽: 鑰佸涓寮婧? 鎴戜滑灝辨湁鑷富鐮斿彂浜? 瀵圭殑, 榪欒揣涓瀹氭槸鍙傝冧簡Decoda鐨勪唬鐮佸悗鎼炲嚭涓獀s鐨勬彃浠舵潵, 铏界劧涓嶆敹璐? 浣嗘槸涓嶆彁涓嬪弬鑰冨璞$殑琛屼負榪樻槸鍊煎緱鎵規枟鐨? 榪欒揣鍦ㄤ腑鏂囧崥瀹笂璇? 涓嶆敮鎸佹寕鎺ュ埌榪涚▼(Decoda鏀寔), 涓嶆敮鎸?4浣嶈皟璇?LuaStudio鏀寔), 璋冭瘯30~50嬈″伓灝旀寕1鍒?嬈? 鍝? 姣曠珶鍙槸浠g爜鎼繍宸? 涓嶇敓浜т唬鐮?

榪欒揣瑁呬笂, 鑳界敤, 璋?.2鏄笉琛岀殑, 5.1姣擠ecoda鏂逛究鐐? 姣曠珶vs鏀寔鎮誕鏄劇ず鍙橀噺.

 

璇翠簡閭d箞澶? 鍏跺疄瀵逛簬lua5.2鐗堟湰鐨勮皟璇? 榪樻槸娌℃湁鍏嶈垂鐨勬瘮杈冨悎閫傜殑鏂規, 濡傛灉瀹炲湪鎯寵皟璇? 榪樻槸鍙互鍙傝冧笅RemDebug鐨勫師鐞嗗強lua瀹樻柟璋冭瘯鏂囨。, 鑷繁閫氳繃c api璋冪敤鍐欎竴濂楅傚悎鑷繁鐨勮繙紼嬭皟璇曞伐鍏? 鍏跺疄娌℃湁澶氬鏉? 浣嗘繪瘮涓嶈皟璇曠殑濂?img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="寰瑧" src="http://m.shnenglu.com/images/cppblog_com/sunicdavy/Windows-Live-Writer/lua_D2A5/wlEmoticon-smile_2.png">



]]>
lua module/package 鏈哄埗鐨勮嚜瀹氫箟璇誨彇http://m.shnenglu.com/sunicdavy/archive/2014/04/16/206610.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Wed, 16 Apr 2014 12:29:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2014/04/16/206610.htmlhttp://m.shnenglu.com/sunicdavy/comments/206610.htmlhttp://m.shnenglu.com/sunicdavy/archive/2014/04/16/206610.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/206610.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/206610.htmllua5.2鍚? 瀹樻柟寤鴻澶у鏀懼純module/package鏈哄埗, 榪欏鏈哄埗瀵逛簬浣跨敤鑰呮潵璇存槸鏂逛究鐨? 瀵逛簬module鐨勭紪鍐欒呯畝鐩磋鎶撶媯, 鎵鏈塵odule鍚庣殑鍑芥暟瀵筥G鍧囦笉鍙, 榪樿涓涓釜鎵嬪姩鍦╩odule鍓嶈漿鎴恖ocal璋冪敤. 鐩稿綋鍙嶄漢綾? 瀹樻柟寤鴻澶у鎵嬪姩瀹炵幇package鏈哄埗. 鏈崥瀹箣鍓嶆湁瀹炵幇榪? 鍙傝?a title="http://m.shnenglu.com/sunicdavy/archive/2013/12/10/204696.html" href="http://m.shnenglu.com/sunicdavy/archive/2013/12/10/204696.html">http://m.shnenglu.com/sunicdavy/archive/2013/12/10/204696.html

鐢變簬瑕佷嬌鐢╬rotoc-gen-lua, 榪欎笢瑗跨敓鎴愬嚭鏉ョ殑lua渚濈劧浣跨敤瀹樻柟鐨刴odule/package鏈哄埗. 瀵逛簬娓告垙欏圭洰鏉ヨ, 鎯寵繘琛屼竴浜涜嚜瀹氫箟璇誨彇, 鍔犲瘑絳? 灝卞彉寰椾笉鍙兘. 騫稿ソ瀹樻柟鍦ㄦ墿灞曚笂鏀寔鐨勮繕鏄笉閿欑殑.

鍙傝僱ua5.2鐨勫畼鏂規枃妗?a title="http://www.lua.org/manual/5.2/manual.html#pdf-require" >http://www.lua.org/manual/5.2/manual.html#pdf-require

require鏃? lua浼氳嚜鍔ㄦ牴鎹竴瀹氱殑鎼滅儲瑙勫緥鎵懼埌鍔犺澆浠g爜鐨勬柟娉? 榪欎釜鏂規硶瀹氫箟鍦?a name="pdf-package.searchers">package.searchers榪欎釜鏁扮粍涓? 涓鍏辨湁4涓姞杞芥悳绱㈤『搴?/p>

1. preload, 瀵瑰凡鍔犺澆鐨刴odule榪涜鐩存帴榪斿洖, 瀵瑰簲package.preload[modname]

2. lualoader, 瀵筶ua鏂囦歡榪涜鍔犺澆, 鎼滅儲璺緞涓?a >package.path

3. cloader, 瀵筶ua鏍囧噯dll榪涜鍔犺澆, 鎼滅儲璺緞涓?a >package.cpath

4. croot, 瀹樻柟鏂囨。璇寸殑鏄痑ll-in-one鍔犺澆鍣? 鎰熻寰堢濂? 鎰熷叴瓚e彲浠ヨ嚜琛屽弬鑰冩簮鐮?/p>

閭d箞, 濡傛灉鍙渶瑕佽嚜宸辯殑鍔犺澆鍣? 鍙渶瑕佽繖鏍峰仛:

  package.searchers[2] = function( name )
        print("try to load", name )
    end
    package.searchers[3] = nil
    package.searchers[4] = nil
    
    require "libtest"
    鍙繚鐣檖reload鍔熻兘, 鐒跺悗灝嗙浜屼釜鍔犺澆鍣ㄦ崲鎴愯嚜宸辯殑鍔犺澆鍑芥暟, 絎笁,絎洓鐩存帴灞忚斀



]]>
Qt 4.8.x 鍗囩駭鍒癚t5.x鐨勫悇縐嶅潙http://m.shnenglu.com/sunicdavy/archive/2014/03/01/206000.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Sat, 01 Mar 2014 06:25:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2014/03/01/206000.htmlhttp://m.shnenglu.com/sunicdavy/comments/206000.htmlhttp://m.shnenglu.com/sunicdavy/archive/2014/03/01/206000.html#Feedback3http://m.shnenglu.com/sunicdavy/comments/commentRss/206000.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/206000.htmlQt5 宸叉槗涓? 鑴戞畫鐨勪簨鎯呬篃騫茬殑瓚婃潵瓚婂.

鐪媞t涓嬭澆欏?/a>鐨凲t鐨剋indows鐗堟湰榛樿鎻愪緵32浣嶅拰64浣? 閭d釜鍟pengl鐗堟殏鏃舵湭鐞嗕細

鍥犱負鏈漢緋葷粺鏄痺in7 64bit, 鍥犳姣棤鐞嗙敱鐨勪笅杞戒簡64浣嶇殑qt5.2鐗堟湰. 緙栬瘧浜唄ello world, 緇撴灉鎶ラ敊:

module machine type 'x64' conflicts with target machine type 'X86'

鎵句簡鍗婂ぉ娌℃煡鍒伴敊璇? 鍚庨潰娉ㄦ剰鍒皏s2012鐨勫伐紼嬬紪璇戠被鍨嬮夋嫨鐨勬槸win32 x86, 鎵嶆兂璧鋒槸鐢變簬qt5鐨勬墍鏈塴ib鏄?4浣嶇紪璇? 鑰屾垜浣跨敤32浣嶇殑紼嬪簭鍘婚摼鎺? 褰撶劧瑕佹姤閿?

閲嶆柊涓嬭澆32浣嶇殑qt5.2, 緙栬瘧姝g‘

 

鍙﹀涓涓敊璇篃鏄湪鍓嶉潰鐗堟湰鏋佷負灝戣鐨?

fatal error C1083: Cannot open include file: 鈥橤LES2/gl2.h鈥? No such file or directory

寰堝浜虹殑瑙e喅鏂規硶鏄寘鍚玅tANGLE涓嬬殑gles2鐩綍, 浣嗘槸鐢變簬鎴戠殑宸ョ▼鍐呯殑cocos2dx鏈韓涔熷甫鏈夎繖涓滆タ. 浜庢槸鐮旂┒浜嗕笅涓哄暐榪欑増鏈殑qt榛樿瑕佹悶鐨勯潪瑕佸拰gles鏈夊叧緋?

鏈緇? 鍙戠幇鍙互閫氳繃瀹氫箟QT_NO_OPENGL瀹忔潵灞忚斀opengl鐨勬覆鏌揂PI浣跨敤, 緙栬瘧閫氳繃

 

寰堟槸鎬蹇佃鍩轟簹鏃朵唬鐨剄t, 涓嬭澆,緙栬瘧涓姘斿懙鎴?/p>

]]>
鑷畾涔塗exturePacker鎻掍歡瀵煎嚭鑷繁鐨刾list鏂囦歡http://m.shnenglu.com/sunicdavy/archive/2014/02/06/205645.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Thu, 06 Feb 2014 07:23:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2014/02/06/205645.htmlhttp://m.shnenglu.com/sunicdavy/comments/205645.htmlhttp://m.shnenglu.com/sunicdavy/archive/2014/02/06/205645.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/205645.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/205645.htmlcocos2dx寮曟搸浣跨敤plist鏂囦歡, 涓縐嶇壒孌婄殑xml鏍煎紡浣滀負鍏禷tlas綰圭悊鐨勬弿榪版枃浠? plist閬靛驚鑻規灉鐨剎ml涓璳ey-value鐨勮璁¢鏍?瀵逛簬OC鏉ヨ鏄悎閫傜殑, 浣唜ml鏈韓鎬ц兘浣庝笅, 鍨冨溇鍐呭榪囧, 涔熻plist瀵逛簬楂樻ц兘娓告垙寮曟搸涓嶅啀閫傚悎. 鍥犳, 鐮旂┒TexturePacker鐨勫鍑烘彃浠舵妧鏈?/p>

TexturePacker鐨勮嚜瀹氫箟鎻掍歡鐩綍浣嶄簬鍏跺畨瑁呯洰褰曠殑bin\exporters\涓? 浣嗘湁涓浜涙彃浠跺睘浜庡唴寤烘敮鎸? 渚嬪cocos2dx鐨刾list鏍煎紡, 鍥犳鏃犳硶鎵懼埌瀵瑰簲鎻掍歡

鏈漢鍙傝僺hiva3d鎻掍歡, 瀵瑰簲瀵煎嚭鐣岄潰鐨凞ataFormat涓殑Shiva3D, 蹇熷浼氫簡濡備綍瀵煎嚭

瀹樻柟鏂囨。浣嶄簬http://www.codeandweb.com/texturepacker/documentation/#customization

鎻掍歡鐨勫熀鏈牸寮忓強鍘熺悊鏄?

bin\exporters\涓嬬殑鏌愪竴鐩綍涓嬪瓨鍦ㄧ殑涓涓悕涓篹xporter.xml鏂囦歡浣滀負鎻掍歡鐨勬弿榪?渚嬪:

<exporter version="1.0">
    <!-- identifier of the exporter -->
    <name>shiva3d</name>
 
    <!-- display name of the exporter for the combo box -->
    <displayName>Shiva3D</displayName>
    
    <!-- description of the exporter -->
    <description>Exporter for Shiva3D.</description>
 
    <!-- exporter version -->
    <version>1.0</version>
    
    <!-- currently only one file allowed - more to come with update -->
    <files>
        <file>
            <!-- name of this file variable -->
            <name>xml</name>
 
            <!-- human readable name (for GUI) -->
            <displayName>XML</displayName>
 
            <!-- file extension for the file -->
            <fileExtension>xml</fileExtension>
 
            <!-- name of the template file -->
            <template>shiva.xml</template>
        </file>
    </files>
 
    <!-- target framework supports trimming -->
    <supportsTrimming>false</supportsTrimming>
 
    <!-- target framework supports rotated sprites -->
    <supportsRotation>true</supportsRotation>
 
    <!-- rotated sprites direction (cw/ccw) -->
    <rotationDirection>cw</rotationDirection>
 
    <!-- supports npot sizes -->
    <supportsNPOT>true</supportsNPOT>
 
    <!-- supports file name stripping (remove .png etc) -->
    <supportsTrimSpriteNames>yes</supportsTrimSpriteNames>
 
    <!-- supports texure subpath -->
    <supportsTextureSubPath>yes</supportsTextureSubPath>
 
</exporter>
 
 

 

鍦═emplate瀛楁涓? 鎻忚堪鍚岀洰褰曠殑瀵煎嚭鏂囦歡鏍煎紡妯℃澘. TexturePacker浣跨敤涓縐嶅彨Grantlee鐨勬ā鏉垮紩鎿?綾諱技浜嶱ython浣跨敤鐨凞jango妯℃澘寮曟搸, 鏂囨。鍙傝:Grantlee Documentation. 綆鍗曠殑鏂囨湰鏍煎紡鍙互鍙傝僺hiva.xml蹇熷浼?/p>

榪欓噷鎴戜滑浣跨敤protobuf鐨勬枃鏈牸寮?鏋佷負綾諱技json)瀵煎嚭plist, 涓嬮潰鏄鍑烘ā鏉?/p>

 

{% for sprite in allSprites %}
Sprite {
    Name: "{{sprite.trimmedName}}"
    FrameX: {{sprite.frameRect.x}}
    FrameY: {{sprite.frameRect.y}}
    FrameWidth: {{sprite.frameRectWithoutRotation.width}}
    FrameHeight: {{sprite.frameRectWithoutRotation.height}}
    OffsetX: {{sprite.cornerOffset.x}}
    OffsetY: {{sprite.cornerOffset.y}}
    OriginalWidth: {{sprite.untrimmedSize.width}}
    OriginalHeight: {{sprite.untrimmedSize.height}}
    {% if sprite.rotated %}Rotated: true {% endif %}
}
{% endfor %}

瀵煎嚭鐨勭粨鏋滅被浼間簬:

 
Sprite {
    Name: "car01"
    FrameX: 100
    FrameY: 129
    FrameWidth: 76
    FrameHeight: 47
    OffsetX: 0
    OffsetY: 0
    OriginalWidth: 76
    OriginalHeight: 47
    Rotated: true 
}
 
Sprite {
    Name: "car02"
    FrameX: 100
    FrameY: 51
    FrameWidth: 76
    FrameHeight: 47
    OffsetX: 0
    OffsetY: 0
    OriginalWidth: 76
    OriginalHeight: 47
    Rotated: true 
}

...

瀵煎嚭鎻掍歡榪樻敮鎸乯s鎵╁睍, 鍏蜂綋鍐呭璇風戶緇弬鑰冨畼鏂規枃妗? 浣嗗浜庣畝鍗曠殑鏂囨湰鏍煎紡, 榪欑鏂瑰紡宸茬粡瓚沖浜?/p>

瀵規瘮plist鍚? 鍙戠幇plist涓殑鍨冨溇淇℃伅鏋佷負澶? 鑰屼笖浣滀負spriteframe鐨刵ame灞呯劧甯︽湁鎵╁睍鍚?..  鍥犳鑴辯plist,緙栧啓鑷繁鐨勫鍑烘彃浠舵墠鏄帇閬?



]]>
Qt鎶鏈紭鍔?/title><link>http://m.shnenglu.com/sunicdavy/archive/2014/01/14/205359.html</link><dc:creator>鎴橀瓊灝忕瓚</dc:creator><author>鎴橀瓊灝忕瓚</author><pubDate>Tue, 14 Jan 2014 03:53:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2014/01/14/205359.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/205359.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2014/01/14/205359.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/205359.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/205359.html</trackback:ping><description><![CDATA[<p>1. Qt榪欎釜C++鐨勫浘褰㈠簱鐢盩rolltech鍦?994騫村乏鍙沖紑鍙戙傚畠鍙互榪愯鍦╓indows,Mac OS X, Unix錛岃繕鏈夊儚Sharp Zaurus榪欑被宓屽叆寮忕郴緇熶腑銆俀t鏄畬鍏ㄩ潰鍚戝璞$殑銆?<p>2. Qt鐨勬灦鏋勬槑鏄炬槸緇忚繃綺懼績璁捐鐨勯潰鍚戝璞$殑銆俀t鍥犳鍦ㄥ懡鍚嶏紝緇ф壙錛岀被鐨勭粍緇囩瓑鏂歸潰淇濇寔浜嗕紭縐鐨勪竴鑷存с備綘鍙渶瑕佹彁渚涘敮涓涓涓柟娉曠殑鍙傛暟錛屼粎姝や竴涓傚湪涓嶅悓鐨勭被涓皟鐢ㄦ柟寮忎篃鏄湁寰堝己鐨勮繛璐с傝繑鍥炲間篃寰堟湁閫昏緫鎬с傛墍鏈変竴鍒囪揪鍒頒簡綆鍗曞拰寮哄ぇ鐨勫拰璋愮粺涓銆備竴鏃︿綘浣跨敤浜嗗叾涓竴涓被錛屽叾浠栫殑綾諱篃灝辮Е綾繪梺閫氾紝鍥犱負浠栦滑鏄竴鑷寸殑銆?<p>3. Qt涓嶅己鍒朵嬌鐢ㄤ換浣曡璁℃ā寮忋傚鏋滀綘璁や負鎭板綋錛屼嬌鐢―ocument/view娌℃湁浠諱綍闂銆備笉浣跨敤涔熸病鏈変換浣曢棶棰樸?<p>4. MFC鏄簨浠墮┍鍔ㄧ殑鏋舵瀯銆傝鎵ц浠諱綍鎿嶄綔錛岄兘蹇呴』鏄鐗瑰畾鐨勬秷鎭綔鍑哄搷搴斻俉indows瀵瑰簲鐢ㄧ▼搴忓彂閫佺殑淇℃伅鏁頒互鍗冭錛岄仐鎲劇殑鏄紝瑕佸垎娓呮榪欎簺鍒嗙箒鑺滄潅鐨勬秷鎭槸寰堝洶闅劇殑錛屽茍涓斿叧浜庤繖鏂歸潰鐨勬枃。迤堜笉鑳藉緢濂界殑瑙e唽櫩欎簺闂銆?br>Qt鐨勬秷鎭満鍒舵槸寤虹珛鍦⊿IGNAL()鍙戦佸拰SLOT()鎺ュ彈鐨勫熀紜涓婄殑銆傝繖涓満鍒舵槸瀵硅薄闂村緩绔嬭仈緋葷殑鏍稿績鏈哄埗銆傚埄鐢⊿IGNAL()鍙互浼犻掍換浣曠殑鍙傛暟銆備粬鐨勫姛鑳介潪甯哥殑寮哄ぇ銆傚彲浠ョ洿鎺ュぇ浼犻掍俊鍙風粰SLOT()錛屽洜姝ゅ彲浠ユ竻妤氱殑鐞嗚В瑕佸彂鐢熺殑浜嬫儏銆備竴涓被鎵鍙戦佺殑淇″彿鐨勬暟閲忛氬父闈炲父鐨勫皬(4鎴栬?)錛屽茍涓旀枃妗d篃闈炲父鐨勯綈鍏ㄣ傝繖璁╀綘鎰熻鍒頒竴鍒囧敖鍦ㄦ帉鎻′箣涓係IGNAL/SLOT鏈哄埗綾諱技浜嶫ava涓璴istener鏈哄埗,涓嶈繃榪欑鏈哄埗鏇村姞杞婚噺綰э紝鍔熻兘鏇撮綈鍏ㄣ?<p>5. Qt鎷ユ湁闈炲父綆鍗曡屽張涓嶅け寮哄ぇ鐨刲ayout鏈哄埗錛屽竷灞鐏墊椿澶氬彉<br>Qt榪樻彁渚涗簡涓涓浘褰㈢敤鎴峰伐鍏鳳紝Qt Designer錛屽彲浠ョ敤鏉ュ府鍔╁緩绔嬬敤鎴風晫闈€傚彲浠ヤ慨鏀規墍浣跨敤鐨勪換浣曟帶浠剁殑灞炴с備笉鐢ㄥ皢浠栦滑鏀懼湪涓ユ牸鐨勪綅緗紝鍙互閫氳繃layout瀹岀編鐨勭粍緇囦粬浠傝繖涓伐鍏鋒墍浜х敓鐨勪唬鐮佹垜浠槸鍙互瀹為檯涓婇槄璇誨茍涓斿彲浠ョ悊瑙g殑銆傜敓鎴愮殑浠g爜鍗曠嫭鏀懼湪涓涓枃浠墮噷錛屽湪緙栫▼鐨勫悓鏃訛紝浣犲彲浠ラ殢蹇冩墍嬈茬殑澶氭閲嶆柊鐢熸垚鐢ㄦ埛鐣岄潰銆?br>Qt Designer鍙互璁╀綘瀹屾垚璁稿鍦∕FC涓笉鍙兘瀹屾垚鐨勪換鍔★紝姣斿鐢ㄩ鍏堝~濂界殑鐢熸垚listview錛屽湪姣忎釜tab涓婄敤涓嶅悓鐨剉iew鏉ヤ嬌鐢╰ab 鎺у埗銆?<p>6. 浣跨敤MFC錛屼竴閮ㄥ垎寮鍙戣繃紼嬭渚濋潬鈥渞esources鈥?鍦ㄥ緢澶氱殑妗堜緥涓紑鍙戣呭繀欏諱嬌鐢ㄤ粬浠傝繖鏍蜂細瀵艱嚧濡備笅鐨勫悗鏋滐細鍑轟簡Visual Studio錛屼綘寰堥毦浣跨敤鍏朵粬鐨勫伐鍏鋒潵瀹屾垚寮鍙戙?br>璧勬簮緙栬緫鍣ㄤ粎鏈夋湁闄愮殑鍔熻兘錛屾瘮濡傦細閫氳繃Dialog緙栬緫鍣ㄤ笉鍙兘鏀瑰彉鎵鏈夌殑灞炴э紝涓浜涘睘鎬у彲浠ユ敼鍙橈紝鍙︿竴浜涘睘鎬у垯涓嶅彲鑳芥敼鍙樸?璇戣呮敞錛氫笅闈㈣繕鏈変袱鏉¢檲榪癕FC緙虹偣鐨勫疄渚嬶紝浣嗘垜鎰熻榪欎簺宸茬粡澶熻鏄庨棶棰樹簡錛屾殏鏃跺垹鑺備笉璇?<br>鐒惰孮t騫舵病鏈夎祫婧愮殑姒傚康錛岃繖灝辮В鍐充簡浠ヤ笂鎵鎻愬埌鐨勯棶棰樸俀t鎻愪緵浜嗕竴涓剼鏈嬌寰楄兘灝嗙紪鍏ヤ綘鐨勪唬鐮併傚浜庣晫闈㈣璁★紝Qt Designer鍒欏垱寤轟簡鍙鐨勪唬鐮併?<p>7. Qt鐨勬枃妗e畬澶囦笖璇︾粏鐨勮鐩栦簡Qt鐨勬柟鏂歸潰闈紝绔熺劧浠呮湁18M銆傛瘡涓涓被鍜屾柟娉曢兘琚灝芥弿榪幫紝宸ㄧ粏闈¢仐錛屼婦渚嬪厖瀹炪傞氳繃Trolltech鍏徃鎻愪緵鐨勯摼鎺ユ垨鑰呮槸Qt Assistant宸ュ叿錛屽彲浠ユ柟渚跨殑浠庝竴涓被鎴栬呮柟娉曡煩杞埌鍏朵粬鐨勭被銆傛枃。杩樺寘鍚簡涓涓垵瀛﹁呮暀紼嬪拰涓浜涘吀鍨嬪簲鐢ㄧ殑渚嬪瓙 <p>8. 鍦ㄥ彂甯冨熀浜嶮FC鐨勮蔣浠舵椂錛屽繀欏諱緷闈犲瓨鍦ㄤ簬瀹㈡埛鐢佃剳涓婄殑MFC銆備絾鏄繖鏄笉瀹夊叏鐨勶紝鍚屾牱鏄疢FC42.dll錛屽彲浠ュ熀浜庣浉鍚岀殑搴撳緱鍒?涓笉鍚岀殑鐗堟湰銆傞氬父錛岄渶瑕佹鏌ユ槸鍚︽嫢鏈夋紜殑MFC42.dll鐗堟湰錛屽鏋滀笉鏄紝灝卞崌綰у畠銆備絾鏄崌綰FC42.dll浼氭敼鍙樺緢澶氳蔣浠剁殑琛屼負銆?br>Qt鍒欐病鏈夎繖涓闄╋紝鍥犱負Qt鍘嬫牴灝辨病鏈夆滃崌綰ф暣涓郴緇熲濊繖涓蹇點?<p>9. Qt 瀹屽叏鏀寔CSS2錛岃繖浣垮緱Qt搴旂敤紼嬪簭錛屾棤璁烘槸緹庡寲榪樻槸鎹㈣偆錛屽疄鐜拌搗鏉ラ兘鐩稿綋綆鍗?<p>10. Qt鑷甫緲昏瘧鍣紝鍙互闅忔剰鍒囨崲杞歡璇█ <p>  <p>鍦ㄤ嬌鐢≦t鍔ㄦ侀摼鎺ュ簱鐨勬儏鍐典笅錛屾牴鎹甃GPL鍗忚瑙勫畾錛屾槸鍙互闂簮鍙戝竷浠諱綍褰㈠紡鐨勭▼搴忕殑銆?<p>鍙傝冮摼鎺ワ細 <p>鏉ヨ嚜Qt瀹樻柟璁哄潧鐨勮璁猴細<a >http://qt-project.org/forums/viewthread/2428</a> <p>鍗氬閾炬帴錛?a >http://devbean.blog.51cto.com/448512/313477</a> <p>  <p>  <p>杞嚜:<a >http://blog.csdn.net/superzhaifd/article/details/18224923</a> <a >緲熷啲鐙糭Trump</a> <p>  <p>鏈漢杈冨枩嬈㈢浜岀偣: 涓嶄嬌鐢ㄤ換浣曡璁℃ā寮忔瀯寤哄簳灞? 璁捐妯″紡鍙槸鎬濇兂, 涔熸槸緹佺粖. 澶ч噺浣跨敤鍙細璁╃郴緇熻噧鑲?</p><img src ="http://m.shnenglu.com/sunicdavy/aggbug/205359.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">鎴橀瓊灝忕瓚</a> 2014-01-14 11:53 <a href="http://m.shnenglu.com/sunicdavy/archive/2014/01/14/205359.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>protobuf緙栬瘧涓亣鍒扮殑c compiler cannot create executables閿欒瑙e喅鏂規硶http://m.shnenglu.com/sunicdavy/archive/2014/01/12/205330.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Sun, 12 Jan 2014 10:12:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2014/01/12/205330.htmlhttp://m.shnenglu.com/sunicdavy/comments/205330.htmlhttp://m.shnenglu.com/sunicdavy/archive/2014/01/12/205330.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/205330.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/205330.html鏈榪戜笅杞戒簡鏈鏂扮殑linux mint 16鍜寀buntu 12涓垎鍒皾璇曠紪璇憄rotobuf 2.5.0.浣嗛兘鏄姤c compiler cannot create executables鐨勯敊. 鏌ヨ繃緗戜笂瑙e喅鏂規, 娓呬竴鑹查兘鏄痚xport LIBS=涔嬬被鐨? 鏃犳硶瑙e喅闂. 鏈緇堜竴涓洖甯栧惎鍙戜簡鎴? 浣跨敤apt-get install g++ 鍙戠幇C++緙栬瘧鍣ㄦ牴鏈兘娌″畨鈥?瀹夎瀹屾瘯, 涓鍒囨悶瀹? linux mint瓚婃潵瓚婂ū涔愪簡, 榪瀏++閮戒笉榛樿瑁呬簡鈥?/p>

]]>
瓚呰秺luabind鐨刲uaBridgehttp://m.shnenglu.com/sunicdavy/archive/2013/12/07/204648.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Sat, 07 Dec 2013 06:05:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2013/12/07/204648.htmlhttp://m.shnenglu.com/sunicdavy/comments/204648.htmlhttp://m.shnenglu.com/sunicdavy/archive/2013/12/07/204648.html#Feedback24http://m.shnenglu.com/sunicdavy/comments/commentRss/204648.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/204648.html 

鏈榪戝噯澶囧湪鎵嬫満欏圭洰瀹㈡埛绔腑浣跨敤lua, 浠ュ墠涓鐩村湪鏈嶅姟鍣ㄤ嬌鐢╨uabind. 鍙﹀, tolua++涔熶綋楠岃繃, LuaPlus涔熷湪鏃╁勾鐢ㄨ繃. 浠ヤ笅鏄湰浜哄榪欎簺緇戝畾搴撶殑涓漢鎰熻:

luabind

鍒╃敤boost鏈哄埗鎶婄粦瀹氬仛鍒版瀬鑷? 姣旇緝閫傚悎涓籧++, 寮眑ua鐨勮剼鏈鏋?

浣滆呭凡緇忓仠姝㈡洿鏂? 鍦╳indows/linux緙栬瘧娌¢棶棰? 浣嗘槸鍦╥os鐨凩LVM涓? 鏃犳硶緙栬瘧

tolua++

鍍廲ocos2dx浣跨敤tolua++涔熸槸鍙互鐞嗚В鐨? 閭d箞澶氬嚱鏁伴渶瑕佺粦瀹? tolua++鐨勫ご鏂囦歡parse鍙婅嚜鍔ㄤ唬鐮佺敓鎴愯妭綰︿簡寰堝鎵嬪姩緇戝畾鐨勬椂闂?

浣嗘槸鐪嬪埌浠g爜涓湁涓閮ㄥ垎bugfix灝卞績瀛樹笉瀹?綰釜浜烘劅瑙? 鏈漢浣跨敤涓嶅, 嬈㈣繋鐮栧ご浼哄?,鍙﹀, tolua++鍙兘鐢辮剼鏈眰椹卞姩C++, 鑰屾病鏈夊皢宸茬粡瀹炰緥鍖栫殑鍙ユ焺娉ㄥ唽鍒發ua鐨勫姛鑳戒篃鏄厼絎斿晩

 

LuaPlus

鎺ュ彛杈冧負綆鍗? 閫備簬鍒濆鑰呬笂鎵? 鏃犱換浣曠殑妯℃澘, 鎬ц兘涓嶉珮

 

luaBridge

欏圭洰鍦板潃: https://github.com/vinniefalco/LuaBridge

鎵嬪唽: http://vinniefalco.com/LuaBridge/Manual.html

綰ご鏂囦歡瀹炵幇, 鏃犻渶緙栬瘧, 鍖呭惈榪涘叆宸ョ▼鍗沖彲, 鎺ュ彛綆媧侀珮鏁?/p>

鐩告瘮luabind, 鍞竴涓嶈兘瀹炵幇鐨勫父鐢ㄥ姛鑳藉氨鏄灇涓? 浣嗘槸鍙互鏀寔綾繪垚鍛橀潤鎬佸彉閲忔敞鍐? 榪欎釜灝辨棤鎵璋撲簡, 鎵嬪啓涓涓灇涓炬敮鎸佷篃寰堢畝鍗?/p>

鐪嬩笅婕旂ず浠g爜:

class A
{
public:
    A( )
    {

    }
    virtual void foo( int a )
    {
        printf("foo base\n");
    }

    std::string Member;
};

class B : public A
{
public:
    virtual void foo( int a )
    {
        printf("foo inherited\n");
    }
};
void foo( int b )
{

}

luabridge::getGlobalNamespace(L)
        .beginClass<A>("Sobj")
            .addConstructor<void (*) (void)> ()
            .addFunction("foo", &A::foo)
            .addData("Member",&A::Member)
        .endClass()
        .deriveClass<B, A>("SSec")
            .addFunction("foo",&B::foo )
        .endClass();

    luabridge::getGlobalNamespace(L).addFunction("foo", foo );


    B ins;
    ins.Member = "data";
    luabridge::setGlobal(L, ins, "ins");

lua渚х殑浠g爜

local a = Sobj()
a:foo(2)
a.Member = "hello"


ins:foo(3)


]]>
luabind 0.9.1鍦╞oost 1.49+鍜実cc-4.6.3浠ヤ笂鐗堟湰鐨勭紪璇戦棶棰樺鐞?/title><link>http://m.shnenglu.com/sunicdavy/archive/2013/09/24/203409.html</link><dc:creator>鎴橀瓊灝忕瓚</dc:creator><author>鎴橀瓊灝忕瓚</author><pubDate>Tue, 24 Sep 2013 08:46:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2013/09/24/203409.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/203409.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2013/09/24/203409.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/203409.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/203409.html</trackback:ping><description><![CDATA[<p>灝哹oost鏇存柊鍒?.53鏃? 鍙戠幇luabind姝繪椿緙栬瘧涓嶈繃, 鎶ラ敊濡備笅</p> <p>error: missing binary operator before token "("</p> <p>鏍規嵁鑰佸鐨勬弿榪? boost涓殑BOOST_PP_ITERATION_FLAGS浠?.49鐗堟湰鍚庡彂鐢熶簡涓浜涘彉鍖?</p> <p>鍦╣it鎵懼埌涓涓猵atch, 閾炬帴<a >鍦ㄦ</a></p> <p>浠ヤ笅綆鍗曟弿榪?/p> <p>淇敼call_function.hpp, call_member.hpp鍙妛rapper_base.hpp</p> <p>鍘繪帀#elif BOOST_PP_ITERATION_FLAGS() == 1</p> <p>鏇存崲涓?/p> <p>#else</p> <p>#if BOOST_PP_ITERATION_FLAGS() == 1</p><pre><p>鐒跺悗鍦ㄦ簮鐮佸簳閮ㄥ姞涓涓?endif鍗沖彲</p></pre><img src ="http://m.shnenglu.com/sunicdavy/aggbug/203409.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">鎴橀瓊灝忕瓚</a> 2013-09-24 16:46 <a href="http://m.shnenglu.com/sunicdavy/archive/2013/09/24/203409.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Qt搴旂敤紼嬪簭浣跨敤鍥懼艦瑙g爜鏃犳硶鏄劇ず鐨勯棶棰?/title><link>http://m.shnenglu.com/sunicdavy/archive/2013/08/10/202448.html</link><dc:creator>鎴橀瓊灝忕瓚</dc:creator><author>鎴橀瓊灝忕瓚</author><pubDate>Sat, 10 Aug 2013 01:44:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2013/08/10/202448.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/202448.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2013/08/10/202448.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/202448.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/202448.html</trackback:ping><description><![CDATA[<p>鏈榪戝彂鐜頒竴涓猀t鍐欑殑鍒囧浘杞歡, 瀵煎叆PNG鍥劇墖鍙互鏄劇ず, 鑰孞PEG鍥劇墖鏃犳硶鏄劇ず. 寮鍙戞満姝e父. Google浜嗕竴涓? 鍙戠幇Qt閫氳繃澶栭儴鎻掍歡鏈哄埗鏀寔鍚勭鎵╁睍鍔熻兘. </p> <p>鍦ㄥ惎鍔ㄥ墠, 娣誨姞濡備笅浠g爜:</p> <p>QApplication qapp(argc, argv);    </p> <p>qapp.addLibraryPath(QCoreApplication::applicationDirPath()+"/plugins");<br></p> <p>灝哘T寮鍙戠洰褰曚笅: Qt\4.8.2\plugins\鎷瘋礉鍒癚t鐨別xe鐩綍鍗沖彲</p><img src ="http://m.shnenglu.com/sunicdavy/aggbug/202448.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">鎴橀瓊灝忕瓚</a> 2013-08-10 09:44 <a href="http://m.shnenglu.com/sunicdavy/archive/2013/08/10/202448.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Cygwin鐜涓嬩嬌鐢ˋndroid NDK r8e緙栬瘧boost 1.53http://m.shnenglu.com/sunicdavy/archive/2013/07/20/201993.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Sat, 20 Jul 2013 08:23:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2013/07/20/201993.htmlhttp://m.shnenglu.com/sunicdavy/comments/201993.htmlhttp://m.shnenglu.com/sunicdavy/archive/2013/07/20/201993.html#Feedback2http://m.shnenglu.com/sunicdavy/comments/commentRss/201993.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/201993.html榪欓噷涓嶈兘涓嶈Google紜疄鎼滀簡1澶╅兘娌¤В鍐抽棶棰? baidu絎竴涓氨瑙e喅浜?..

cygwin鍙傝冭繖閲?

http://my.oschina.net/tonywolf/blog/49214

綆鍗曠殑璇?

1.涓嬭澆cygwin鐨勭綉緇滃畨瑁呭寘(絎竴嬈″畨瑁呭彧鑳借繖鏍?

2. 閫夋嫨闈犲墠涓鐐圭殑緗戠珯榪涜涓嬭澆( 涓嬪ソ鐨勫寘鍙互鐣欑潃, 涓嬫瀹夎鐩存帴浠庢枃浠跺す涓夋嫨灝卞彲浠ュ畨瑁?

cygwin涓嬩嬌鐢∟DK緙栬瘧boost鍙傝冭繖閲?

http://blog.sina.com.cn/s/blog_a6946c8a01016aot.html

緇嗚妭娉ㄦ剰:

1. boost瀹樼綉涓嬭澆boost_1_53_0.tar.bz2, 瑙e帇鏀懼湪android-ndk-r8e/sources涓?

2. 鐢熸垚boost緙栬瘧宸ュ叿: 鍦╞oost鐩綍涓嬭繍琛?./bootstrap.sh 鎴栬?bootstrap.bat 鐢熸垚 b2

3. 淇敼 boost/tools/build/v2/user-config.jam 鍐呭淇敼濡備笅

import os ;
 
if [ os.name ] = CYGWIN || [ os.name ] = NT {
androidPlatform = windows ;
}
else if [ os.name ] = LINUX {
androidPlatform = linux-x86_64 ;
}
else if [ os.name ] = MACOSX {
androidPlatform = darwin-x86 ;
}
 
modules.poke : NO_BZIP2 : 1 ;
ANDROID_NDK = ../.. ;
using gcc : android4.6 : $(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.6/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-g++ :
<archiver>$(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.6/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ar
<ranlib>$(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.6/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ranlib
<compileflags>--sysroot=$(ANDROID_NDK)/platforms/android-9/arch-arm
<compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.6/include
<compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include
<compileflags>-DNDEBUG
<compileflags>-D__GLIBC__
<compileflags>-DBOOST_FILESYSTEM_VERSION=3
<compileflags>-lstdc++
<compileflags>-lgnustl_shared
<compileflags>-mthumb
<compileflags>-fno-strict-aliasing
<compileflags>-std=gnu++11
<compileflags>-O2
;
 

4. 涓轟簡瀹夊叏璧瘋, 鎴戞墦浜嗕釜BoostForAndriod涓婄殑琛ヤ竵: 鎵嬪姩淇敼涓嬪氨濂戒簡

 

diff -ruN boost_1_53_0-boot/boost/asio/detail/socket_types.hpp boost_1_53_0-patched/boost/asio/detail/socket_types.hpp
--- boost_1_53_0-boot/boost/asio/detail/socket_types.hpp     2012-01-15 14:46:25.000000000 +0100
+++ boost_1_53_0-patched/boost/asio/detail/socket_types.hpp     2012-06-27 19:19:01.279562338 +0200
@@ -123,7 +123,12 @@
typedef int socket_type;
const int invalid_socket = -1;
const int socket_error_retval = -1;
+// @Moss - Some platforms do not define it (Android)
+#if defined(INET_ADDRSTRLEN)
const int max_addr_v4_str_len = INET_ADDRSTRLEN;
+#else // defined(INET_ADDRSTRLEN)
+const int max_addr_v4_str_len = 16;
+#endif // defined(INET_ADDRSTRLEN)
#if defined(INET6_ADDRSTRLEN)
const int max_addr_v6_str_len = INET6_ADDRSTRLEN + 1 + IF_NAMESIZE;
#else // defined(INET6_ADDRSTRLEN)
diff -ruN boost_1_53_0-boot/boost/asio/ip/impl/address_v6.ipp boost_1_53_0-patched/boost/asio/ip/impl/address_v6.ipp
--- boost_1_53_0-boot/boost/asio/ip/impl/address_v6.ipp     2012-01-15 14:46:25.000000000 +0100
+++ boost_1_53_0-patched/boost/asio/ip/impl/address_v6.ipp     2012-06-27 19:19:11.029581297 +0200
@@ -11,6 +11,23 @@
#ifndef BOOST_ASIO_IP_IMPL_ADDRESS_V6_IPP
#define BOOST_ASIO_IP_IMPL_ADDRESS_V6_IPP
 
+// @Moss - Define IPv6 macros
+#if !defined(IN6_IS_ADDR_MULTICAST) 
+#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
+#endif
+
+#if !defined(IN6_IS_ADDR_MC_NODELOCAL)
+#define IN6_IS_ADDR_MC_NODELOCAL(a) \
+        (IN6_IS_ADDR_MULTICAST(a) \
+         && ((((__const uint8_t *) (a))[1] & 0xf) == 0x1))
+#endif
+
+#if !defined(IN6_IS_ADDR_MC_GLOBAL)
+#define IN6_IS_ADDR_MC_GLOBAL(a) \
+        (IN6_IS_ADDR_MULTICAST(a) \
+         && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
+#endif
+
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
diff -ruN boost_1_53_0-boot/boost/config/user.hpp boost_1_53_0-patched/boost/config/user.hpp
--- boost_1_53_0-boot/boost/config/user.hpp     2004-01-10 13:10:00.000000000 +0100
+++ boost_1_53_0-patched/boost/config/user.hpp     2012-06-27 19:18:46.129532736 +0200
@@ -13,6 +13,15 @@
//  configuration policy:
//
 
+// Android defines
+#define __arm__ 1
+#define _REENTRANT 1
+#define _GLIBCXX__PTHREADS 1
+// There is problem with std::atomic on android (and some other platforms).
+// See this link for more info:
+// https://code.google.com/p/android/issues/detail?id=42735#makechanges
+#define BOOST_ASIO_DISABLE_STD_ATOMIC 1
+
// define this to locate a compiler config file:
// #define BOOST_COMPILER_CONFIG <myheader>
 
diff -ruN boost_1_53_0-boot/boost/detail/endian.hpp boost_1_53_0-patched/boost/detail/endian.hpp
--- boost_1_53_0-boot/boost/detail/endian.hpp     2011-03-29 23:58:48.000000000 +0200
+++ boost_1_53_0-patched/boost/detail/endian.hpp     2012-06-27 19:18:39.359519453 +0200
@@ -31,7 +31,7 @@
// GNU libc offers the helpful header <endian.h> which defines
// __BYTE_ORDER
 
-#if defined (__GLIBC__)
+#if defined (__GLIBC__) || defined(ANDROID)
# include <endian.h>
# if (__BYTE_ORDER == __LITTLE_ENDIAN)
#  define BOOST_LITTLE_ENDIAN
diff -ruN boost_1_53_0-boot/boost/interprocess/detail/workaround.hpp boost_1_53_0-patched/boost/interprocess/detail/workaround.hpp
--- boost_1_53_0-boot/boost/interprocess/detail/workaround.hpp     2011-12-26 18:21:36.000000000 +0100
+++ boost_1_53_0-patched/boost/interprocess/detail/workaround.hpp     2012-06-27 19:18:52.909546004 +0200
@@ -54,7 +54,7 @@
    #endif
 
    //Check for XSI shared memory objects. They are available in nearly all UNIX platforms
-   #if !defined(__QNXNTO__)
+   #if !defined(__QNXNTO__) && !defined(ANDROID)
       #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
    #endif
 
diff -ruN boost_1_53_0-boot/libs/filesystem/src/operations.cpp boost_1_53_0-patched/libs/filesystem/src/operations.cpp
--- boost_1_53_0-boot/libs/filesystem/src/operations.cpp     2012-01-28 15:40:16.000000000 +0100
+++ boost_1_53_0-patched/libs/filesystem/src/operations.cpp     2012-06-27 19:19:19.269597266 +0200
@@ -73,13 +73,15 @@
     const fs::path dot_dot_path("..");
#   include <sys/types.h>
#   include <sys/stat.h>
-#   if !defined(__APPLE__) && !defined(__OpenBSD__)
+#   if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__ANDROID__) && !defined(ANDROID)
#     include <sys/statvfs.h>
#     define BOOST_STATVFS statvfs
#     define BOOST_STATVFS_F_FRSIZE vfs.f_frsize
#   else
#     ifdef __OpenBSD__
#     include <sys/param.h>
+#     elif defined(__ANDROID__) || defined(ANDROID) // @Moss - Android messes up a bit with some headers, this one is the correct one :D
+#     include <sys/vfs.h>
#     endif
#     include <sys/mount.h>
#     define BOOST_STATVFS statfs
@@ -206,7 +208,19 @@
          || ::mkdir(to.c_str(),from_stat.st_mode)!= 0))
#   define BOOST_COPY_FILE(F,T,FailIfExistsBool)copy_file_api(F, T, FailIfExistsBool)
#   define BOOST_MOVE_FILE(OLD,NEW)(::rename(OLD, NEW)== 0)
+#if defined(__ANDROID__) || defined(ANDROID)
+    int BOOST_RESIZE_FILE(const char *path, off_t size)
+    {
+      int result = -1;
+      int fd = open(path, O_WRONLY);
+      if (fd != -1)
+        result = ftruncate(fd, size);
+      close(fd);
+      return result;
+    }
+#else
#   define BOOST_RESIZE_FILE(P,SZ)(::truncate(P, SZ)== 0)
+#endif
 
#   define BOOST_ERROR_NOT_SUPPORTED ENOSYS
#   define BOOST_ERROR_ALREADY_EXISTS EEXIST

 

5. 鍛戒護琛岀紪璇?

./b2 --without-python --without-mpi --without-serialization toolset=gcc-android4.6 link=static runtime-link=static target-os=linux --stagedir=android

浣跨敤緙栬瘧瀹屾垚鐨刡oost搴?

1. 灝嗙紪璇慴oost_1_53_0\android\lib\ 涓嬬殑.a搴?鍙奲oost_1_53_0\boost\涓嬬殑澶存枃浠舵嫹璐濆嚭鏉ユ斁鍦ㄥ伐紼嬬殑boost4android鐩綍涓?

2. 鍦╞oost4android鐩綍涓?鍒涘緩Android.mk, 鍐呭濡備笅

LOCAL_PATH:= $(call my-dir)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_atomic
LOCAL_SRC_FILES:= lib/libboost_atomic.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_chrono
LOCAL_SRC_FILES:= lib/libboost_chrono.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_context
LOCAL_SRC_FILES:= lib/libboost_context.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_date_time
LOCAL_SRC_FILES:= lib/libboost_date_time.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_exception
LOCAL_SRC_FILES:= lib/libboost_exception.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_filesystem
LOCAL_SRC_FILES:= lib/libboost_filesystem.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_graph
LOCAL_SRC_FILES:= lib/libboost_graph.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_iostreams
LOCAL_SRC_FILES:= lib/libboost_iostreams.a 
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_math_c99
LOCAL_SRC_FILES:= lib/libboost_math_c99.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_math_c99f
LOCAL_SRC_FILES:= lib/libboost_math_c99f.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_math_c99l
LOCAL_SRC_FILES:= lib/libboost_math_c99l.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_math_tr1
LOCAL_SRC_FILES:= lib/libboost_math_tr1.a 
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_math_tr1f
LOCAL_SRC_FILES:= lib/libboost_math_tr1f.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_math_tr1l
LOCAL_SRC_FILES:= lib/libboost_math_tr1l.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_program_options
LOCAL_SRC_FILES:= lib/libboost_program_options.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_random
LOCAL_SRC_FILES:= lib/libboost_random.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_regex
LOCAL_SRC_FILES:= lib/libboost_regex.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_system
LOCAL_SRC_FILES:= lib/libboost_system.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_thread
LOCAL_SRC_FILES:= lib/libboost_thread.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE:= boost_timer
LOCAL_SRC_FILES:= lib/libboost_timer.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_STATIC_LIBRARY)
 
鍙互鏍規嵁鑷繁鐨勯渶瑕佽皟鏁翠互涓婂寘鍚?/div>
 
3. 鍦ㄥ簲鐢ㄧ▼搴忕殑Android.mk涓坊鍔?/div>

LOCAL_WHOLE_STATIC_LIBRARIES += boost_system
LOCAL_WHOLE_STATIC_LIBRARIES += boost_filesystem
LOCAL_WHOLE_STATIC_LIBRARIES += boost_thread

鐢ㄥ灝? 鍖呭灝?/p>

娣誨姞寮傚父鏀寔 LOCAL_CPPFLAGS += 鈥揻exceptions

 

娣誨姞妯″潡寮曠敤

$(call import-module,boost4android)



]]>Google Protocolbuf 鏂囨湰鏍煎紡鐨勮В鏋?/title><link>http://m.shnenglu.com/sunicdavy/archive/2013/07/09/201643.html</link><dc:creator>鎴橀瓊灝忕瓚</dc:creator><author>鎴橀瓊灝忕瓚</author><pubDate>Tue, 09 Jul 2013 10:29:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2013/07/09/201643.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/201643.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2013/07/09/201643.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/201643.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/201643.html</trackback:ping><description><![CDATA[<p>protobuf灝辨槸涓烘噿浜鴻岄犵殑宸ュ叿, 鍟ュ崗璁? 鍟ラ厤緗枃浠? 緇熺粺瀹氫箟proto, 瑙f瀽灝眔k, 闈炲父鏂逛究</p> <p> </p> <p>鏂囨湰鏍煎紡鐨勮В鏋愰敊璇笉鑳戒嬌鐢ㄦ崟鑾烽敊璇潵鑾峰彇, 鍥犳,鎴戜滑闇瑕佷嬌鐢ㄨ嚜瀹氫箟鐨勯敊璇敹闆嗗櫒榪涜鏀墮泦, 鐪嬩唬鐮?</p> <div id="hvzpftn" class="csharpcode"><pre class="alt">#include <google/protobuf/text_format.h></pre><pre>#include <google/protobuf/io/zero_copy_stream_impl_lite.h></pre><pre class="alt">#include <google/protobuf/io/tokenizer.h></pre><pre> </pre><pre class="alt"><span id="hvzpftn" class="kwrd">class</span> PBTextErrorCollector : <span id="hvzpftn" class="kwrd">public</span> google::protobuf::io::ErrorCollector</pre><pre>{</pre><pre class="alt"><span id="hvzpftn" class="kwrd">public</span>:</pre><pre> PBTextErrorCollector( <span id="hvzpftn" class="kwrd">const</span> std::<span id="hvzpftn" class="kwrd">string</span>& FileName )</pre><pre class="alt"> : mFileName( FileName )</pre><pre> {</pre><pre class="alt"> </pre><pre> }</pre><pre class="alt"> </pre><pre> <span id="hvzpftn" class="kwrd">virtual</span> <span id="hvzpftn" class="kwrd">void</span> AddError(<span id="hvzpftn" class="kwrd">int</span> line, <span id="hvzpftn" class="kwrd">int</span> column, <span id="hvzpftn" class="kwrd">const</span> <span id="hvzpftn" class="kwrd">string</span>& message)</pre><pre class="alt"> {</pre><pre> CCLog(<span id="hvzpftn" class="str">"%s(%d:%d) %s "</span>, mFileName.c_str(), line, column, message.c_str() );</pre><pre class="alt"> }</pre><pre> </pre><pre class="alt"> <span id="hvzpftn" class="kwrd">virtual</span> <span id="hvzpftn" class="kwrd">void</span> AddWarning(<span id="hvzpftn" class="kwrd">int</span> line, <span id="hvzpftn" class="kwrd">int</span> column, <span id="hvzpftn" class="kwrd">const</span> <span id="hvzpftn" class="kwrd">string</span>& message) </pre><pre> {</pre><pre class="alt"> CCLog(<span id="hvzpftn" class="str">"%s(%d:%d) %s "</span>, mFileName.c_str(), line, column, message.c_str() );</pre><pre> }</pre><pre class="alt"> </pre><pre><span id="hvzpftn" class="kwrd">private</span>:</pre><pre class="alt"> std::<span id="hvzpftn" class="kwrd">string</span> mFileName;</pre><pre>};</pre><pre class="alt"> </pre></div> <style type="text/css">.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } </style> <p>瑙f瀽浠g爜</p> <div id="hvzpftn" class="csharpcode"><pre class="alt">google::protobuf::TextFormat::Parser P; </pre><pre> P.RecordErrorsTo( &PEC );</pre><pre class="alt"> P.Parse( &AIS, &AF );</pre></div> <style type="text/css">.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } </style> <p> </p> <p>鍙﹀: 鏂囨湰鏍煎紡鐨勬敞閲婁嬌鐢╱nix shell椋庢牸: 浠?寮澶?/p> <p>涓嬮潰鏄垜鐨勬枃鏈牸寮忕殑閰嶇疆鏂囦歡</p> <p> </p><pre class="csharpcode">AnchorPointX: 0.5 AnchorPointY: 0 SpriteScale: 2 ComponentName: <span id="hvzpftn" class="str">"ActorActionManager"</span> ComponentName: <span id="hvzpftn" class="str">"ActorFrameEventDispatcher"</span> <span id="hvzpftn" class="rem">#ComponentName: "SoundFXController"</span> ComponentName: <span id="hvzpftn" class="str">"RoleDeltaMoveController"</span> ComponentName: <span id="hvzpftn" class="str">"RoleBehaviorDirector"</span> InitAction: AA_Idle Animations { AnimationName: <span id="hvzpftn" class="str">"mai_idle"</span> AnimationInterval: 0.067 } </pre> <style type="text/css">.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } </style><img src ="http://m.shnenglu.com/sunicdavy/aggbug/201643.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">鎴橀瓊灝忕瓚</a> 2013-07-09 18:29 <a href="http://m.shnenglu.com/sunicdavy/archive/2013/07/09/201643.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>NDK涓惎鐢╟++0xhttp://m.shnenglu.com/sunicdavy/archive/2013/07/01/201426.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Mon, 01 Jul 2013 08:09:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2013/07/01/201426.htmlhttp://m.shnenglu.com/sunicdavy/comments/201426.htmlhttp://m.shnenglu.com/sunicdavy/archive/2013/07/01/201426.html#Feedback1http://m.shnenglu.com/sunicdavy/comments/commentRss/201426.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/201426.htmlc++0x涓凡緇忔坊鍔犱簡璇稿function, bind絳夐渶瑕乥oost鏀寔鐨勫姛鑳? 涓嶅啀闇瑕佺紪璇戝鏉傜殑boost浜?/p>

鍦ㄤ綘鐨凙ndroid.mk鏂囦歡涓坊鍔?LOCAL_CPPFLAGS += -std=gnu++0x鍗沖彲



]]>
紼嬪簭寮傚父VC璋冭瘯鍣ㄦ棤娉曞畾浣嶇殑澶勭悊http://m.shnenglu.com/sunicdavy/archive/2013/06/27/201339.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Thu, 27 Jun 2013 03:05:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2013/06/27/201339.htmlhttp://m.shnenglu.com/sunicdavy/comments/201339.htmlhttp://m.shnenglu.com/sunicdavy/archive/2013/06/27/201339.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/201339.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/201339.html鏈榪戣皟璇曠▼搴忓彂鐜扮┖鎸囬拡鑰佹棤娉曞畾浣? 浣跨敤涓涓渶綆鍗曠殑main鍑芥暟鍋氱┖鎸囬拡媯鏌ヤ篃涓鏍? 鍏蜂綋鐥囩姸瑙佸浘

image

pdb鍔犺澆鏄甯哥殑, 浣嗘槸鍫嗘爤娌℃樉紺哄姝ょ畝鍗曠殑絀烘寚閽堣闂綅緗? Google浜嗕互涓?/p>

http://blogs.msdn.com/b/debugger/archive/2010/05/12/visual-studio-debugger-fails-to-catch-unhandled-exception-for-a-windows-form-or-wpf-application.aspx

瑙e喅鏂規硶: Debug->Exception涓皢鎵鏈夊紓甯稿嬀閫夊嵆鍙?/p>

 

涓嶇煡閬撳摢閲岀殑璁劇疆瀵艱嚧濡傛璇″紓鐨勯棶棰? 瀹崇殑鎴戦噸瑁呬竴嬈?.



]]>
Android騫沖彴涓婲DK緙栬瘧protocolbuff渚嬪瓙http://m.shnenglu.com/sunicdavy/archive/2013/06/17/201070.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Mon, 17 Jun 2013 03:40:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2013/06/17/201070.htmlhttp://m.shnenglu.com/sunicdavy/comments/201070.htmlhttp://m.shnenglu.com/sunicdavy/archive/2013/06/17/201070.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/201070.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/201070.html鍏堣涓嬫垜鐨勫伐紼嬬洰褰?/p>

ProjectName\

src\

  core\

  share\

  proj.android\

    jni\

    鈥?/p>

sdk\

  protobuf-2.4.1\

    src\

    鈥?/p>

浠嶨oogle code涓嬭澆protobuf-2.4.1婧愮爜鍖? 瑙e帇, 鍦╬rotobuf-2.4.1鐩綍涓嬫坊鍔燗ndroid.mk, 鍐呭濡備笅

LOCAL_PATH := $(call my-dir)
 
include $(CLEAR_VARS)
 
LOCAL_MODULE := protobuf-2.4.1
 
LOCAL_SRC_FILES := \
src/google/protobuf/io/coded_stream.cc                \
src/google/protobuf/io/printer.cc                     \
src/google/protobuf/io/gzip_stream.cc                 \
src/google/protobuf/io/tokenizer.cc                   \
src/google/protobuf/io/zero_copy_stream.cc            \
src/google/protobuf/io/zero_copy_stream_impl.cc       \
src/google/protobuf/io/zero_copy_stream_impl_lite.cc  \
src/google/protobuf/stubs/common.cc                   \
src/google/protobuf/stubs/once.cc                     \
src/google/protobuf/stubs/structurally_valid.cc       \
src/google/protobuf/stubs/strutil.cc                  \
src/google/protobuf/stubs/substitute.cc               \
src/google/protobuf/compiler/importer.cc              \
src/google/protobuf/compiler/parser.cc                \
src/google/protobuf/descriptor.cc                     \
src/google/protobuf/descriptor.pb.cc                  \
src/google/protobuf/descriptor_database.cc            \
src/google/protobuf/dynamic_message.cc                \
src/google/protobuf/extension_set.cc                  \
src/google/protobuf/extension_set_heavy.cc            \
src/google/protobuf/generated_message_reflection.cc   \
src/google/protobuf/generated_message_util.cc         \
src/google/protobuf/message.cc                        \
src/google/protobuf/message_lite.cc                   \
src/google/protobuf/reflection_ops.cc                 \
src/google/protobuf/repeated_field.cc                 \
src/google/protobuf/service.cc                        \
src/google/protobuf/text_format.cc                    \
src/google/protobuf/unknown_field_set.cc              \
src/google/protobuf/wire_format.cc                    \
src/google/protobuf/wire_format_lite.cc               \
 
 
LOCAL_C_INCLUDES := $(LOCAL_PATH) \
                    $(LOCAL_PATH)/src
                   
 
include $(BUILD_STATIC_LIBRARY)

姝ゆ椂緙栬瘧浼氭姤config.h鎵句笉鍒扮殑閿欒, 榪欎釜鏂囦歡鍦╲sproject鐩綍鏈? 浣嗗彧鏄疺C緙栬瘧浣跨敤,  榪欑瘒鏂囩珷璇撮渶瑕佹墜鍔ㄥ垱寤? 浣嗗疄闄呬笂, Linux涓嬪彲浠ラ氳繃config緋葷粺鑷姩鐢熸垚鐨? 浣嗘槸Android騫沖彴涓?涓嶄嬌鐢╟ygwin鏃? 灝遍渶瑕佽嚜宸辨墜鍔ㄥ垱寤篶onfig.h, 鍐呭濡備笅

/*
    This make file is only for android ONLY, modified by Davy Xu June 17, 2013
    Cause android platform can't use linux config system when cygwin envirement is not available
*/
 
/* the location of <hash_set> */
#define HASH_SET_H <ext/hash_set>
#define HASH_MAP_H <ext/hash_map>
#define HASH_NAMESPACE __gnu_cxx
 
/* define if the compiler has hash_map */
//#define HAVE_HASH_MAP 1
 
/* define if the compiler has hash_set */
//#define HAVE_HASH_SET 1
 
#define HAVE_PTHREAD

鍓╀笅鐨勪簨鎯呭氨綆鍗曚簡, 鍦ㄤ綘鐨勫伐紼婣ndroid.mk閲屾坊鍔爌rotobuf鐨勫紩鐢?/p>

渚嬪:

LOCAL_WHOLE_STATIC_LIBRARIES += protobuf-2.4.1

$(call import-module,protobuf-2.4.1)

榪樿鍦∟DK_MODULE_PATH涓鍔犳悳绱㈣礬寰凞:\Develop\ProjectName\sdk\

娉ㄦ剰, 榪欓噷protobuf-2.4.1鍚嶇О蹇呴』涓巗dk涓嬬殑鏂囦歡澶瑰悕, LOCAL_MODULE涓殑鍚嶇О淇濇寔涓鑷? 鍚﹀垯鎼滅儲涓嶅埌



]]>
鏈渚挎嵎鐨凙ndroid鐜閮ㄧ講cocos2dx紼嬪簭http://m.shnenglu.com/sunicdavy/archive/2013/06/09/200904.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Sun, 09 Jun 2013 09:55:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2013/06/09/200904.htmlhttp://m.shnenglu.com/sunicdavy/comments/200904.htmlhttp://m.shnenglu.com/sunicdavy/archive/2013/06/09/200904.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/200904.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/200904.html鏈枃鏁翠釜閮ㄧ講榪囩▼鏃犻渶涓嬭澆鍙婂畨瑁呬嬌鐢–ygwin鐜錛?浠ヤ笅閮ㄧ講榪囩▼闇瑕佺敤鍒扮殑紼嬪簭鍙婄増鏈?

璇鋒敞鎰忎笅杞藉搴斾綘緋葷粺鐨勭増鏈? 64浣嶇郴緇熻淇濊瘉鍚庢枃鍏ㄧ郴浣跨敤64浣嶇▼搴? 浠ュ厤閬囧埌涓嶅繀瑕佺殑楹葷儲

1.JDK&JRE       JAVA榪愯鏃跺強寮鍙戝寘

2.ADT               鏄疎clipse鐨勪竴涓彃浠訛紝榪欎竴姝ユ槸涓轟簡綆$悊瀹夊崜寮鍙戝簱

http://developer.android.com/sdk/index.html

浣滀負鏂版墜, 璇蜂笅杞紸DT Bundle For Windows, 榪欎釜鐗堟湰宸茬粡鍖呭惈

ADK錛堝畨鍗撳紑鍙戝寘錛? CDT錛圗clipse鐨凜/C++寮鍙戞彃浠訛級鍙婂搴旂殑Eclipse, 鍙互閬垮厤絎竴嬈¢儴緗插嚭鐜扮殑鍚勭鐑﹀績!

3.NDK              鍙湁ADT宸茬粡鍙互榪愯鏅氱殑Andriod紼嬪簭錛屼絾鏄鏋滈渶瑕佺紪璇慍/C++紼嬪簭錛?榪橀渶瑕丯DK

http://developer.android.com/tools/sdk/ndk/index.html

4. cocos2dx 2.0.4鐗堟湰

 

鍑嗗SDK API

涓嬭澆濂紸DT鍚庤В鍘嬶紝 鏈夊涓嬬洰褰?/p>

eclipse\      <- 寮鍙戠幆澧?/p>

sdk\           <- Andriod SDK

SDK Manager.exe     <-- Android寮鍙戝寘綆$悊鍣? 鐢變簬Andriod鐗堟湰杈冨, 鎵浠ユ綆$悊鍣ㄥ彲浠ユ柟渚垮紑鍙戣呴夋嫨閮ㄧ講鐩爣鏈哄櫒

鎵撳紑SDK Manager鍦ˋndroid 2.2(API 8)閲岀殑 SDK Platform, Google APIs鍓嶆墦鍕? 鐐瑰嚮鍙充笅瑙掔殑Instal packages

濡傛灉鎰熻涓嬭澆閫熷害鎱? 鍙互縐繪榪欓噷http://my.oschina.net/heguangdong/blog/17443, 閫夋嫨Andriod紱葷嚎涓嬭澆

榪欓噷鏄笅杞介摼鎺?/p>

http://dl-ssl.google.com/android/repository/google_apis-8_r02.zip

http://dl-ssl.google.com/android/repository/android-2.2_r02-windows.zip

https://dl-ssl.google.com/android/repository/usb_driver_r04-windows.zip

鎶奱ndroid寮澶寸殑鏂囦歡瑙e帇鍒皃latforms鐩綍涓?/p>

鎶奼oole_apis寮澶寸殑鏂囦歡瑙e帇鍒癮dd-ons鐩綍涓?/p>

鎶妘sb_driver_r03-windows.zip瑙e帇鍒皍sb_driver鐩綍涓嬨?/p>

Eclipse瀵煎叆宸ョ▼

鎵撳紑Eclipse

瀵煎叆Cocos2dx渚嬪瓙宸ョ▼:

Eclipse涓璅ile->New->Other...閫夋嫨Andriod Project from Existing Code

鍦↖mport Projects鐨凴oot Directory涓鍏:\Develop\RevWar\sdk\cocos2d-2.0-x-2.0.4\samples\HelloCpp\proj.android\

娉ㄦ剰, 涓嶈閫変腑 Copy project into workspace, 鍚﹀垯璺緞緙栦貢寰堥毦緙栬瘧鎴愬姛

 

瀵煎叆cocos2dx鐨刯ava妗嗘灦

鍦╯rc鐩綍涓璶ew package, 杈撳叆org.cocos2dx.lib, 鍦╫rg.cocos2dx.lib鐨刾ackage涓偣Import-> FileSystem

閫変腑鐩綍D:\Develop\RevWar\sdk\cocos2d-2.0-x-2.0.4\cocos2dx\platform\android\java\src\org\cocos2dx\lib\, 鐐歸夋墍鏈塲ava鏂囦歡

宸ョ▼Properties->Builder->New->Program

鍦∕ain鏍囩涓~鍐?/strong>

濉啓NDK緙栬瘧鍛戒護琛?D:\Develop\android-ndk-r8e\ndk-build.cmd

鐐瑰嚮Browser Workspace閫変腑褰撳墠宸ョ▼,鍑虹幇${workspace_loc:/HelloCpp}

鍒囨崲鍒癊nvironment鏍囩涓~鍐?/strong>

鏂板緩NDK_MODULE_PATH 濉啓D:\Develop\RevWar\sdk\cocos2d-2.0-x-2.0.4\;D:\Develop\RevWar\sdk\cocos2d-2.0-x-2.0.4\cocos2dx\platform\third_party\android\prebuilt\

淇敼cocos2dx鐨凙ndroid.mk, diff濡備笅

@@ -153,6 +153,7 @@

LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jpeg_static

LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libxml2_static

LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libtiff_static

+LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static

# define the macro to compile through support/zip_support/ioapi.c              

LOCAL_CFLAGS := -DUSE_FILE32API

@@ -164,3 +165,4 @@

$(call import-module,libpng)

$(call import-module,libxml2)

$(call import-module,libtiff)

+$(call import-module,CocosDenshion/android)

F&Q

andriod-8闂

淇敼D:\Develop\RevWar\sdk\cocos2d-2.0-x-2.0.4cocos2dx\platform\android\java\project.properties涓殑target=android-8鏀規垚浣犻渶瑕佺殑鐗堟湰

resources.ap_ does not exist

assert鐩綍涓湁璧勬簮鍑洪棶棰? 鎺掓煡鍗沖彲

渚嬪: cocos2d-2.0-x-2.0.4\samples\TestCpp\proj.android\assets\Images\*.pvr.gz

鍚姩Android妯℃嫙鍣ㄦ椂鐨凢ailed to allocate memory: 8闂

璋冩暣鍐呭瓨鍊?璇鋒眰鍐呭瓨澶ぇ瀵艱嚧

api鐗堟湰榪囦綆瀵艱嚧JAVA Symbol鏈畾涔夐棶棰?/strong>

setEGLContextClientVersion undefined

api8(andriod 2.2)鍚庣殑鐗堟湰, 鎵嶆敮鎸乷penGL es 2.0

鑷繁鍋氬伐紼嬮亣鍒扮殑闂D:\Develop\RevWar\sdk\cocos2d-2.0-x-2.0.4\/cocos2dx/platform/android/jni/JniHelper.h:28:18: fatal error: string: No such file or directory

灝哻ocos2dx渚嬪瓙涓殑Application.mk鎷瘋繃鏉? 淇敼涓嬪唴閮ㄥ悕縐板嵆鍙?/p>

璋冭瘯璇峰敖閲忎嬌鐢ㄧ湡鏈? 妯℃嫙鍣ㄩ熷害寰堟參

灝忕背2榛樿鍙兘綆$悊鏂囦歡, 鏃犳硶鐢╝db 榪炴帴, 鍥犳闇瑕佸畨瑁呴┍鍔? USB椹卞姩鐩存帴鍦ㄦ彃鍏ョ數鑴戝悗鐨勮櫄鎷熺洏閲屾壘.. 榪欎釜澶潙浜?.

淇濊瘉姣忔閮借兘閮ㄧ講鏈鏂扮殑紼嬪簭

璇鋒墽琛屾瘡嬈lean, Build project, Debug.  鐪熸満涓婂湪闇瑕佹椂, 浼氬脊鍑哄畨瑁?..

Android鍚姩鏃ュ織

甯︽湁ADT鐨凟clipse涓湁涓涓猯ogcat紿楀彛, 閲岄潰鏈夌郴緇熷強紼嬪簭鏈韓鐨勬棩蹇? 鍙互鍋氳繃婊?鏂逛究媯鏌ラ棶棰? 濡傞渶鑷繁鎵撴棩蹇? 鍙互浣跨敤cocos2dx涓殑LOGD瀹忔潵鍋? 鍘熷瀷鏄痏_android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)

 

Remark

娣誨姞assert鍚? F5鍒鋒柊鍚庡啀緙栬瘧
NDK build鏃?榛樿浠庡伐紼嬬殑jni鐩綍寮濮?

Andriod.mk鐨刬mport 鍘熷垯$(call import-module,妯″潡鍚? 榪欓噷鐨勬ā鍧楀悕蹇呴』涓庣洰褰曞悕, 妯″潡make file涓殑鍚嶇О鎶ョ焊涓鑷?

鍙傝冩枃绔?/strong>

http://www.cnblogs.com/ybgame/archive/2012/06/07/2540693.html

鍙戞枃鏃? Andriod Studio宸茬粡鍙戝竷浜嗕竴孌墊椂闂? 铏界劧鏄祴璇曠増, 浣嗗皢浠h〃鏈潵鏇存柟渚跨殑Andriod鍙戝竷宸ュ叿



]]>
Lua浣跨敤protocolbufhttp://m.shnenglu.com/sunicdavy/archive/2013/04/24/199693.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Wed, 24 Apr 2013 07:44:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2013/04/24/199693.htmlhttp://m.shnenglu.com/sunicdavy/comments/199693.htmlhttp://m.shnenglu.com/sunicdavy/archive/2013/04/24/199693.html#Feedback4http://m.shnenglu.com/sunicdavy/comments/commentRss/199693.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/199693.html鍦?a >https://code.google.com/p/protoc-gen-lua/ 涓嬭澆緗戞槗鍏勫紵鍐欑殑lua鐨刾rotobuf鎻掍歡(緗戞槗閮芥妸pb緇欏紕瀹屼簡,as3鐨勪篃鏄粬浠啓鐨?.)

 

緙栬瘧python鐗堢殑protobuf妯″潡

鍦?a >https://code.google.com/p/protobuf/downloads/list 涓嬭澆瀹樻柟鐨勫師鐢熺増鏈琾rotobuf, 榪欓噷鍙戞枃鏃朵嬌鐢ㄧ殑鏄?.4.1鐗堟湰

緙栬瘧鍑簆rotoc鎵ц鏂囦歡, 鏀句竴浠藉湪protobuf-2.4.1\src\涓?/p>

涓嬭澆python2.7鐗堟湰, 鍦╬rotobuf-2.4.1\python涓嬭繍琛宲ython setup.py install(濡傛灉鎵句笉鍒皃ython璇風粰python緇濆璺緞)

榪欎竴姝? python浼氫笅涓涓泲( 鐪熺殑鏄竴涓猵ython鐨別gg鏂囦歡 ), 鐒跺悗緙栬瘧鍑簆ython鐗堟湰鐨刾rotobuf妯″潡鏀劇疆鍦╬ython涓?/p>

 

鍒朵綔protoc-gen-lua鐨勬壒澶勭悊

鏀句竴浠絧rotoc鍦╬rotoc-gen-lua鐨刾lugin鐩綍

緙栧啓鎵瑰鐞?protoc-gen-lua.bat

@python "%~dp0protoc-gen-lua"

 

鍗忚鐩綍鐢熸垚鑴氭湰

鍦ㄤ綘闇瑕佹斁緗崗璁殑鐩綍緙栧啓濡備笅鎵瑰鐞?/p>

buildproto.bat

rd /S /Q .\%1%
"..\..\src\protoc-gen-lua\plugin\protoc.exe" --plugin=protoc-gen-lua="..\..\src\protoc-gen-lua\plugin\protoc-gen-lua.bat" --lua_out=. %1%.proto

娉ㄦ剰protoc.exe鍙妏rotoc-gen-lua.bat鐨勮礬寰勭鍚堜綘鐨勮礬寰?/p>

鍐嶇紪鍐欒緙栬瘧鐨刾roto鍗忚鐨勬壒澶勭悊generate.bat

call buildproto.bat loginsvc

鎵цgenerate.bat鍚? 灝嗕細緙栬瘧鍚岀洰褰曚笅鐨刲oginsvc.proto,杈撳嚭loginsvc_pb.lua

 

緙栬瘧閾炬帴lua鐨刾b搴?/strong>

灝唒rotoc-gen-lua\protobuf\鐩綍鎷瘋礉鍒頒箣鍓嶇殑鍗忚鐩綍

灝嗗叾涓嬬殑pb.c閾懼叆浣犵殑宸ョ▼, 娉ㄦ剰VS2010鐨刅C涓嬮渶瑕佷慨鏀規簮鐮?/p>

1.灝?#include <endian.h>淇敼涓?/p>

#ifndef _WIN32
     #include <endian.h>
     #endif

閬垮厤鍦╳indows涓嬬己澶辨枃浠舵姤閿?

2. 璋冩暣struct_unpack鍑芥暟鍓嶅嚑琛屼負

static int struct_unpack(lua_State *L)
{
    uint8_t format = luaL_checkinteger(L, 1);
    size_t len;
    const uint8_t* buffer = (uint8_t*)luaL_checklstring(L, 2, &len);
    size_t pos = luaL_checkinteger(L, 3);
    uint8_t out[8];   

    buffer += pos;

閬垮厤VS2010鐨刅C緙栬瘧鍣ㄨ繃浜庢爣鍑? 涓ユ牸瑕佹眰C椋庢牸鍑芥暟鍙橀噺鍓嶇疆澹版槑

鍦╨ua_State澹版槑鍚庢坊鍔犲涓嬩唬鐮?/p>

extern "C" { int luaopen_pb (lua_State *L);}   // 娉ㄦ剰闃插湪鍛藉悕絀洪棿澶栫殑鍏ㄥ眬澹版槑

    luaopen_pb( L );   // 鐩存帴娉ㄥ叆鍏ㄥ眬pb, 閬垮厤鍔ㄦ佸姞杞絧b.dll閫犳垚鐨勪竴緋誨垪璺ㄥ鉤鍙伴棶棰?/p>

 

lua涓嬌鐢╬b

local loginsvc_pb = require “loginsvc_pb”
 
local REQ = loginsvc_pb.CheckVersionREQ()
local Data = REQ:SerializeToString( )
 
local ACK = loginsvc_pb.CheckVersionACK()
ACK:ParseFromString( Data )

 

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

鎴戠殑宸ョ▼鐩綍

script\
        protobuf\
            buildproto.bat
            generate.bat
            loginsvc_pb.lua
            loginsvc.proto
        Main.lua
    src\
        protoc-gen-lua\
            example\
            plugin\
            protobuf\



]]>
鎹曡幏Linux孌甸敊璇?Segment fault)騫朵笖鎵撳嵃閿欒鍫嗘爤http://m.shnenglu.com/sunicdavy/archive/2012/12/29/196809.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Sat, 29 Dec 2012 09:53:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2012/12/29/196809.htmlhttp://m.shnenglu.com/sunicdavy/comments/196809.htmlhttp://m.shnenglu.com/sunicdavy/archive/2012/12/29/196809.html#Feedback3http://m.shnenglu.com/sunicdavy/comments/commentRss/196809.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/196809.htmlLinux涓婅窇鏈嶅姟鍣ㄥ鏋滈亣鍒扮▼搴忓穿婧冩槸涓浠跺緢鑻︽伡鐨勪簨鎯? 鍐嶇鍒伴噸鐜板緢闅劇殑BUG, 浼拌鍙兘閫氳繃浼犵粺鐨勬帓鏌ユ柟娉曡繘琛?

鍦ㄧ紪鍐欐湰鏂囧墠, 絎旇呬嬌鐢ㄨ繃璇稿libunwind絳夊簱榪涜閿欒鏃跺爢鏍堟墦鍗? 浣嗘槸鍏舵湰韜敱浜庨渶瑕佸紩鐢ㄧ涓夋柟搴? 浣跨敤榪樻槸紼嶅井楹葷儲.

緇忚繃Google鍚? 灞呯劧鎵懼埌涓綃?a >濂芥枃, 鍏墮氳繃鎹曡幏SIGSEGV淇″彿, 騫惰揩浣跨▼搴忚繘鍏db璋冭瘯闃舵, 鍒╃敤gdb寮哄ぇ鐨勮皟璇曞姛鑳藉彲浠ヨ繘琛屽悇縐嶉敊璇窡韙? 姝ゆ硶宸蹭笌Windows涓嬬▼搴忓穿婧冨悗寮瑰嚭VC璋冭瘯鍑犱箮鎺ヨ繎.

鎴戝湪姝ゆ枃鍩虹涓? 鎵╁睍浜嗗叾閫氱敤鎬у強渚垮埄鎬?/p>

1. 浣跨敤gdb鐨?-ex鍙傛暟, 鍦ㄦ寕鎺ョ▼搴忓悗, 鎵цbt鎸囦護鎵撳嚭紼嬪簭鍫嗘爤

2. 灝嗕俊鎭噸瀹氬悜鍒拌嚜瀹氫箟鐨勬枃浠?鍦ㄥ榪涚▼閮介渶瑕佽繘琛屽悗鍙拌緭鍑烘椂甯︽潵鏇村ぇ鐨勭伒媧繪? 鍚屾椂涔熻В鍐充簡gdb鍙兘鍦ㄥ墠鍙拌皟璇曠殑闂

浠g爜濡備笅

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>

void dump(int signo)
{
        char buf[1024];
        char cmd[1024];
        FILE *fh;

        snprintf(buf, sizeof(buf), "/proc/%d/cmdline", getpid());
        if(!(fh = fopen(buf, "r")))
                exit(0);
        if(!fgets(buf, sizeof(buf), fh))
                exit(0);
        fclose(fh);
        if(buf[strlen(buf) - 1] == '/n')
                buf[strlen(buf) - 1] = '/0';
        snprintf(cmd, sizeof(cmd), "gdb %s %d -ex=bt > ./a.txt", buf, getpid());
        system(cmd);

        exit(0);
}

鍦ㄦ湇鍔″櫒寮鍚椂,娣誨姞 signal(SIGSEGV, &dump ); 榪涜淇″彿澶勭悊鎸傛帴鍗沖彲

 

 

寮曠敤: http://blog.csdn.net/kakaka2011/article/details/6597857  浣滆? kakaka2011



]]>
鎭間漢鐨刡oost::asio::async_read_untilhttp://m.shnenglu.com/sunicdavy/archive/2012/12/03/195921.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Mon, 03 Dec 2012 07:12:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2012/12/03/195921.htmlhttp://m.shnenglu.com/sunicdavy/comments/195921.htmlhttp://m.shnenglu.com/sunicdavy/archive/2012/12/03/195921.html#Feedback5http://m.shnenglu.com/sunicdavy/comments/commentRss/195921.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/195921.html鏈榪戜負鏈嶅姟鍣ㄦ坊鍔燲MLSocket涓嶧lash榪涜閫氫俊, 榪欑鍗忚鍏跺疄鏄竴縐嶄互\0緇撳熬鐨勫瓧絎︿覆鍗忚, 涓轟簡璁゛sio鍏煎姝ゅ崗璁? 鎴戜粠鏂囨。鎵懼埌浜哸sync_read_until寮傛璇誨彇緋誨垪, 榪欎釜鍑芥暟鐨勫師鐞嗘椂, 緇欏畾涓涓猻treambuf, 鍜屼竴涓垎闅旂, asio紕板埌鍒嗛殧絎︽椂榪斿洖, 浣犲彲浠ヤ粠streambuf涓鍙栭渶瑕佺殑鏁版嵁. 鐪嬩技寰堢畝鍗? 鎴戝緢蹇啓濂戒竴涓猟emo涓嶧lash榪涜閫氫俊, 緇撴灉鍙戠幇鍦ㄤ竴涓猠cho閫昏緫閫熷害寰堝揩鏃? 鏈嶅姟鍣ㄥ眳鐒朵貢鍖呬簡, 緗戜笂鏌ヤ簡涓? 瀹樻柟鍘熸枃鏄繖鏍風殑:

鈥滱fter a successful async_read_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent async_read_until operation to examine.鈥?/p>

鎰忔濇槸, streambuf涓茍涓嶄竴瀹氭槸鍒板垎闅旂鍓嶇殑鎵鏈夋暟鎹? 澶氫綑鐨勬暟鎹彲鑳戒竴鏍蜂細鍦╯treambuf涓? 涔熷氨鏄, 榪橀渶瑕佽嚜宸卞啀嬈″鐞嗕竴閬嶆暟鎹?..

鍔ㄦ墜鍛? async_read_until鐪嬩技灝辨槸涓涓簾鏌? 搴曞眰宸茬粡璐逛簡寰堝CPU鍦ㄩ愬瓧絎︿笌鍒嗛殧絎︾殑鍖歸厤涓? 鎶涗笂鏉ョ殑鏁版嵁灞呯劧榪樻槸鍗婃垚鍝?

浠g爜濡備笅, 嫻嬭瘯閫氳繃, 浣嗘槸瀹炲湪寰堣垂瑙d負鍟ラ潪瑕佸啀鍋氫竴嬈?.

          boost::asio::streambuf* SB = SBP.get();

            // 璁塊棶緙撳啿
            const char* Buffs = boost::asio::buffer_cast<const char*>( SB->data() );

            uint32 DataSize = 0;
            for ( uint32 i = 0; i < SB->size(); ++i )
            {
                const char DChar = Buffs[i];

                // 榪欓噷闇瑕佽嚜宸卞垽鏂瓧絎︿覆鍐呭, read_until鐨勬枃妗i噷榪欎箞璇寸殑
                if ( DChar == '\0' )
                {
                    DataSize = i;
                    break;
                }
            }

            if ( DataSize > 0 )
            {
                // 鍙栨垚瀛楃涓?/span>
                std::string FullText( Buffs, DataSize );
                
                // 娑堣垂
                SB->consume( DataSize );                

                mWorkService->post(
                    boost::bind(&AsioSession::NotifyReadString,
                    shared_from_this(),
                    FullText )
                    );

            }
  鍙﹀, 涓轟簡淇濊瘉杈撳叆鎬у畨鍏? 鍙互鍦╯treambuf鏋勯犳椂鍔犱竴涓渶澶т竴涓鍙栭噺, 瓚呰繃姝ら噺浼氳繑鍥炴姤閿? 閬垮厤浜嗙紦鍐插尯琚拺鐖嗙殑鍗遍櫓


]]>
鍒囨崲Qt鐗堟湰, 淇敼$(QTDIR)鎸囧悜http://m.shnenglu.com/sunicdavy/archive/2012/07/14/183384.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Sat, 14 Jul 2012 07:35:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2012/07/14/183384.htmlhttp://m.shnenglu.com/sunicdavy/comments/183384.htmlhttp://m.shnenglu.com/sunicdavy/archive/2012/07/14/183384.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/183384.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/183384.html鏈榪戜粠Qt4.7.0 鍗囩駭鍒?Qt4.8.2, 瑁呭ソ浜嗘柊鐨刼pen sdk, 浣嗘槸瑙傚療宸ョ▼涓殑寮曠敤渚濇棫鏄?.7.0

鍦╓indows鐜鍙橀噺涓病鏈夋壘鍒?(QTDIR)

闅忓嵆鍦≦t鐨刅isual Studio 鎻掍歡鑿滃崟涓? Qt->Qt Options-> Qt Versions

璁劇疆Default Qt/Win version涓烘柊鐗堟湰

閫変腑鍘熸湁鐨凲t宸ョ▼, 鍦ㄦ彃浠惰彍鍗曚腑鎵懼埌Qt Project Settings->Properties->Version涓?灝嗙増鏈緗負鏈鏂扮増鏈?/p>

濡傛灉瑁呮湁Visual AssitX, 姝ゆ椂榪欎笢瑗垮簲璇ュ紑濮婸arse鏂扮殑Qt搴撲簡

have fun 寰瑧!



]]>
MySQL++鎿嶄綔MySQL涓犳垚Commands out of sync鐨?014閿欒鍒嗘瀽http://m.shnenglu.com/sunicdavy/archive/2012/06/13/178678.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Wed, 13 Jun 2012 09:57:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2012/06/13/178678.htmlhttp://m.shnenglu.com/sunicdavy/comments/178678.htmlhttp://m.shnenglu.com/sunicdavy/archive/2012/06/13/178678.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/178678.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/178678.htmlMySQL++鍦∕ySQL鍘熷C鎺ュ彛涓婂仛浜嗕竴浜涘皝瑁? 緇欐搷浣滃甫鏉ュ緢澶т究鍒?

鏈榪戦亣鍒癉B鏈嶅姟鍣ㄤ腑鎶ュ嚭涓涓狹ySQL鐨勯敊璇?Commands out of sync; you can't run this command now,2014

鏌ラ槄寰堝浠g爜, 瑙e喅鏂規硶閮芥槸浣跨敤C鎺ュ彛鐨勬柟寮? 妯′豢鍏惰В鍐蟲柟娉?鍦∕ySQL++涓壘鍒頒簡姣旇緝濂界殑瑙e喅鏂規:

鏂規A: 娓呯┖姣忔鏈嬌鐢ㄧ殑璁板綍

for (int i = 1; DataQuery.more_results(); ++i)
{
   DataQuery.store_next();                
}

鍏朵腑 DataQuery綾誨瀷涓簃ysqlpp::Query

 

鏂規B: 瀵逛簬瀛樺偍榪囩▼涓?浣跨敤浜嗗涓猻elect璇彞榪斿洖鍚屾牱鐨勫垪緇撴灉, 灝遍渶瑕佷嬌鐢ㄤ互涓嬭鍙?/p>

static void print_multiple_results(Query& query)
{
    // 鎵ц鏌ヨ騫惰緭鍑虹粨鏋滆〃
 StoreQueryResult res = query.store();
 print_result(res, 0);
 for (int i = 1; query.more_results(); ++i) {
  res = query.store_next();
  print_result(res, i);
 }
}
 
鍙傝冩枃绔?http://hi.baidu.com/freeknight/item/ea9fd88e7d291f854514cf43


]]>
[杞琞Lisp鐨勬案鎭掍箣閬?/title><link>http://m.shnenglu.com/sunicdavy/archive/2012/06/12/178505.html</link><dc:creator>鎴橀瓊灝忕瓚</dc:creator><author>鎴橀瓊灝忕瓚</author><pubDate>Tue, 12 Jun 2012 04:38:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2012/06/12/178505.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/178505.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2012/06/12/178505.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/178505.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/178505.html</trackback:ping><description><![CDATA[<h5>鏈枃杞嚜: <a >http://coolshell.cn/articles/7526.html</a></h5> <p> </p> <h5>Lisp涔嬮瓍</h5> <p>闀夸箙浠ユ潵錛孡isp涓鐩磋璁稿浜鴻涓哄彶涓婃渶闈炲嚒鐨勭紪紼嬭璦銆傚畠涓嶄粎鍦?0澶氬勾鍓嶈癁鐢熺殑鏃跺欏甫鏉ヤ簡璇稿闈╁懡鎬х殑鍒涙柊騫舵瀬澶у湴褰卞搷浜嗗悗鏉ョ紪紼嬭璦鐨勫彂灞曪紝鍗充嬌鍦ㄤ竴澶ф壒鐜頒唬璇█涓嶆柇娑岀幇鐨勪粖澶╋紝Lisp鐨勮澶氱壒鎬т粛鐒舵湭琚秴瓚娿傚綋鍚勫紡鍚勬牱鐨勭紪紼嬭璦鎽嗗湪闈㈠墠錛屾垜浠彲浠ヤ粠榪愯鏁堢巼銆佸涔犳洸綰褲佺ぞ鍖烘椿璺冨害銆佸巶鍟嗘敮鎸佺瓑澶氱涓嶅悓鐨勮搴﹁繘琛岃瘎鍒ゅ拰閫夋嫨錛屼絾鎴戠壒鍒湅涓殑涓鐐瑰湪浜庤璦鑳藉惁鏈夋晥鍦拌〃杈劇紪紼嬭呯殑璁捐鎬濇兂銆傚涔燙鎰忓懗鐫瀛︿範濡備綍鐢ㄨ繃紼嬫潵琛ㄨ揪璁捐鎬濇兂錛屽涔燡ava鎰忓懗鐫瀛︿範濡備綍鐢ㄥ璞℃潵琛ㄨ揪璁捐鎬濇兂錛岃岃櫧鐒禠isp涓庡嚱鏁板紡緙栫▼鏈夊緢澶х殑鍏崇郴錛屼絾瀛︿範Lisp緇濅笉浠呬粎鏄涔犲浣曠敤鍑芥暟琛ㄨ揪璁捐鎬濇兂銆傚疄闄呬笂錛?strong>鍑芥暟寮忕紪紼嬪茍闈濴isp鐨勬湰璐?/strong>錛屽湪宸茬粡鎺屾彙浜唋ambda銆侀珮闃跺嚱鏁般侀棴鍖呫佹儼鎬ф眰鍊肩瓑鍑芥暟寮忕紪紼嬫蹇典箣鍚庯紝瀛︿範Lisp浠嶇劧澶уぇ鍔犳繁浜嗘垜瀵圭紪紼嬬殑鐞嗚В銆?strong>瀛︿範Lisp鎵鏀惰幏鐨勬槸濡備綍鈥滆嚜鐢卞湴鈥濊〃杈句綘鐨勬濇兂</strong>錛岃繖姝f槸Lisp鏈澶х殑欖呭姏鎵鍦紝涔熸槸榪欓棬鍙よ佺殑璇█浠嶇劧鍏鋒湁寰堝己鐨勭敓鍛藉姏鐨勬牴鏈師鍥犮?<h5>Lisp涔嬫簮</h5> <p>Lisp鎰忎負琛ㄥ鐞?List Processing)錛屾簮鑷璁¤匤ohn McCarthy浜?960騫村彂琛ㄧ殑涓綃囪鏂囥婄鍙瘋〃杈懼紡鐨勯掑綊鍑芥暟鍙婂叾鏈哄櫒璁$畻銆嬨侻cCarthy鍦ㄨ繖綃囪鏂囦腑鍚戞垜浠睍紺轟簡鐢ㄤ竴縐嶇畝鍗曠殑鏁版嵁緇撴瀯S琛ㄨ揪寮?S-expression)鏉ヨ〃紺轟唬鐮佸拰鏁版嵁錛屽茍鍦ㄦ鍩虹涓婃瀯寤轟竴縐嶅畬鏁寸殑璇█銆侺isp璇█褰㈠紡綆鍗曘佸唴娑墊繁鍒伙紝Paul Graham鍦ㄣ奓isp涔嬫牴婧愩嬩腑灝嗗叾瀵圭紪紼嬬殑璐$尞涓庢鍑犻噷寰峰鍑犱綍鐨勮礎鐚浉鎻愬茍璁恒?<h5>Lisp涔嬪艦</h5> <p>鐒惰岋紝涓庢暟瀛︿笘鐣屼腑綆鍗曟槗鎳傜殑嬈ф皬鍑犱綍褰㈡垚椴滄槑瀵規瘮錛岀▼搴忎笘鐣屼腑鐨凩isp鍗翠竴鐩存槸涓縐嶅彜鑰佽屽張紲炵鐨勫瓨鍦紝鐪熸鐞嗚В鍏剁簿濡欑殑浜鴻繕鏄皯鏁般備粠琛ㄩ潰涓婄湅錛孡isp鏈鏄庢樉鐨勭壒寰佹槸瀹冣滃彜鎬濈殑S琛ㄨ揪寮忚娉曘係琛ㄨ揪寮忔槸涓涓師瀛?atom)錛屾垨鑰呰嫢騫睸琛ㄨ揪寮忕粍鎴愮殑鍒楄〃(list)錛岃〃杈懼紡涔嬮棿鐢ㄧ┖鏍煎垎寮錛屾斁鍏ヤ竴瀵規嫭鍙蜂腑銆傗滃垪琛ㄢ滆繖涓湳璇彲鑳戒細瀹規槗璁╀漢鑱旀兂鍒版暟鎹粨鏋勪腑鐨勯摼琛ㄤ箣綾葷殑綰垮艦緇撴瀯錛屽疄闄呬笂錛孡isp鐨勫垪琛ㄦ槸涓縐嶅彲宓屽鐨勬爲褰㈢粨鏋勩備笅闈㈡槸涓浜汼琛ㄨ揪寮忕殑渚嬪瓙:<pre>foo () (a b (c d) e) (+ (* 2 3) 5) (defun factorial (N) (if (= N 1) 1 (* N (factorial (- N 1))) ) ) </pre> <p>鎹錛岃繖涓彜鎬殑S琛ㄨ揪寮忔槸McCarthy鍦ㄥ彂鏄嶭isp鏃跺欐墍閲囩敤鐨勪竴縐嶄復鏃惰娉曪紝浠栧疄闄呬笂鏄噯澶囦負Lisp鍔犱笂涓縐嶈縐頒負M琛ㄨ揪寮?M-expression)鐨勮娉曪紝鐒跺悗鍐嶆妸M琛ㄨ揪寮忕紪璇戜負S琛ㄨ揪寮忋傜敤涓涓氫織鐨勭被姣旓紝S琛ㄨ揪寮忕浉褰撲簬鏄疛VM鐨勫瓧鑺傜爜錛岃孧琛ㄨ揪寮忕浉褰撲簬Java璇█錛屼絾鏄悗鏉isp鐨勪嬌鐢ㄨ呴兘鐔熸倝騫跺枩嬈笂浜嗙洿鎺ョ敤S琛ㄨ揪寮忕紪鍐欑▼搴忥紝騫朵笖浠栦滑鍙戠幇S琛ㄨ揪寮忔湁璁稿鐙壒鐨勪紭鐐癸紝鎵浠琛ㄨ揪寮忕殑寮曞叆涔熷氨琚棤闄愭湡寤惰繜浜嗐? <p>璁稿Lisp鐨勫叆闂ㄦ枃绔犻兘姣旇緝寮鴻皟Lisp鐨勫嚱鏁板紡鐗規э紝鑰屾垜璁や負榪欐槸涓縐嶈瀵箋傜湡姝g殑Lisp涔嬮棬涓嶅湪鍑芥暟寮忕紪紼嬶紝鑰屽湪S琛ㄨ揪寮忔湰韜紝Lisp鏈澶х殑濂ョ灝辮棌鍦⊿琛ㄨ揪寮忓悗闈€係琛ㄨ揪寮忔槸Lisp鐨勮娉曞熀紜錛岃娉曟槸璇箟鐨勮澆浣擄紝褰㈠紡鏄疄璐ㄧ殑瀵勬墭銆?strong>鈥淪琛ㄨ揪寮忊濇槸紼嬪簭鐨勪竴縐嶅艦錛屾濡傗滀竷璦鈥濇槸璇楃殑涓縐嶅艦錛屸滃井鍗氣濇槸淇℃伅鐨勪竴縐嶅艦</strong>銆傛鏄艦鐨勪笉鍚岋紝璁╁井鍗氫笌鍗氬鏈変簡璐ㄧ殑宸紓錛屽悓鏍風殑閬撶悊錛屾鏄疭琛ㄨ揪寮忚Lisp涓嶤銆丣ava銆丼QL絳夎璦鏈変簡澶╁¥涔嬪埆銆? <h5>Lisp涔嬮亾</h5> <p>涓闂ㄨ璦鑳藉惁鏈夋晥鍦拌〃杈劇紪紼嬭呯殑璁捐鎬濇兂鍙栧喅浜庡叾鎶借薄鏈哄埗鐨勮涔夎〃杈捐兘鍔涖傛牴鎹娊璞℃満鍒剁殑涓嶅悓錛岃璦鐨勬娊璞℃満鍒跺艦鎴愪簡闈㈠悜榪囩▼銆侀潰鍚戝璞°佸嚱鏁板紡銆佸茍鍙戝紡絳変笉鍚岀殑鑼冨紡銆傚綋浣犻噰鐢ㄦ煇涓縐嶈璦錛屽熀鏈笂灝辮〃紺轟綘宸茬粡鈥滈潰鍚慩XX鈥滀簡錛屼綘鐨勬濈淮鏂瑰紡鍜岃В鍐抽棶棰樼殑鎵嬫灝變細渚濊禆浜庤璦鎵鎻愪緵鐨勬娊璞℃柟寮忋傛瘮濡傦紝閲囩敤Java璇█閫氬父鎰忓懗鐫閲囩敤闈㈠悜瀵硅薄鍒嗘瀽璁捐錛涢噰鐢‥rlang閫氬父鎰忓懗鐫鎸堿ctor妯″瀷瀵瑰茍鍙戜換鍔¤繘琛屽緩妯°? <p>鏈夌粡楠岀殑紼嬪簭鍛橀兘鐭ラ亾錛屾棤璁烘槸闈㈠悜XXX緙栫▼錛岀▼搴忚璁¢兘鏈変竴鏉♀滄娊璞″師鍒欌滐細What涓嶩ow瑙h︺備絾鏄紝<strong>鏅氳璦鐨勯棶棰樺氨鍦ㄤ簬琛ㄨ揪What鐨勬墜孌甸潪甯告湁闄?/strong>錛屾棤闈炴槸榪囩▼銆佺被銆佹帴鍙c佸嚱鏁扮瓑鍑犵鏂瑰紡錛岃岃澶氶鍩熼棶棰樻槸鏃犳硶鐩存帴鎶借薄涓哄嚱鏁版垨鎺ュ彛鐨勩傛瘮濡傦紝浣犲畬鍏ㄥ彲浠ュ湪C璇█涓畾涔夎嫢騫插嚱鏁版潵鍋氬埌make file鎵鍋氱殑浜嬫儏錛屼絾C浠g爜寰堥毦鍍弇ake file閭f牱澹版槑寮忓湴浣撶幇鍑簍arget銆乨epends絳夎涔夛紝瀹冧滑鍙細浣滀負瀹炵幇緇嗚妭琚飯娌″湪涓涓釜鐨凜鍑芥暟涔嬩腑銆傞噰鐢∣OP鎴栨槸FP絳夊叾瀹冭寖寮忎篃浼氶亣鍒板悓鏍風殑鍥伴毦錛屼篃灝辨槸璇磎ake file璇█鎵浠h〃鐨勬娊璞$淮搴︿笌闈㈠悜榪囩▼銆丱OP浠ュ強FP鐨勬娊璞$淮搴︽槸姝d氦鐨勶紝浣垮緱鍚勭鑼冨紡鏃犳硶鐩存帴琛ㄨ揪鍑簃ake file鐨勮涔夈傝繖灝辨槸鏅氳璦鐨勨滃垰鎬р濈壒寰侊紝瀹冭姹傛垜浠繀欏諱互璇█鐨勬娊璞$淮搴﹀幓鍒嗘瀽鍜岃В鍐抽棶棰橈紝鎶婇棶棰樻槧灝勫埌璇█鐨勫熀鏈娉曞拰璇箟銆? <p>鏇磋繘涓姝ワ紝濡傛灉浠旂粏鎺㈢┒榪欑鍒氭х殑鏍規簮錛屾垜浠細鍙戠幇姝f槸鐢變簬鏅氳璦<strong>璇硶鍜岃涔夌殑绱ц﹀悎</strong>閫犳垚浜嗚繖縐嶅垰鎬с傛瘮濡傦紝C璇█涓璸rintf(鈥渉ello %s鈥? name)絎﹀悎鍑芥暟璋冪敤璇硶錛屽畠琛ㄨ揪浜嗗嚱鏁拌皟鐢ㄨ涔夛紝闄ゆ涔嬪鍒棤浠栦箟錛汮ava涓璱nterface IRunnable { 鈥?}絎﹀悎鎺ュ彛瀹氫箟璇硶錛屽畠琛ㄨ揪浜嗘帴鍙e畾涔夎涔夛紝闄ゆ涔嬪鍒棤浠栦箟銆傚鏋滀綘璁や負鈥滆娉曞拰璇箟绱ц﹀悎鈥滄槸鐞嗘墍褰撶劧鐨勶紝鐪嬩笉鍑鴻繖鏈変粈涔堥棶棰橈紝閭d箞鐞嗚ВLisp灝變細璁╀綘瀵規浜х敓鏇存繁鐨勮璇嗐? <p>褰撲綘鐪嬪埌Lisp鐨?f a (b c))鐨勬椂鍊欙紝浣犱細鎯沖埌浠涔堬紵浼氫笉浼氶┈涓婅仈鎯沖埌鍑芥暟姹傚兼垨鏄畯鎵╁睍錛熷氨鍍忓湪C璇█閲岀湅鍒癵cd(10, 15)椹笂鎯沖埌鍑芥暟璋冪敤錛屾垨鑰呭湪Java閲岀湅鍒癱lass A椹笂鎯沖埌綾誨畾涔変竴鏍楓傚鏋滅湡鏄繖鏍鳳紝閭e畠灝辨槸浣犵悊瑙isp鐨勪竴閬撻殰紕嶏紝鍥犱負浣犲凡緇忎範鎯簡欏虹潃璇█鍘繪濊冿紝鎬繪槸鍦ㄦ兂榪欎竴鍙ヨ瘽鏈哄櫒鎬庝箞瑙i噴鎵ц錛熼偅涓鍙ヨ瘽鍙堝搴旇璦鐨勫摢涓壒鎬э紵鐞嗚ВLisp瑕佸弽榪囨潵錛岃璇█欏虹潃浣狅紝Lisp鐨?f a (b c))鍙互鏄換浣曡涔夛紝瀹屽叏鐢變綘鏉ュ畾錛屽畠鍙互鏄嚱鏁板畾涔夈佺被瀹氫箟銆佹暟鎹簱鏌ヨ銆佹枃浠朵緷璧栧叧緋伙紝寮傛浠誨姟鐨勬墽琛屽叧緋伙紝涓氬姟瑙勫垯 鈥? <p>涓嬮潰鎴戝噯澶囧厛閫氳繃鍑犱釜鍏蜂綋鐨勪緥瀛愰愭灞曠ずLisp鐨勬湰璐ㄣ傞渶瑕佽鏄庣殑鏄紝鐢變簬Lisp鐨凷琛ㄨ揪寮忓拰XML鐨勮娉曞艦寮忛兘鏄竴縐嶆爲褰㈢粨鏋勶紝鍦ㄨ涔夎〃杈炬柟闈簩鑰呭茍鏃犳湰璐ㄧ殑宸埆銆傛墍浠ワ紝涓轟簡鐞嗚В鏂逛究錛屼笅闈㈡垜鏆備笖鐢ㄥ鏁頒漢鏇翠負鐔熸倝鐨刋ML鏉ュ啓浠g爜錛岃璁頒綇鎴戜滑鍙互寰堣交鏄撳湴鎶奨ML浠g爜鍜孡isp浠g爜鐩鎬簰杞崲銆? <p>棣栧厛錛屾垜浠彲浠ヨ交鏄撳湴鐢╔ML鏉ュ畾涔変竴涓眰涓や釜鏁版渶澶у叕綰︽暟鐨勫嚱鏁幫細<pre> <func name='gcd' return_type='int'> <params> <a type='int'/> <b type='int'/> </params> <body> <if> <equals> <a/> <int>0</int> </equals> </if> <then> <return><b/></return> </then> <else> <return> <gcd> <modulo><b/><a/></modulo> <a/> </gcd> </return> </else> </body> </func> </pre> <p>鍏舵錛屾垜浠彲浠ョ敤瀹冩潵瀹氫箟綾伙細<pre> <class name="Computer"> <field access="private" type="MainBoard" name="main-board" /> <field access="private" type="CPU" name="cpu" /> <field access="private" type="Memory" name="memory" /> <method access="public" return_type="boolean" name="powerOn" /> <params>...</params> <body>...</body> </method> <method access="public" return_type="boolean" name="powerOff" /> <params>...</params> <body>...</body> </method> </class> </pre> <p>榪樺彲浠ヨ交鏄撳湴鐢ㄥ畠鏉ョ紪鍐欏叧緋繪煡璇細<pre><sql> <select> <column name="employees.id" /> <column name="bonus.amount" /> </select> <from> <table name="employees" /> <table name="bonus" /> </from> <where> <equals> <column name="employees.id" /> <column name="bonus.employee_id" /> </equals> </where> </sql> </pre> <p>榪樺彲浠ョ敤瀹冩潵瀹炵幇綾諱技make file鐨勮嚜鍔ㄥ寲鏋勫緩(璇硶鍙栬嚜ant)錛?pre> <project name="MyProject" default="dist" basedir="."> <property name="src" location="src"/> <property name="build" location="build"/> <property name="dist" location="dist"/> <target name="init"> <mkdir dir="${build}"/> </target> <target name="compile" depends="init" description="compile the source " > <javac srcdir="${src}" destdir="${build}"/> </target> <target name="dist" depends="compile" description="generate the distribution" > <mkdir dir="${dist}/lib"/> <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/> </target> <target name="clean" description="clean up" > <delete dir="${build}"/> <delete dir="${dist}"/> </target> </project> </pre> <p>涓鍙f皵涓句簡榪欎箞澶氫釜渚嬪瓙錛岀洰鐨勫湪浜庣敤XML榪欑鏍戝艦緇撴瀯鏉ヨ鏄嶭isp鐨凷琛ㄨ揪寮忔墍鑳藉鎻忚堪鐨勮涔夈備笉鐭ラ亾浣犳槸鍚﹀彂鐜頒簡S琛ㄨ揪寮忓拰XML榪欑鏍戝艦璇硶鍦ㄨ涔夋瀯閫犳柟闈㈡湁鐫鐗瑰埆鐨勨滄煍鎬р濓紵鎴戜滑鍙互杞繪槗鍦扮敤瀹冩瀯閫犲嚭鍑芥暟銆佸彉閲忋佹潯浠跺垽鏂涔夛紱綾匯佸睘鎬с佹柟娉曡涔夛紱鍙互杞繪槗鍦版瀯閫犲嚭鍏崇郴妯″瀷鐨剆elect銆亀here璇箟錛涘彲浠ヨ交鏄撳湴鏋勯犲嚭make鐨則arget銆乨epends璇箟錛岀瓑絳夋暟涓嶆竻鐨勮涔夈傚湪鏅氳璦閲岋紝浣犲彲浠ュ畾涔変竴涓嚱鏁般佷竴涓被錛屼絾浣犳棤娉曚負C璇█澧炲姞鍖垮悕鍑芥暟鐗規э紝涔熸病娉曠粰Java璇█鍔犱笂RAII璇箟錛岀敋鑷寵繛鑷繁鍒涢犱竴涓猣oreach寰幆閮戒笉琛岋紝鑰岃嚜瀹氫箟璇箟鎰忓懗鐫鍦↙isp涔嬩笂<strong>浣犲垱閫犱簡涓闂ㄨ璦</strong>錛佷笉綆℃槸闈㈠悜榪囩▼錛岄潰鍚戝璞★紝鍑芥暟寮忥紝榪樻槸鍏崇郴妯″瀷錛屽湪Lisp閲岀粺緇熼兘鍙樻垚浜嗕竴縐岲SL錛岃孡isp鏈韓涔熷氨鎴愪簡涓縐嶅畾涔夎璦鐨勮璦錛屽嵆鍏冭璦(Meta Language)銆? <p>Lisp鐨勬煍鎬т笌S琛ㄨ揪寮忔湁鐫瀵嗗垏鐨勫叧緋匯侺isp騫朵笉闄愬埗浣犵敤S琛ㄨ揪寮忔潵琛ㄨ揪浠涔堣涔夛紝鍚屾牱鐨凷琛ㄨ揪寮忚娉曞彲浠ヨ〃杈懼悇縐嶄笉鍚岄鍩熺殑璇箟錛岃繖灝辨槸<strong>璇硶鍜岃涔夎В鑰?/strong>銆傚鏋滆鏅氳璦鐨勫垰鎬ф簮浜庘滆娉曞拰璇箟绱ц﹀悎鈥濓紝閭d箞Lisp鐨勬煍鎬ф鏄簮浜庘滆娉曞拰璇箟瑙h︹濓紒鈥滆娉曞拰璇箟瑙h︹濅嬌寰桳isp鍙互闅忔剰鍦版瀯閫犲悇縐嶉鍩熺殑DSL錛岃屼笉寮哄埗鐢ㄦ煇涓縐嶈寖寮忔垨鏄鍩熻瑙掑幓鍒嗘瀽鍜岃В鍐抽棶棰樸傛湰璐ㄤ笂錛孡isp緙栫▼鏄竴縐嶈秴瓚婁簡鏅氱紪紼嬭寖寮忕殑鑼冨紡錛岃繖灝辨槸<strong>Lisp涔嬮亾錛氶潰鍚戣璦緙栫▼(LOP, Language Oriented Programming)</strong>銆俉ikipedia涓婃槸榪欐牱鎻忚堪LOP鐨勶細 <blockquote> <p>Language oriented programming (LOP) is a style of computer programming in which, rather than solving problems in general-purpose programming languages, the programmer creates one or more domain-specific languages for the problem first, and solves the problem in those languages 鈥?The concept of Language Oriented Programming takes the approach to capture requirements in the user鈥檚 terms, and then to try to create an implementation language as isomorphic as possible to the user鈥檚 descriptions, so that the mapping between requirements and implementation is as direct as possible.</p></blockquote> <p>LOP鑼冨紡鐨勫熀鏈濇兂鏄粠闂鍑哄彂錛屽厛鍒涘緩涓闂ㄦ弿榪伴鍩熸ā鍨嬬殑DSL錛屽啀鐢―SL鍘昏В鍐抽棶棰橈紝瀹冨叿鏈夐珮搴︾殑澹版槑鎬у拰鎶借薄鎬с係QL銆乵ake file銆丆SS絳塂SL閮藉彲浠ヨ璁や負鏄疞OP鐨勫叿浣撳疄渚嬶紝涓嬮潰鎴戜滑鍐嶉氳繃涓や釜甯歌鐨勪緥瀛愭潵鐞嗚ВLOP鐨勪紭鍔褲? <p>渚?錛氬湪鑲$エ浜ゆ槗緋葷粺涓紝浜ゆ槗鍗忚瀹氫箟鑻ュ共浜岃繘鍒剁殑娑堟伅鏍煎紡錛屼氦鏄撴墍鍜屽鎴風闇瑕佸娑堟伅榪涜緙栫爜鍜岃В鐮併? <p>娑堟伅鏍煎紡鏄竴縐嶆娊璞$殑瑙勮寖錛屾湰韜笉瀵硅璦鍋氫換浣曠殑闄愬埗錛屼綘鍙互鐢–錛孋++錛孞ava錛屾垨鑰匬ython銆傛櫘閫氱殑瀹炵幇鏂瑰紡鏄寜鐓ф秷鎭牸寮忚鑼冿紝鍦ㄧ浉搴旂殑璇█涓畾涔夋秷鎭粨鏋勶紝騫剁紪鍐欑浉搴旂殑緙栬В鐮佸嚱鏁般傚亣璁句負涓涓秷鎭畾涔夌粨鏋勫拰瀹炵幇緙栬В鐮佸嚱鏁扮殑宸ヤ綔閲忎負M錛屼笉鍚屾秷鎭被鍨嬬殑鏁伴噺涓篘錛岃繖縐嶆柟寮忕殑宸ヤ綔閲忓ぇ鑷翠負M*N銆備篃灝辨槸璇存瘡澧炲姞涓縐嶆秷鎭被鍨嬶紝灝遍渶瑕佷負璇ユ秷鎭畾涔夌粨鏋勶紝瀹炵幇緙栬В鐮佸嚱鏁幫紝寮曞叆bug鐨勫彲鑳芥у綋鐒朵篃鍜孧*N鎴愭姣斻傚鏋滀粩緇嗚瀵熶笉闅懼彂鐜幫紝鍚勪釜娑堟伅緇撴瀯鍏跺疄鏄珮搴︾被浼肩殑錛岀紪瑙g爜鍑芥暟涔熷ぇ鍚屽皬寮傦紝浣嗘槸鏅氳璦鍗存壘涓嶅埌涓縐嶆娊璞℃満鍒惰兘琛ㄨ揪榪欑鍏辨э紝姣斿錛屾垜浠棤娉曢氳繃闈㈠悜瀵硅薄鐨勬柟娉曞畾涔変竴涓熀綾繪妸娑堟伅緇撴瀯鐨勫叡鎬ф娊璞″嚭鏉ワ紝鐒跺悗璁╁叿浣撶殑娑堟伅鍘葷戶鎵垮畠錛岃揪鍒板鐢ㄧ殑鐩殑銆傝繖姝f槸鐢變簬鏅氳璦鐨勬娊璞$淮搴﹂檺鍒舵墍鑷達紝鍦ㄦ櫘閫氳璦涓紝浣犲彧鑳戒粠鍑芥暟銆佹帴鍙g瓑緇村害瀵逛簨鐗╄繘琛屾娊璞★紝鑰屾伆濂芥秷鎭牸寮忓叡鎬ф墍鍦ㄧ殑緇村害涓庤繖浜涙娊璞$淮搴﹀茍涓嶅尮閰嶃? <p>鍏跺疄錛屼笉鍚屾秷鎭被鍨嬬殑<strong>鍏辨у湪浜庡畠浠兘鍏鋒湁鐩稿悓鐨勯鍩熻涔?/strong>錛屾瘮濡傦細鈥滄煇瀛楁鍐呭鏄彟涓涓瓧孌靛唴瀹圭殑md5鐮佲濆氨鏄竴縐嶆秷鎭牸寮忕殑棰嗗煙璇箟錛岃繖縐嶉鍩熻涔夋槸OOP鐨勬娊璞℃満鍒舵棤娉曟弿榪扮殑銆侺OP鐨勬濊礬鏄厛鍒涘緩涓闂ㄦ秷鎭畾涔塂SL錛屾瘮濡傦紝綾諱技Google鐨凱rotocol Buffer錛孉ndroid鐨凙IDL銆傜劧鍚庯紝閫氳繃DSL緙栧啓娑堟伅瀹氫箟鏂囦歡錛岀洿鎺ュ0鏄庡紡鍦版弿榪版秷鎭殑緇撴瀯鐗瑰緛錛屾瘮濡傦紝鎴戜滑鍙互澹版槑寮忓湴鎻忚堪鈥滄煇瀛楁鍐呭鏄彟涓涓瓧孌靛唴瀹圭殑md5鐮佲濄傛垜浠繕闇瑕佷負DSL寮鍙戠紪璇戝櫒鐢ㄤ簬鐢熸垚C銆丣ava絳夐氱敤璇█鐨勬秷鎭畾涔夊拰緙栬В鐮佸嚱鏁般? <p>鏈変簡娑堟伅瀹氫箟DSL鍜岀紪璇戝櫒涔嬪悗錛岀敱浜嶥SL緙栧啓娑堟伅瀹氫箟鏄竴縐嶉珮搴﹀0鏄庡紡鐨勭紪紼嬫柟娉曪紝姣忓鍔犱竴縐嶆秷鎭殑鍙渶瑕佸緙栧啓涓涓秷鎭畾涔夋枃浠惰屽凡錛屽伐浣滈噺鍑犱箮鍙互蹇界暐涓嶈銆傛墍鏈夌殑宸ヤ綔閲忛兘闆嗕腑鍦ㄧ紪璇戝櫒鐨勫紑鍙戜笂錛屽伐浣滈噺鏄竴涓父鏁癈錛屼笌娑堟伅鐨勬暟閲忔病鏈夊叧緋伙紱璐ㄩ噺淇濊瘉鏂歸潰涔熷彧闇瑕佸叧娉ㄧ紪璇戝櫒榪欎竴鐐癸紝涓嶄細鍥犱負澧炲姞鏂扮殑娑堟伅綾誨瀷鑰屽紩鍏ug銆? <p>渚?錛氬湪鍥句功綆$悊緋葷粺涓紝闇瑕佹敮鎸佸湪綆$悊鐣岄潰涓婂涔︾睄銆佸鐢熴佺彮綰х瓑鍚勭瀹炰綋榪涜綆$悊鎿嶄綔銆? <p>濡傛灉鎸変紶緇熺殑涓夊眰鏋舵瀯錛屼竴鑸渶瑕佸湪鍚庣紼嬪簭涓負姣忎竴縐嶅疄浣撳畾涔変竴涓被錛屽茍瀹氫箟鐩稿簲鐨勬柟娉曞疄鐜癈RUD鎿嶄綔錛屼笌涔嬬浉搴旂殑錛岃繕闇瑕佸湪鍓嶇欏甸潰涓負姣忎竴涓疄浣撶紪鍐欑浉搴旂殑綆$悊欏甸潰銆傝繖浜涘疄浣撶被鐨凜RUD鎿嶄綔閮芥槸澶у悓灝忓紓鐨勶紝浣嗙粏鑺傚張鍚勪笉鐩稿悓錛岃櫧鐒舵垜浠緢鎯沖鐢ㄦ煇浜涘叡鍚岀殑璁捐瀹炵幇錛屼絾OOP鎵鎻愪緵鐨勫皝瑁呫佺戶鎵褲佸鎬佺瓑鎶借薄鏈哄埗涓嶈凍浠ユ湁鏁堟崟鑾峰疄浣撲箣闂寸殑鍏辨э紝澶ч噺鐨勪唬鐮佽繕鏄繀欏繪斁鍦ㄥ瓙綾諱腑鏉ュ畬鎴愩傛瘮濡傦紝Student鍜孊ook瀹炰綋綾葷殑瀹炵幇闈炲父鐩鎬技錛屼絾鏄鏋滆閫氳繃OOP鐨勬柟寮忓幓鎶借薄瀹冧滑鐨勫叡鎬э紝寰楀嚭鐨勭粨鏋滃鍗婃槸Entity榪欐牱鐨勫ぇ鑰岀┖鐨勫熀綾伙紝寰堥毦璧峰埌澶嶇敤鐨勬晥鏋溿? <p>鍏跺疄錛屼笉鍚屽疄浣撲箣闂寸殑鍏辨ц繕鏄湪浜庡畠浠叿鏈夌浉鍚岀殑棰嗗煙璇箟錛屾瘮濡傦細瀹炰綋鍏鋒湁灞炴э紝灞炴у叿鏈夌被鍨嬶紝灞炴у叿鏈夊彇鍊艱寖鍥達紝灞炴у叿鏈夊彲璇誨彇銆佸彲緙栬緫絳夎闂睘鎬э紝瀹炰綋涔嬮棿鏈夊叧鑱斿叧緋葷瓑銆侺OP鏂規硶姝f槸鐩存帴闈㈠悜榪欑棰嗗煙璇箟鐨勩傞噰鐢↙OP鏂規硶錛屾垜浠茍涓嶉渶瑕佷負姣忎竴涓疄浣撶被鍗曠嫭緙栧啓CRUD鏂規硶錛屼篃涓嶉渶瑕佸崟鐙紪鍐欑鐞嗛〉闈紝鍙渶瑕佸畾涔変竴縐岲SL騫跺疄鐜板叾緙栬瘧鍣紱鐒跺悗錛岀敤DSL澹版槑寮忓湴緙栧啓瀹炰綋鎻忚堪鏂囦歡錛屽幓鎻忚堪瀹炰綋鐨勫睘鎬у垪琛紝灞炴х殑綾誨瀷銆佸彇鍊艱寖鍥達紝灞炴ф墍鏀寔鐨勬搷浣滐紝灞炴т箣闂寸殑鍏崇郴鍜岀害鏉熸潯浠剁瓑錛涙渶鍚庯紝閫氳繃榪欎釜瀹炰綋鎻忚堪鏂囦歡鑷姩鐢熸垚鍚庣鐨勫疄浣撶被鍜屽墠绔鐞嗛〉闈€傞噰鐢↙OP錛屼笉璁哄墠鍚庣閲囩敤浣曠鎶鏈紝Java涔熷ソ錛孋#涔熷ソ錛孞SP涔熷ソ錛孉SP.NET涔熷ソ錛岄兘鍙互鑷姩鐢熸垚瀹冧滑鐨勪唬鐮併傞噰鐢↙OP鐨勫伐浣滈噺鍜岃川閲忛兘闆嗕腑鍦―SL鐨勮璁″拰緙栬瘧鍣ㄧ殑寮鍙戯紝涓庡疄浣撶殑鏁伴噺鏃犲叧錛屼篃灝辨槸璇達紝瓚婃槸搴炲ぇ鐨勭郴緇燂紝瀹炰綋綾昏秺澶氳秺鏄兘浣撶幇LOP鐨勪紭鍔褲? <p>閫氳繃涓婇潰涓や釜灝忎緥瀛愭垜浠彲浠ユ劅鍙楀埌錛孡OP鏄竴縐嶉潰鍚戦鍩熺殑錛岄珮搴﹀0鏄庡紡鐨勭紪紼嬫柟寮忥紝瀹冪殑鎶借薄緇村害涓庨鍩熸ā鍨嬬殑緇村害瀹屽叏涓鑷淬侺OP鑳借紼嬪簭鍛樹粠澶嶆潅鐨勫疄鐜扮粏鑺備腑瑙h劚鍑烘潵錛屾妸鍏蟲敞鐐歸泦涓湪闂鐨勬湰璐ㄤ笂錛屼粠鑰屾彁楂樼紪紼嬬殑鏁堢巼鍜岃川閲忋? <p>鎺ヤ笅鏉ョ殑闂鏄鏋滈渶瑕佷負鏌愰鍩熻璁SL錛屾垜浠槸搴旇鍙戞槑涓闂ㄧ被浼糞QL榪欐牱鐨勪笓鐢―SL鍛紝榪樻槸鐢╔ML鎴朣琛ㄨ揪寮忓幓瀹氫箟DSL鍛紵瀹冧滑鍚勬湁浣曚紭緙虹偣鍛紵 <p>鎴戣涓洪噰鐢╔ML鎴朣琛ㄨ揪寮忓畾涔塂SL鐨勪紭鐐逛富瑕佹湁錛?) SQL銆乵ake file銆丆SS絳変笓鐢―SL閮藉彧鑳介潰鍚戝悇鑷殑棰嗗煙錛岃屼竴涓疄闄呯殑棰嗗煙闂閫氬父鏄法瓚婂涓鍩熺殑錛屾湁鏃舵垜浠渶瑕佸皢涓嶅悓棰嗗煙铻嶅悎鍦ㄤ竴璧鳳紝浣嗘槸鐢變簬鏅氳璦鐨勫垰鎬э紝澶氳璦铻嶅悎閫氬父浼氭槸涓浠墮潪甯稿洶闅劇殑浜嬫儏錛岃孹ML鍜孲琛ㄨ揪寮忚娉曠粨鏋勭殑鍗曚竴鎬у拰鈥滀唬鐮佸強鏁版嵁鈥濈殑鐗圭偣浣垮緱璺ㄩ鍩熻瀺鍚堟鏃犻殰紕嶃?) 鍦ㄤ負DSL寮鍙戠紪璇戝櫒鎴栬В閲婂櫒鐨勬柟闈紝浜岃呴毦搴︿笉鍚屻傚XML鍜孲琛ㄨ揪寮忓畾涔夌殑DSL榪涜璇硶鍒嗘瀽闈炲父綆鍗曪紝鐩告瘮涔嬩笅錛屽SQL榪欐牱鐨勪笓鐢―SL榪涜璇硶鍒嗘瀽錛岃櫧鐒跺彲浠ュ熷姪Lex銆乊acc銆丄NTLR絳変唬鐮佺敓鎴愬伐鍏鳳紝浣嗘葷殑鏉ヨ澶嶆潅搴﹁繕鏄鏄庢樉楂樹竴浜涖? <p>褰撶劧錛孹ML鍜孲琛ㄨ揪寮忕殑浼樼偣涔熸濂芥槸鍏剁己鐐癸紝鐢變簬XML鍜孲琛ㄨ揪寮忕殑璇硶褰㈠紡鏄浐瀹氱殑錛屼笉鑳藉儚涓撶敤DSL閭f牱鑷敱鍦拌璁¤娉曘傛墍浠ワ紝涓鑸潵璁蹭笓鐢―SL鐨勮娉曟樉寰楁洿鍔犵畝媧併傛崲鍙ヨ瘽璇達紝XML鍜孡isp鍏跺疄鏄湪璇硶鍜岃涔夐棿鍋氫簡涓涓氦鎹紝鐢ㄨ娉曠殑闄愬埗鎹㈡潵浜嗚涔夌殑鐏墊椿銆? <h5>Lisp涔嬪櫒</h5> <p>鎺ヤ笅鏉ユ垜浠戶緇帰璁―SL鐨勮В閲婃墽琛岄棶棰樸侱SL浠g爜鐨勮В閲婃墽琛屼竴鑸垎涓?縐嶅吀鍨嬬殑鏂瑰紡錛?) 閫氳繃涓撻棬鐨勮В閲婂櫒瑙i噴鎵ц錛?) 緙栬瘧鐢熸垚鍏朵粬璇█鐨勪唬鐮侊紝鍐嶉氳繃鍏朵粬璇█鐨勮В閲婂櫒瑙i噴鎵ц(鎴栫紪璇戣繍琛?錛?) 鑷В閲娿傛瘮濡傦紝絎?綾葷殑浠h〃鏄疭QL錛屼笂涓鑺備婦鐨勪袱涓緥瀛愰兘灞炰簬絎?綾伙紝鑰岀3綾昏嚜瑙i噴姝f槸Lisp鐨勭壒鑹層? <p>涓轟簡鐞嗚В鑷В閲婏紝鎴戜滑鍙互鍏堜粠鍐呴儴DSL鐨勮В閲婃墽琛岃璧楓傚唴閮―SL鏄寚宓屽叆鍦ㄥ涓昏璦涓殑DSL錛屾瘮濡傦紝Google Test鍗曞厓嫻嬭瘯妗嗘灦瀹氫箟浜嗕竴濂楀熀浜庢祦鐣呮帴鍙?Fluent Interface)鐨凜++鍗曞厓嫻嬭瘯DSL銆備粠璇箟鏋勯犵殑瑙掑害鐪嬶紝鍐呴儴DSL鐩存帴鍊熺敤瀹夸富璇█鐨勮娉曞畾涔変簡鑷繁鐨勯鍩熻涔夛紝鏄竴縐嶈娉曞拰璇箟瑙h︼紱浠庤В閲婃墽琛岀殑瑙掑害鐪嬶紝鍐呴儴DSL鏄殢瀹夸富璇█鐨勮В閲婂櫒鑰岃嚜鍔ㄨВ閲婄殑錛屼笉闇瑕佸儚澶栭儴DSL涓鏍峰紑鍙戜笓闂ㄧ殑瑙i噴鍣紝鍥犺屽疄鐜扮殑浠d環寰堜綆銆傚綋鐒訛紝騫朵笉鏄璁捐鍐呴儴DSL涓嶇敤鍏沖績浠諱綍鐨勮В閲婂疄鐜幫紝瀹為檯涓婏紝榪樻槸闇瑕佺啛鎮夊涓昏璦鐨勭壒鎬э紝騫跺埄鐢ㄨ鐗規т嬌寰桪SL鑳介殢鐫瀹夸富璇█鐨勮В閲婂櫒寰楀埌瑙i噴鎵ц銆? <p>Lisp鎷ユ湁寮哄ぇ鐨勮嚜瑙i噴鐗規э紝榪欏緱鐩婁簬鐙竴鏃犱簩鐨?strong>Lisp涔嬪櫒錛氬畯 (macro)</strong>銆傚畯浣垮緱Lisp緙栧啓鐨凞SL鍙互琚獿isp瑙i噴鍣ㄧ洿鎺ヨВ閲婃墽琛岋紝榪欏湪鍘熺悊涓婁笌鍐呴儴DSL鏄浉閫氱殑錛屽彧鏄唴閮―SL涓鑸槸鍒╃敤瀹夸富璇█鐨勯摼寮忚皟鐢ㄧ瓑鐗規э紝閫氬父褰㈠紡綆闄嬶紝鍔熻兘鏈夐檺錛岃孡isp鐨勫畯鍒欒寮哄ぇ鍜岀伒媧誨緱澶氥? <p>C璇█涓篃鏈夊畯鐨勬蹇碉紝涓嶈繃Lisp鐨勫畯涓嶤璇█鐨勫畯瀹屽叏涓嶅悓錛孋璇█鐨勫畯鏄畝鍗曠殑瀛楃涓叉浛鎹€傛瘮濡傦紝涓嬮潰鐨勫畯瀹氫箟錛?pre>#define square(x) (x*x) </pre> <p>square(1+1)鐨勬湡鏈涚粨鏋滄槸4錛岃屽疄闄呬笂瀹冧細琚浛鎹㈡垚(1+1*1+1)錛岀粨鏋滄槸3銆傝繖涓緥瀛愯鏄庯紝C璇█鐨勫畯鍙湪棰勭紪璇戦樁孌佃繘琛岀畝鍗曠殑瀛楃涓叉浛鎹紝瀵圭▼搴忚娉曠粨鏋勭己涔忕悊瑙o紝闈炲父鑴嗗急銆侺isp鐨勫畯涓嶆槸綆鍗曠殑瀛楃涓叉浛鎹紝鑰屾槸涓濂楀畬鏁寸殑浠g爜鐢熸垚緋葷粺錛屽畠鏄湪璇硶瑙f瀽鐨勫熀紜涓婃妸Lisp浠g爜浠庝竴縐嶅艦寮忚漿鎹負鍙︿竴縐嶅艦寮忥紝鏈川涓婅搗鍒頒簡鏅氳璦緙栬瘧鍣ㄧ殑浣滅敤銆備笉鍚岀殑鏄紝鏅氱紪璇戝櫒鏄妸涓縐嶈璦鐨勪唬鐮佽漿鎹負鍙︿竴縐嶈璦鐨勪唬鐮侊紝姣斿錛孞ava緙栬瘧鍣ㄦ妸Java浠g爜杞崲鎴怞ava瀛楄妭鐮侊紱鑰孡isp瀹忕殑杈撳叆鍜岃緭鍑洪兘鏄疭琛ㄨ揪寮忥紝瀹冩湰璐ㄤ笂鏄妸涓縐岲SL杞崲涓哄彟涓縐岲SL銆備笅闈㈢殑渚嬪瓙鏄畯鐨勪竴涓吀鍨嬬敤娉曘? <p>渚?錛氬亣璁綥isp瑙i噴鍣ㄥ凡緇忓叿澶囪В閲婃墽琛岄潰鍚戣繃紼婦SL鐨勮兘鍔涳紝闇瑕佸疄鐜扮被浼糰nt鐨勮嚜鍔ㄥ寲鏋勫緩宸ュ叿銆? <p>鎴戜滑鍙互鍩轟簬瀹忔瀯寤轟竴闂ㄧ被ant鐨凞SL錛屽畯鐨勪綔鐢ㄦ槸鎶婄被ant DSL閫氳繃瀹忓睍寮鍙樻垚闈㈠悜榪囩▼鐨凞SL錛屾渶鍚庤Lisp瑙i噴鍣ㄦ墍瑙i噴鎵ц銆傝繖鏍風敤Lisp緙栧啓鐨刟nt DSL灝變笉闇瑕佽緙栬瘧涓哄叾浠栬璦錛屼篃涓嶉渶瑕佸儚XML鐨刟nt涓鏍蜂緷璧栦簬涓撻棬鐨勮В閲婂櫒浜嗐? <p>褰撶劧錛屽拰寮鍙戜笓闂ㄧ殑瑙i噴鍣?緙栬瘧鍣ㄧ浉姣旓紝Lisp鐨勫畯涔熷茍闈炴病鏈夌己鐐癸紝瀹忛毦浠ョ悊瑙o紝寮鍙戝拰璋冭瘯鏇村姞鍥伴毦銆傚埌搴曟槸寮鍙戜笓闂ㄧ殑瑙i噴鍣?緙栬瘧鍣ㄨ繕鏄洿鎺ラ噰鐢ㄥ畯搴旇瑙嗗叿浣撴儏鍐佃屽畾銆? <h5>鎬葷粨</h5> <p>Lisp閲囩敤鍗曚竴鐨凷琛ㄨ揪寮忚娉曡〃杈句笉鍚岀殑璇箟錛屽疄鐜頒簡璇硶鍜岃涔夎В鑰︺傝繖浣垮緱Lisp鍏鋒湁寮哄ぇ鐨勮涔夋瀯閫犺兘鍔涳紝鎿呴暱浜庢瀯閫燚SL瀹炵幇闈㈠悜璇█緙栫▼錛岃屽畯浣垮緱Lisp鍏鋒湁鑷В閲婅兘鍔涳紝璁╀笉鍚孌SL涔嬮棿鐨勮漿鎹㈡父鍒冩湁浣欍傝繘鍏isp鐨勪笘鐣屽簲褰撲粠鐞嗚В闈㈠悜璇█緙栫▼鍏ラ棬錛岃繖鏄疞isp涔嬮亾錛岃屽嚱鏁板紡緙栫▼鍜屽畯鐨嗕負Lisp涔嬪櫒錛屼互閬撻┉鍣ㄦ柟涓烘閫斻? <h5>鍚庤</h5> <p>鏈枃鏄垜瀛︿範Lisp鐨勪竴涓葷粨錛屼篃鏄啓緇欐湁鍏磋叮瀛︿範Lisp鐨勭▼搴忓憳鐨勫叆闂ㄨ祫鏂欍傚繀欏昏鏄庯紝鎴戣繕鏄竴涓爣鍑嗙殑Lisp鍒濆鑰咃紝鍑犱箮娌℃湁鍐欒繃鍍忔牱鐨凩isp紼嬪簭錛屾枃涓殑閿欒鍜屼笉瓚沖湪鎵闅懼厤錛屽笇鏈涜鑰呮壒璇勬寚姝o紝鎰熻阿錛? <h5>鍙傝?/h5> <p><a >The Roots of Lisp</a> <p><a >The Nature of Lisp</a> <p><a >Why Lisp macros are cool, a Perl perspective</a> <p><a >Wikipedia: Language-oriented programming</a> <p><a >銆婂疄鐢–ommon Lisp緙栫▼銆?/a> <p><a >銆婂啋鍙瘋鍫?鈥?緙栫▼鑼冨紡涓嶰OP鎬濇兂銆?/a></p><img src ="http://m.shnenglu.com/sunicdavy/aggbug/178505.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">鎴橀瓊灝忕瓚</a> 2012-06-12 12:38 <a href="http://m.shnenglu.com/sunicdavy/archive/2012/06/12/178505.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>log4cpp鍦↙inux緙栬瘧鐨勯敊璇В鍐蟲柟娉?/title><link>http://m.shnenglu.com/sunicdavy/archive/2012/04/21/172261.html</link><dc:creator>鎴橀瓊灝忕瓚</dc:creator><author>鎴橀瓊灝忕瓚</author><pubDate>Sat, 21 Apr 2012 08:43:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2012/04/21/172261.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/172261.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2012/04/21/172261.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/172261.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/172261.html</trackback:ping><description><![CDATA[<p>BasicLayout.cpp:37:5: error: 'auto_ptr' in namespace 'std' does not name a type</p> <p>鍦ㄥ寘鍚腑娣誨姞#include <memory>鍗沖彲</p><img src ="http://m.shnenglu.com/sunicdavy/aggbug/172261.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">鎴橀瓊灝忕瓚</a> 2012-04-21 16:43 <a href="http://m.shnenglu.com/sunicdavy/archive/2012/04/21/172261.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鐢熸垚mysql++闈欐佸簱http://m.shnenglu.com/sunicdavy/archive/2012/04/20/172142.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Fri, 20 Apr 2012 06:48:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2012/04/20/172142.htmlhttp://m.shnenglu.com/sunicdavy/comments/172142.htmlhttp://m.shnenglu.com/sunicdavy/archive/2012/04/20/172142.html#Feedback1http://m.shnenglu.com/sunicdavy/comments/commentRss/172142.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/172142.html鐢變簬鏈嶅姟鍣ㄩ渶瑕侀潤鎬侀摼鎺ユ墍鏈夊簱,浣唌ysql++榛樿緙栬瘧浣跨敤鐨勬槸鍏變韓搴? 鍥犳浣跨敤ar鎵嬪姩鐢熸垚涓涓?/p>

mysql++鐗堟湰3.1.0

榪涘叆mysql++鐩綍,鎵ц浠ヤ笅鎸囦護鐢熸垚libmysqlpp.a

ar rcu libmysqlpp.a mysqlpp_beemutex.o mysqlpp_cmdline.o mysqlpp_connection.o mysqlpp_cpool.o mysqlpp_datetime.o mysqlpp_dbdriver.o mysqlpp_field_names.o mysqlpp_field_types.o mysqlpp_manip.o mysqlpp_myset.o mysqlpp_mysql++.o mysqlpp_mystring.o mysqlpp_null.o mysqlpp_options.o mysqlpp_qparms.o mysqlpp_query.o mysqlpp_result.o mysqlpp_row.o mysqlpp_scopedconnection.o mysqlpp_sql_buffer.o mysqlpp_sqlstream.o mysqlpp_ssqls2.o mysqlpp_stadapter.o mysqlpp_tcp_connection.o mysqlpp_transaction.o mysqlpp_type_info.o mysqlpp_uds_connection.o mysqlpp_utility.o mysqlpp_vallist.o mysqlpp_wnp_connection.o ssqls2parse_parsev2.o

鐒跺悗mv鍒皍sr/local/lib,閲嶆柊閾炬帴鏈嶅姟鍣ㄥ嵆鍙?/p>

]]>
璁〤/C++紼嬪簭涓嬈$紪璇戝彲浠ュ彂甯冨埌澶氱増鏈琇inux涔嬩笂http://m.shnenglu.com/sunicdavy/archive/2012/04/20/172108.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Fri, 20 Apr 2012 03:35:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2012/04/20/172108.htmlhttp://m.shnenglu.com/sunicdavy/comments/172108.htmlhttp://m.shnenglu.com/sunicdavy/archive/2012/04/20/172108.html#Feedback4http://m.shnenglu.com/sunicdavy/comments/commentRss/172108.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/172108.html鏈榪戦〉娓稿紑鏀懼鉤鍙版瘮杈冨, 姣忎釜騫沖彴瑕佹眰鐨凩inux鐗堟湰鍚勪笉鐩稿悓, 榪欑粰寮鍙戜漢鍛橀儴緗叉湇鍔″櫒甯︽潵浜嗗緢澶х殑鍥伴毦. 鍦ㄦ湰鏈篖inux緙栬瘧鐨勭▼搴?鍙戝竷鏃跺嵆渚垮皢渚濊禆鐨剆o闄勫甫鍒扮洰鏍嘗inux鐜,浠嶇劧浼氱鍒頒緷璧栧強鐗堟湰闂,渚嬪:

[root@localhost bin]# ldd wkcenter
./wkcenter: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./wkcenter)
./wkcenter: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./wkcenter)
./wkcenter: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./wkcenter)
./wkcenter: /lib/libc.so.6: version `GLIBC_2.9' not found (required by ./wkcenter)
./wkcenter: /lib/libc.so.6: version `GLIBC_2.7' not found (required by ./wkcenter)
./wkcenter: /lib/libc.so.6: version `GLIBC_2.8' not found (required by ./wkcenter)
./wkcenter: /lib/libc.so.6: version `GLIBC_2.11' not found (required by ./wkcenter)

        linux-gate.so.1 =>  (0xffffe000)
        liblog4cpp.so.4 => not found
        libprotobuf.so.7 => not found
        libboost_filesystem.so.1.48.0 => not found
        libboost_system.so.1.48.0 => not found
        libboost_thread.so.1.48.0 => not found
        libboost_program_options.so.1.48.0 => not found
        libunwind-x86.so.7 => not found
        libluabind.so.0.9.0 => not found
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x008ae000)
        libm.so.6 => /lib/libm.so.6 (0x0044b000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00476000)
        libc.so.6 => /lib/libc.so.6 (0x002c1000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x0041d000)
        librt.so.1 => /lib/librt.so.1 (0x00440000)
        /lib/ld-linux.so.2 (0x002a2000)

涓婇潰綰㈠瓧閮ㄥ垎琛ㄧずglibc鍙奼libcxx搴撲緷璧栦笉姝g‘. 鏈漢浣跨敤鐨凩inux緙栬瘧鐗堟湰涓篗int 11(鍩轟簬Ubuntu), 涓鑸琔buntu鍙戣鐗堢殑glibc閰嶅闈炲父楂? 浣嗘槸涓婃枃涓殑鍙戝竷鐨凩inux鐗堟湰涓篊entOS 5.8

浣跨敤/lib/libc.so.6 鏌ョ湅libc鐗堟湰涓?.5, 榪滆繙浣庝簬寮鍙戠幆澧冪殑2.11

GNU C Library stable release version 2.5, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-51).
Compiled on a Linux 2.6.9 system on 2012-02-21.
Available extensions:
        The C stubs add-on version 2.1.2.
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        GNU libio by Per Bothner
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
        RT using linux kernel aio
Thread-local storage support included.
For bug reporting instructions, please see:
<
http://www.gnu.org/software/libc/bugs.html>.

鐢變簬Linux鎿嶄綔緋葷粺鐨勭壒鏈塭lf鍔犺澆欏哄簭. (鍙互鍙傝?a >姝ゆ枃). 铏界劧鍙互寰堝ぇ紼嬪害涓婅В鍐砏indows鏃╂湡鐗堟湰鐨刣ll hell闂, 浣嗘槸緇欓儴緗插甫鏉ヤ簡寰堝ぇ闅懼害

涓鑸父瑙佺殑瑙e喅鏂規硶鏄? 鎵懼埌涓涓笌鐩爣Linux鐗堟湰鍙奼libc鐗堟湰涓鑷寸殑Linux, 灝嗕唬鐮佸強渚濊禆鍖呮斁鍦ㄤ箣涓婄紪璇? 瀹屾垚鍚庡啀鍙戝竷.榪欑鏂規硶涓嶭inux涓嬪父瑙佽蔣浠跺畨瑁呮柟娉曠被浼? 浣嗘槸瀵逛簬鍟嗙敤鏈嶅姟鍣ㄩ儴緗叉楠ゆ潵璇存湭鍏嶇箒鐞? 瀹夊叏鎬т綆.

榪樻湁涓縐嶆柟娉?浣跨敤闈欐侀摼鎺? 灝嗘墍鏈夊彲鎵ц鏂囦歡鏂囦歡渚濊禆鐨勯潤鎬佸簱, 緋葷粺搴?鍏ㄩ儴闈欐侀摼鎺ュ埌鍙墽琛屾枃浠朵腑,鍙互涓嬈℃цВ鍐寵繖涓棶棰?/p>

姝ラ:

    1. 鍦╣cc閾炬帴鍛戒護琛屼腑娣誨姞-static -static-libgcc -static-libstdc++

    2. 灝嗙涓夋柟渚濊禆搴撴墦寮闈欐侀摼鎺ュ紑鍏? 灝嗗師鏉ラ摼鎺?so鐨勫簱,鍏ㄦ敼涓洪摼鎺?a

    3. gcc瀵歸摼鎺ュ簱欏哄簭寰堟晱鎰? 閾炬帴搴撻『搴忛渶瑕佹寜鐓т粠鍓嶈嚦鍚庝負:  欏圭洰浜х敓鐨勯潤鎬佸簱 > 絎笁鏂瑰簱闈欐佸簱 > 緋葷粺闈欐佸簱

    4. 閾炬帴鏃? 鑻ユ湁鏈В鍐崇殑symbol, 鍙互灝濊瘯鍦ㄦ渶鍚庢坊鍔?lpthread鍙?lrt瑙e喅

   

鍦ㄥ彂甯冪増鏈琇inux涓婅繍琛屽彲鑳介亣鍒扮殑闂:

terminate called after throwing an instance of 'std::runtime_error'

what(): locale::facet::_S_create_c_locale name not valid

瑙e喅鏂規硶: 鎵ц涔嬪墠榪愯export LC_ALL="C"



]]>
luabind瀹炵幇lua涓殑鍙栧璞″ぇ灝忓姛鑳?/title><link>http://m.shnenglu.com/sunicdavy/archive/2012/03/27/169178.html</link><dc:creator>鎴橀瓊灝忕瓚</dc:creator><author>鎴橀瓊灝忕瓚</author><pubDate>Tue, 27 Mar 2012 09:36:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2012/03/27/169178.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/169178.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2012/03/27/169178.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/169178.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/169178.html</trackback:ping><description><![CDATA[<p>鍦╨ua涓? #鎿嶄綔絎︾敤浜庤幏鍙栧璞″ぇ灝? 瀵逛簬table鏉ヨ, 鑾峰彇鐨勬槸table鍏冪礌涓暟, 瀵逛簬瀛楃涓叉潵璇磋幏鍙栫殑鏄瓧絎︿覆闀垮害</p> <p>鍙﹀涓縐嶈幏鍙栨柟娉曟槸table.getn(obj), 浣嗘槸榪欎釜鏂規硶宸茬粡鏍囪涓哄簾闄や簡, 灝介噺浣跨敤閫氱敤涓旂畝媧佺殑#鎿嶄綔絎?/p> <p> </p> <p>浣跨敤lua api瀹炵幇姝ゅ姛鑳藉氨闇瑕佺敤鍒發ua_objlen( ),浣嗘槸榪欎釜鍔熻兘鏈湪luabind涓彁渚?鎵浠ユ垜浠『鎵嬫坊鍔犱竴涓?/p> <p>棣栧厛鎵懼埌luabind婧愮爜鐨刼bject.hpp涓彇瀵硅薄綾誨瀷鐨則ype鍑芥暟,鍦ㄥ叾涓嬫坊鍔犱互涓嬩唬鐮?/p> <p> </p><pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: <span style="color: #0000ff">template</span><<span style="color: #0000ff">class</span> ValueWrapper></pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: <span style="color: #0000ff">inline</span> <span style="color: #0000ff">int</span> obj_size(ValueWrapper <span style="color: #0000ff">const</span>& value)</pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: {</pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(</pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: value</pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: );</pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: value_wrapper_traits<ValueWrapper>::unwrap(interpreter, value);</pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 9: detail::stack_pop pop(interpreter, 1);</pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 10: <span style="color: #0000ff">return</span> lua_objlen(interpreter, -1);</pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 11: }</pre><p> </p></pre> 閲嶆柊緙栬瘧浣犵殑浠g爜, 灝卞彲浠ヨ繖鏍蜂嬌鐢╨uabind::obj_size( obj ) 鑾峰彇瀵硅薄澶у皬浜?img src ="http://m.shnenglu.com/sunicdavy/aggbug/169178.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">鎴橀瓊灝忕瓚</a> 2012-03-27 17:36 <a href="http://m.shnenglu.com/sunicdavy/archive/2012/03/27/169178.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>luabind浣跨敤coroutine鏃剁殑涓澶勫杽鎰忔彁紺哄鑷寸殑BUGhttp://m.shnenglu.com/sunicdavy/archive/2012/03/27/169110.html鎴橀瓊灝忕瓚鎴橀瓊灝忕瓚Tue, 27 Mar 2012 02:38:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2012/03/27/169110.htmlhttp://m.shnenglu.com/sunicdavy/comments/169110.htmlhttp://m.shnenglu.com/sunicdavy/archive/2012/03/27/169110.html#Feedback2http://m.shnenglu.com/sunicdavy/comments/commentRss/169110.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/169110.html浠ヤ笅浠g爜浣跨敤luabind榪涜lua鐨刢oroutine嫻嬭瘯

   1: void ScriptManagedChannel::OnServiceInitialize()
   2: {    
   3:     try
   4:     {        
   5:         mThread = lua_newthread( GScriptScriptContext->GetVM() );
   6:  
   7:         luabind::resume_function<void>( mThread, "ScriptMain", this );
   8:  
   9:         Resume();
  10:     }
  11:     catch (std::exception& e)
  12:     {
  13:         const char* ErrorMsg = lua_tostring( GScriptScriptContext->GetVM(), -1 );            
  14:         printf("%s\n", e.what() );
  15:     }
  16:  
  17:     
  18: }
  19:  
  20: void ScriptManagedChannel::Resume( )
  21: {
  22:     luabind::resume<void>( mThread );
  23: }
  24:  
  25: void ScriptManagedChannel::StopTest( )
  26: {
  27:     lua_yield( mThread, 0 );
  28: }
  29:  
  30:  

浠g爜涓? mThread綾誨瀷涓簂ua_State*綾誨瀷

GScriptScriptContext->GetVM()鏄姞杞戒簡浠g爜鐨刲ua_State*

StopTest涓烘敞鍐屼負ScriptManagedChannel綾繪垚鍛樺嚱鏁板埌lua涓殑瀹氫箟

鎺ヤ笅鏉ョ湅lua绔殑嫻嬭瘯浠g爜:

   1: function ScriptMain( Channel )
   2:  
   3:     
   4:     for i = 1, 5 do
   5:     
   6:     print("done", i)
   7:     
   8:     Channel:StopTest( )
   9:     
  10:     
  11:     
  12:     end
  13: end

鍒氬紑濮?鍦ㄦ祴璇曚唬鐮佹椂, lua涓湁涓墜璇岄犳垚鐨勯敊璇? 瀵艱嚧C++浠g爜榪愯鍒扮7琛屾椂寮瑰嚭assert

浣嶄簬:luabind-0.9.1\luabind\detail\call_function.hpp 絎?64琛?瀵瑰簲浠ヤ笅浠g爜絎?3琛?/p>

   1: ~proxy_function_void_caller()
   2: {
   3:     if (m_called) return;
   4:  
   5:     m_called = true;
   6:     lua_State* L = m_state;
   7:  
   8:     int top = lua_gettop(L);
   9:  
  10:     push_args_from_tuple<1>::apply(L, m_args);
  11:     if (m_fun(L, boost::tuples::length<Tuple>::value, 0))
  12:     {
  13:         assert(lua_gettop(L) == top - m_params + 1);
  14:  
  15: NO_EXCEPTIONS
  16:         throw luabind::error(L);
  17: #else
  18:         error_callback_fun e = get_error_callback();
  19:         if (e) e(L);
  20:     
  21:         assert(0 && "the lua function threw an error and exceptions are disabled."
  22:                 " If you want to handle the error you can use luabind::set_error_callback()");
  23:         std::terminate();
  24: #endif
  25:     }
  26:     // pops the return values from the function call
  27:     stack_pop pop(L, lua_gettop(L) - top + m_params);
  28: }

11琛屼唬鐮佷腑璋冪敤鐨勬槸lua_resume, 榪斿洖鐨勬槸榪愯閿欒, 浣嗘槸琚?3琛岀殑assert鎸′綇浜? 鏃犳硶閫氳繃絎?6琛屾姏鍑哄紓甯歌澶栭潰鎹曡幏.

鍥犳,灝濊瘯娉ㄩ噴絎?3琛?/strong>, 鍐嶆祴璇? 鍙互鍦╨ua鎶涘嚭閿欒鍚? 鍦ㄦ爤欏舵崟鑾峰埌coroutine鍑芥暟resume鏃舵姤鍑虹殑閿欒淇℃伅.闂瑙e喅

 

瀵逛簬lua鐨刢oroutine, 緗戜笂璧勬枡涓嶅, 榪欓噷鏈変竴綃囨瘮杈冭緇嗙殑浠g爜

鎴戞瘮杈冪枒鎯戠殑鏄? 鏈夋病鏈夊繀瑕佸皢浠g爜鍦╠ofile鎴栬卍obuffer鏃? 蹇呴』浼犲叆newthread鍑虹殑state? 濡傛灉榪樻槸浼犲叆鍘熷鐨剆tate浼氭湁浠涔堝獎鍝?

嬈㈣繋鍚勪綅鏈夋緇忛獙鐨勮璁?/p>

]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              欧美成年人网站| 激情综合网址| 香蕉久久夜色| 亚洲精品在线看| 美女免费视频一区| 久久黄色影院| 久久精品99国产精品酒店日本| 一本大道av伊人久久综合| 亚洲国产欧美一区二区三区同亚洲 | 久久精品盗摄| 午夜精品福利一区二区三区av| 亚洲午夜91| 久久久久天天天天| 亚洲第一区中文99精品| 亚洲成人在线视频播放 | 国产无一区二区| 国产三级欧美三级| 在线精品视频一区二区三四| 亚洲国内精品在线| 亚洲一区二区黄色| 久久国产日本精品| 久久深夜福利免费观看| 亚洲国产成人高清精品| 美女91精品| 一区二区高清在线| 久久精品夜色噜噜亚洲a∨| 欧美激情一区二区三区成人| 国产精品美女xx| 最新日韩欧美| 久久天天躁夜夜躁狠狠躁2022| 黄色av一区| 欧美精品 国产精品| 亚洲毛片在线观看| 日韩一级黄色片| 久久综合给合| 久久久久久久久一区二区| 一本久道久久综合婷婷鲸鱼| 久久gogo国模啪啪人体图| 亚洲一区二区三区激情| 欧美国产亚洲另类动漫| 亚洲激情不卡| 99视频热这里只有精品免费| 欧美成ee人免费视频| 亚洲国产婷婷香蕉久久久久久| 欧美一级黄色网| 亚洲综合视频一区| 欧美日韩一区综合| 亚洲自拍偷拍网址| 亚洲欧美日韩在线播放| 欧美.www| 亚洲国产另类精品专区| 久久综合九色综合网站| 免费成人美女女| 一区二区三区高清视频在线观看 | 裸体歌舞表演一区二区| 亚洲国产美女久久久久| 亚洲久久成人| 国产亚洲aⅴaaaaaa毛片| 麻豆精品在线观看| 欧美视频导航| 欧美激情影音先锋| 国产欧亚日韩视频| 亚洲欧洲在线一区| 狠狠色狠色综合曰曰| 亚洲精品一区二区三区蜜桃久| 亚洲欧洲日本在线| 国产农村妇女毛片精品久久麻豆| 久久xxxx精品视频| 欧美亚州在线观看| 亚洲精品免费一二三区| 国产一区二区丝袜高跟鞋图片 | 亚洲视频第一页| 久久综合伊人| 久久人人看视频| 国产精品欧美风情| 一区二区高清视频在线观看| 伊人久久大香线| 久久精品人人做人人爽| 欧美在线播放一区| 国产精品成人一区二区三区吃奶 | 老牛嫩草一区二区三区日本| 欧美片第一页| 亚洲精品看片| 这里只有精品视频| 国产精品久久久久久户外露出| 国产精品久久久久婷婷| 一区二区91| 欧美一区二区在线看| 国内久久精品视频| 久久精品夜色噜噜亚洲a∨| 亚洲欧美国产精品专区久久| 欧美香蕉大胸在线视频观看| 亚洲免费观看高清完整版在线观看熊 | 国产精品xxxxx| 亚洲欧美日韩天堂| 久久久av水蜜桃| 最新国产成人在线观看| 欧美日韩亚洲免费| 久久久久久亚洲综合影院红桃| 欧美二区在线看| 午夜精品国产更新| 先锋影院在线亚洲| 亚洲成人在线网| 久久综合图片| 亚洲欧美日韩国产综合在线| 亚洲综合精品一区二区| 国产综合香蕉五月婷在线| 亚洲欧美久久久| 亚洲美洲欧洲综合国产一区| 欧美一级成年大片在线观看| 亚洲国产精品小视频| 午夜精品国产更新| 国产区二精品视| 久久九九精品| 亚洲国产精品一区二区第四页av| 一区二区三区视频在线| 一色屋精品视频在线看| 国产精品色午夜在线观看| 欧美日韩国产大片| 欧美日韩第一区| 欧美精品久久久久久久| 欧美电影美腿模特1979在线看| 欧美专区日韩专区| 久久久久看片| 欧美大学生性色视频| 欧美国产先锋| 国产日韩欧美不卡| 精品99一区二区三区| 欧美亚洲视频在线看网址| 亚洲一区二区三区在线视频| 亚洲一区二区动漫| 久久精品欧美| 欧美国产一区二区三区激情无套| 免费在线观看精品| 欧美精品久久99| 国产主播一区二区三区| 亚洲国产精品精华液2区45| 一区二区三区**美女毛片 | 亚洲欧美日韩另类| 久久国产精品亚洲va麻豆| 一本大道av伊人久久综合| 日韩写真在线| 噜噜噜噜噜久久久久久91| 亚洲国产精品成人综合| 亚洲欧洲三级电影| 一区二区高清在线| 久久久久久午夜| 国产视频在线观看一区| 亚洲精品一区在线| 久久精品99| 国产精品99久久久久久宅男 | 国产亚洲精品综合一区91| 国产精品一区二区在线观看网站| 亚洲电影免费观看高清完整版在线观看| 日韩一级二级三级| 久久国产精品亚洲va麻豆| 在线亚洲一区二区| 久久综合五月天婷婷伊人| 欧美性感一类影片在线播放| 在线播放不卡| 女主播福利一区| 欧美岛国激情| aa日韩免费精品视频一| 亚洲国产高清一区| 久热精品视频在线观看一区| 久久香蕉国产线看观看网| 亚洲欧美日本视频在线观看| 国产精品麻豆va在线播放| 性做久久久久久久久| 亚洲私拍自拍| 国产日韩欧美精品在线| 欧美在线观看视频| 欧美一区免费| 亚洲福利在线视频| 亚洲精品乱码久久久久久黑人 | 亚洲亚洲精品在线观看 | 亚洲一区二区三区激情| 欧美视频一区二区三区| 一区二区三区四区国产| 亚洲欧美999| 亚洲激情网站免费观看| 亚洲一区二区免费看| 亚洲七七久久综合桃花剧情介绍| 亚洲精品一区二区网址| 欧美午夜免费| 亚洲黄色影院| 欧美日韩一区二区在线播放| 午夜亚洲福利| 欧美成人tv| 久久久精彩视频| 欧美日韩国产色综合一二三四| 欧美一区免费视频| 欧美精品亚洲精品| 久久精品国产96久久久香蕉| 久久久久九九九| 亚洲婷婷在线| 欧美日本成人| 亚洲国产成人av好男人在线观看| 国产精品尤物| 久久福利电影|