comparison final_main/chapter3.tex @ 22:97f70e469150

add svg
author mir3636
date Thu, 16 Feb 2017 07:14:40 +0900
parents 11058e51adb7
children 37f6991465b0
comparison
equal deleted inserted replaced
21:151e3fd72185 22:97f70e469150
80 \section{Gearef、GearImpl} 80 \section{Gearef、GearImpl}
81 Context には Allocation 等で生成した Data Gear へのポインタが格納されている。 81 Context には Allocation 等で生成した Data Gear へのポインタが格納されている。
82 Code Gear が Context にアクセスする際、ポインタを使用してデータを取り出すためコードが煩雑になってしまう(リスト\ref{ref})。 82 Code Gear が Context にアクセスする際、ポインタを使用してデータを取り出すためコードが煩雑になってしまう(リスト\ref{ref})。
83 そこで Code Gear がデータを参照するための Gearef というマクロを定義した。 83 そこで Code Gear がデータを参照するための Gearef というマクロを定義した。
84 Gearef に Context と型を渡すことでデータの参照が行える。 84 Gearef に Context と型を渡すことでデータの参照が行える。
85 また impliment を参照する際も、ポインタでの記述が複雑になってしまうため 同様に GearImpl を定義した。 85 また impliment のデータを参照する際も、ポインタでの記述が複雑になってしまうため 同様に GearImpl を定義した。
86 GearImpl は Context と interface 名、interface の変数名を指定して参照する。 86 GearImpl は Context と interface 名、interface の変数名を指定して参照する。
87 Gearef と GearImpl を用いたコードがリスト\ref{Gearef}である。 87 Gearef と GearImpl を用いたコードがリスト\ref{Gearef}である。
88 88
89 \begin{lstlisting}[frame=lrbt,label=ref,caption={Gearef、GearImplのないコード}] 89 \begin{lstlisting}[frame=lrbt,label=ref,caption={Gearef、GearImplのないコード}]
90 __code pushSingleLinkedStack_stub(struct Context* context) { 90 __code pushSingleLinkedStack_stub(struct Context* context) {