Virtual Base Class
多重繼承如下圖的時候
如果要使用
D *dptr = new D();
D->L::para1
會有compiler error :: Ambiguous conversion
因為實際的的compiler 會把 B1與B2 個編譯出一個L 為實體(class table)
所以要取用D 中的 L會有兩個目標出現
==> 解法: 使用virtual base class 在 B1 與 B2
class L { /* ... */ }; // indirect base class
class B1 : virtual public L { /* ... */ };
class B2 : virtual public L { /* ... */ };
class D : public B1, public B2 { /* … */ }; // valid
Ambiguous Base Class:
一樣的Case但是在 B1 與 B2裡面都有命名 變數 nB
若是要使用
D *dptr = new D();
D->nB
則會出現 compiler error
==>解法: 必須將要使用的 nB 定義清楚, 比如說 D->B1::nB 或是 D->B2::nB
詳細程式如下:
參考資料:
https://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Fcplr135.htm
https://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Fcplr135.htm
參考資料: http://www.raspberrypi.com.tw/ http://www.raspberrypi.com.tw/faqs/ https://github.com/raspberrypi http://www.element14.com/community/community/raspberry-pi?view=documents http://www.raspberrypi.org/downloads 電路圖 http://www.raspberrypi.org/wp-content/uploads/2012/04/Raspberry-Pi-Schematics-R1.0.pdf 講師: http://yennan.blogspot.tw/ Raspberry Pi模擬器 QEMU http://zh.wikipedia.org/wiki/QEMU RoR on Pi: http://raspberrypi.stackexchange.com/questions/4597/setting-up-a-ruby-on-rails-server http://elinux.org/RPi_Ruby_on_Rails http://sirlagz.net/2013/02/14/raspbian-server-edition-version-2-3/ 第一堂課: ** ** What is Raspberry Pi: 只需要very low poet Model#B 700ma(3.5W) Model#A 500ma(2.5W) USB only output 500ma Pi —> Python as major programming language. 其他的Embedded System Board相關資源: BeagleBoard 小獵犬 NT 6000 up http://cms.mcuapps.com/series/training-beagles/adopt-a-beagle.html About Hardware in Raspberry Pi (model#B) ARMv6 (ARM11) GPU OpenGL 2.0 1080p 30fps H264/MPEG4 512M main memory TP2 could help to check if problem happen, check if it is 5V. OS: 官方推薦使用Raspbian (change from Debian) http://downloads.raspberrypi.org/raspbian/images/ Pidora. Noobs 比較簡單~但是相當的站記憶體.. Android OS could not run full function on Raspberry Pi, not a chase in Windows. 燒錄OS到Raspberry Pi SD卡 Download image http://www.raspberrypi.org/downloads Download tool for Windows: Mac 使用系統的功能就可以 參考http://computers.tutsplus.com/articles/how-to-flash-an-sd-card-for-raspberry-pi–mac-53600 diskutil list 必須先unmount diskutil unmountdisk /dev/disk2 直接用系統指令去燒錄img (記得檔案名稱要改) dd if=2014-01-07-wheezy-raspbian.img of=/dev/disk1 bs=2m 燒好後記得把 #hdmi_force_hotplug=1 uncomment掉 他會有兩個分割區,一個是FAT(看得到) 另一個需要用工具才能查看. 第二堂課 Raspberry Pi開機/設定 開機流程: GPU啟動,載入bootcode.bin [bootcode.bin]啟動快取與記憶體 載入start.elf [start.elf] 讀取config.txt cmdline.txt 劃分記憶體 載入作業系統 kernel,img (畫面開始出來) 開機選單後,先選取第一個選項讓OS分割區占滿整個記憶卡(原本只占2.8G) 多語言選項 en_US.UTF-8 UTF8 zh_TW BIG5...