📄 swarm.defobj.definedobject.protocol.html
字号:
<HTML><HEAD><TITLE>DefinedObject</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.53"><LINKREL="HOME"TITLE="Documentation Set for Swarm 2.1.1"HREF="set.html"><LINKREL="UP"TITLE="Defobj Library"HREF="swarm.defobj.sgml.reference.html"><LINKREL="PREVIOUS"TITLE="DefinedClass"HREF="swarm.defobj.definedclass.protocol.html"><LINKREL="NEXT"TITLE="Drop"HREF="swarm.defobj.drop.protocol.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Documentation Set for Swarm 2.1.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="swarm.defobj.definedclass.protocol.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Reference I. Defobj Library</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="swarm.defobj.drop.protocol.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.PROTOCOL">DefinedObject</A></H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN3153"></A><H2>Name</H2>DefinedObject -- Object with defined type and implementation.</DIV><DIVCLASS="REFSECT1"><ANAME="AEN3156"></A><H2>Description</H2><P> DefinedObject is the top-level supertype for all objects that follow the object programming conventions of the defobj library. The messages defined by this type are the only messages which should be assumed to be automatically available on objects that follow these conventions. In particular, use of messages defined by the Object superclass of the GNU Objective C runtime should not generally be assumed because future implementations of some objects might not give continued access to them.</P><P> The DefinedObject type defines a minimum of standard messages, and leaves to other types the definition of message that might or might not apply in any general way to particular objects.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN3160"></A><H2>Protocols adopted by DefinedObject</H2><P>None</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN3163"></A><H2>Methods</H2><DIVCLASS="REFSECT2"><ANAME="AEN3165"></A><H3>Phase: Using</H3><P></P><UL><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M649"></A><P></P>- (BOOL)<BCLASS="FUNCPROTOTYPE">respondsTo:</B> (SEL)<VARCLASS="PDPARAM">aSel</VAR> <BR> The respondsTo: message returns true if the object implements the message identified by the selector argument. To implement a message means only that some method will receive control if the message is sent to the object. (The method could still raise an error.) The respondsTo: message is implemented by direct lookup in a method dispatch table, so is just as fast as a normal message send. It provides a quick way to test whether the type of an object includes a particular message.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M0"></A><P></P>+ (BOOL)<BCLASS="FUNCPROTOTYPE">conformsTo:</B> (Protocol *)<VARCLASS="PDPARAM">protocol</VAR> <BR><P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M334"></A><P></P>- <BCLASS="FUNCPROTOTYPE">getClass</B><BR> getClass returns the class that implements the current behavior of an object.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M510"></A><P></P>- (const char *)<BCLASS="FUNCPROTOTYPE">getTypeName</B><BR> getTypeName returns the name of the originating type of this object.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M104"></A><P></P>- (ref_t)<BCLASS="FUNCPROTOTYPE">addRef:</B> (notify_t)<VARCLASS="PDPARAM">notifyFunction</VAR> <BCLASS="FUNCPROTOTYPE">withArgument:</B> (void *)<VARCLASS="PDPARAM">arg</VAR> <BR> Adds an external reference to an object that is notified when a an object is dropped.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M642"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">removeRef:</B> (ref_t)<VARCLASS="PDPARAM">refVal</VAR> <BR> Remove an external reference to an object.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M198"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">compare:</B> <VARCLASS="PDPARAM">anObject</VAR> <BR> A local implementation of an Object method.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M599"></A><P></P>- <BCLASS="FUNCPROTOTYPE">perform:</B> (SEL)<VARCLASS="PDPARAM">aSel</VAR> <BR> A local implementation of an Object method.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M600"></A><P></P>- <BCLASS="FUNCPROTOTYPE">perform:</B> (SEL)<VARCLASS="PDPARAM">aSel</VAR> <BCLASS="FUNCPROTOTYPE">with:</B> <VARCLASS="PDPARAM">anObject1</VAR> <BR> A local implementation of an Object method.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M601"></A><P></P>- <BCLASS="FUNCPROTOTYPE">perform:</B> (SEL)<VARCLASS="PDPARAM">aSel</VAR> <BCLASS="FUNCPROTOTYPE">with:</B> <VARCLASS="PDPARAM">anObject1</VAR> <BCLASS="FUNCPROTOTYPE">with:</B> <VARCLASS="PDPARAM">anObj2</VAR> <BR> A local implementation of an Object method.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M602"></A><P></P>- <BCLASS="FUNCPROTOTYPE">perform:</B> (SEL)<VARCLASS="PDPARAM">aSel</VAR> <BCLASS="FUNCPROTOTYPE">with:</B> <VARCLASS="PDPARAM">anObject1</VAR> <BCLASS="FUNCPROTOTYPE">with:</B> <VARCLASS="PDPARAM">anObj2</VAR> <BCLASS="FUNCPROTOTYPE">with:</B> <VARCLASS="PDPARAM">anObj3</VAR> <BR> Perform a selector with three object arguments.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M741"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">setDisplayName:</B> (const char *)<VARCLASS="PDPARAM">displayName</VAR> <BR> Assigns a character string as a name that identifies an object for display or debug purposes.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M365"></A><P></P>- (const char *)<BCLASS="FUNCPROTOTYPE">getDisplayName</B><BR> Return a string that identifies an object for external display purposes, either from a previously assigned string or an identification string default <P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M248"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">describe:</B> <VARCLASS="PDPARAM">outputCharStream</VAR> <BR> The describe: message prints a brief description of the object for debug purposes to the object passed as its argument. The object passed as the outputCharStream argument must accept a catC: message as defined in String and OutputStream in the collections library. Particular object types may generate object description strings with additional information beyond the built-in default, which is just to print the hex value of the object id pointer along with the name of its class, and the display name of the object, if any.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M251"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">describeID:</B> <VARCLASS="PDPARAM">outputCharStream</VAR> <BR> Prints a one-line describe string, consisting of the built-in default to outputCharStream.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M948"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">xprint</B><BR> Like describe:, but output goes to standard output.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M949"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">xprintid</B><BR> Like describeID:, but output goes to standard output.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M946"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">xfprint</B><BR> print description for each member of a collection on debug output stream<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M947"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">xfprintid</B><BR> print id for each member of a collection on debug output stream<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.DEFOBJ.DEFINEDOBJECT.METHOD.PU.M535"></A><P></P>- (id <Zone>)<BCLASS="FUNCPROTOTYPE">getZone</B><BR> The getZone message returns the zone in which the object was created.<P></P></DIV></LI></UL></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="swarm.defobj.definedclass.protocol.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="set.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="swarm.defobj.drop.protocol.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">DefinedClass</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="swarm.defobj.sgml.reference.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Drop</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -