アットウィキロゴ

ImportRef

概要

別の名前空間からrealにコマンドをimportしたときに、作られるコマンド。
importされたコマンドは、元の名前空間のコマンドテーブルの中の、実際のコマンド構造をポイントする。
実際のコマンドが削除されたときにそれを削除できるように、リアルコマンドは、全てのimportされたコマンドを記録する。

メンバー

  • struct Command *importedCmdPtr; importされた名前空間で作られたimportされたコマンドへのポインタ。これは"real"なコマンドにリダイレクトする。
  • struct ImportRef *nextPtr; "real"コマンドを参照しているimport されたコマンドリストの次のエレメントを指す。realコマンドが削除されたときに使う。

ソース


 /*
  * An imported command is created in an namespace when it imports a "real"
  * command from another namespace. An imported command has a Command structure
  * that points (via its ClientData value) to the "real" Command structure in
  * the source namespace's command table. The real command records all the
  * imported commands that refer to it in a list of ImportRef structures so
  * that they can be deleted when the real command is deleted.
  */
 
 typedef struct ImportRef {
     struct [[Command]] *importedCmdPtr;
 				/* Points to the imported command created in
 				 * an importing namespace; this command
 				 * redirects its invocations to the "real"
 				 * command. */
     struct ImportRef *nextPtr;	/* Next element on the linked list of imported
 				 * commands that refer to the "real" command.
 				 * The real command deletes these imported
 				 * commands on this list when it is
 				 * deleted. */
 } ImportRef;
最終更新:2011年11月03日 10:46