https://wiki.freepascal.org/index.php?title=TObject&feed=atom&action=history
TObject - Revision history
2024-03-28T15:01:30Z
Revision history for this page on the wiki
MediaWiki 1.35.6
https://wiki.freepascal.org/index.php?title=TObject&diff=128421&oldid=prev
Djzepi at 15:23, 13 November 2019
2019-11-13T15:23:43Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:23, 13 November 2019</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''TObject''' is the base class for any other class, whether you declare it or not. It provides only some very generic methods, mostly virtual. The rationale for TObject is that in Object Pascal every class must be derived from another, TObject being the exception that ends the derivation chain.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{{TObject}}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''<ins class="diffchange diffchange-inline"><syntaxhighlight lang="pascal" inline></ins>TObject<ins class="diffchange diffchange-inline"></syntaxhighlight></ins>''' is the base <ins class="diffchange diffchange-inline">[[Class|<syntaxhighlight lang="pascal" inline></ins>class<ins class="diffchange diffchange-inline"></syntaxhighlight>]] </ins>for any other <ins class="diffchange diffchange-inline"><syntaxhighlight lang="pascal" inline></ins>class<ins class="diffchange diffchange-inline"></syntaxhighlight></ins>, whether you declare it or not. It provides only some very generic <ins class="diffchange diffchange-inline">[[Method|</ins>methods<ins class="diffchange diffchange-inline">]]</ins>, mostly <ins class="diffchange diffchange-inline">[[</ins>virtual<ins class="diffchange diffchange-inline">|<syntaxhighlight lang="pascal" inline>virtual</syntaxhighlight>]]</ins>. The rationale for <ins class="diffchange diffchange-inline"><syntaxhighlight lang="pascal" inline></ins>TObject<ins class="diffchange diffchange-inline"></syntaxhighlight> </ins>is that in <ins class="diffchange diffchange-inline">[[</ins>Object Pascal<ins class="diffchange diffchange-inline">]] </ins>every <ins class="diffchange diffchange-inline"><syntaxhighlight lang="pascal" inline></ins>class<ins class="diffchange diffchange-inline"></syntaxhighlight> </ins>must be derived from another, <ins class="diffchange diffchange-inline"><syntaxhighlight lang="pascal" inline></ins>TObject<ins class="diffchange diffchange-inline"></syntaxhighlight> </ins>being the exception that ends the derivation chain.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">The [[Constructor|<syntaxhighlight lang="pascal" inline>constructor</syntaxhighlight>]] <syntaxhighlight lang="pascal" inline> TObject.Create()</syntaxhighlight>, inherited by every other <syntaxhighlight lang="pascal" inline>class</syntaxhighlight> by default, can be hidden declaring another <syntaxhighlight lang="pascal" inline>constructor</syntaxhighlight> with the same name in the derived <syntaxhighlight lang="pascal" inline>class</syntaxhighlight>, with or without parameters. This come handy implementing the [[Singleton pattern]].</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><syntaxhighlight lang="pascal"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> { Defined in objpash.inc }</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">The [[constructor]] TObject.Create(), inherited by every other class by default, can be hidden declaring another constructor with the same name in the derived class, with or without parameters. This come handy implementing the [[Singleton pattern]].</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><syntaxhighlight></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>constructor Create; </div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>constructor Create; </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>destructor Destroy; virtual;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>destructor Destroy; virtual;</div></td></tr>
</table>
Djzepi
https://wiki.freepascal.org/index.php?title=TObject&diff=104394&oldid=prev
Arent at 18:17, 6 October 2016
2016-10-06T18:17:22Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:17, 6 October 2016</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''TObject''' is the base class for any other class, whether you declare it or not. It provides only some very generic methods, mostly virtual. The rationale for TObject is that in Object Pascal every class must be derived from another, TObject being the exception that ends the derivation chain.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''TObject''' is the base class for any other class, whether you declare it or not. It provides only some very generic methods, mostly virtual. The rationale for TObject is that in Object Pascal every class must be derived from another, TObject being the exception that ends the derivation chain.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The [[constructor]] TObject.Create(), inherited by every other class by default, can be hidden declaring another constructor with the same name in the derived class, with or without parameters. This come handy implementing the <del class="diffchange diffchange-inline">'''</del>Singleton<del class="diffchange diffchange-inline">''' </del>pattern.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The [[constructor]] TObject.Create(), inherited by every other class by default, can be hidden declaring another constructor with the same name in the derived class, with or without parameters. This come handy implementing the <ins class="diffchange diffchange-inline">[[</ins>Singleton pattern<ins class="diffchange diffchange-inline">]]</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight></div></td></tr>
</table>
Arent
https://wiki.freepascal.org/index.php?title=TObject&diff=104393&oldid=prev
Arent at 18:16, 6 October 2016
2016-10-06T18:16:02Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:16, 6 October 2016</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l48" >Line 48:</td>
<td colspan="2" class="diff-lineno">Line 48:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function GetHashCode: PtrInt; virtual;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function GetHashCode: PtrInt; virtual;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function ToString: ansistring; virtual;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function ToString: ansistring; virtual;</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><<ins class="diffchange diffchange-inline">/</ins>syntaxhighlight></div></td></tr>
</table>
Arent
https://wiki.freepascal.org/index.php?title=TObject&diff=104392&oldid=prev
Arent at 18:15, 6 October 2016
2016-10-06T18:15:43Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:15, 6 October 2016</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>TObject is the base class for any other class, <del class="diffchange diffchange-inline">either </del>you declare it or not. It provides only some very generic methods, mostly virtual. The rationale for TObject is that in Object Pascal every class must be derived from another, TObject being the exception that ends the derivation chain.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">'''</ins>TObject<ins class="diffchange diffchange-inline">''' </ins>is the base class for any other class, <ins class="diffchange diffchange-inline">whether </ins>you declare it or not. It provides only some very generic methods, mostly virtual. The rationale for TObject is that in Object Pascal every class must be derived from another, TObject being the exception that ends the derivation chain.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The constructor TObject.Create(), inherited by every other class by default, can be hidden declaring another constructor with the same name in the derived class, with or without parameters. This come handy implementing the '''Singleton''' pattern.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The <ins class="diffchange diffchange-inline">[[</ins>constructor<ins class="diffchange diffchange-inline">]] </ins>TObject.Create(), inherited by every other class by default, can be hidden declaring another constructor with the same name in the derived class, with or without parameters. This come handy implementing the '''Singleton''' pattern.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight></div></td></tr>
</table>
Arent
https://wiki.freepascal.org/index.php?title=TObject&diff=104385&oldid=prev
Kormoran: Created page with "TObject is the base class for any other class, either you declare it or not. It provides only some very generic methods, mostly virtual. The rationale for TObject is that in O..."
2016-10-06T17:32:09Z
<p>Created page with "TObject is the base class for any other class, either you declare it or not. It provides only some very generic methods, mostly virtual. The rationale for TObject is that in O..."</p>
<p><b>New page</b></p><div>TObject is the base class for any other class, either you declare it or not. It provides only some very generic methods, mostly virtual. The rationale for TObject is that in Object Pascal every class must be derived from another, TObject being the exception that ends the derivation chain.<br />
<br />
The constructor TObject.Create(), inherited by every other class by default, can be hidden declaring another constructor with the same name in the derived class, with or without parameters. This come handy implementing the '''Singleton''' pattern.<br />
<br />
<syntaxhighlight><br />
constructor Create; <br />
destructor Destroy; virtual;<br />
class function newinstance : tobject; virtual;<br />
procedure CleanupInstance;<br />
procedure FreeInstance; virtual;<br />
<br />
function SafeCallException(exceptobject : tobject; exceptaddr : codepointer) : HResult; virtual;<br />
procedure DefaultHandler(var message);virtual;<br />
procedure Free;<br />
<br />
class function InitInstance(instance : pointer) : tobject; <br />
class function ClassType : tclass; <br />
class function ClassInfo : pointer;<br />
class function ClassName : shortstring;<br />
class function ClassNameIs(const name : string) : boolean;<br />
class function ClassParent : tclass;<br />
class function InstanceSize : SizeInt;<br />
class function InheritsFrom(aclass : tclass) : boolean;<br />
class function StringMessageTable : pstringmessagetable;<br />
class function MethodAddress(const name : shortstring) : codepointer;<br />
class function MethodName(address : codepointer) : shortstring;<br />
function FieldAddress(const name : shortstring) : pointer;<br />
<br />
procedure AfterConstruction;virtual;<br />
procedure BeforeDestruction;virtual;<br />
<br />
procedure DefaultHandlerStr(var message);virtual;<br />
<br />
procedure Dispatch(var message);virtual;<br />
procedure DispatchStr(var message);virtual;<br />
<br />
function GetInterface(const iid : tguid; out obj) : boolean;<br />
function GetInterface(const iidstr : shortstring;out obj) : boolean;<br />
function GetInterfaceByStr(const iidstr : shortstring; out obj) : boolean;<br />
function GetInterfaceWeak(const iid : tguid; out obj) : boolean;<br />
<br />
class function GetInterfaceEntry(const iid : tguid) : pinterfaceentry;<br />
class function GetInterfaceEntryByStr(const iidstr : shortstring) : pinterfaceentry;<br />
class function GetInterfaceTable : pinterfacetable;<br />
<br />
class function UnitName : ansistring;<br />
function Equals(Obj: TObject) : boolean; virtual;<br />
function GetHashCode: PtrInt; virtual;<br />
function ToString: ansistring; virtual;<br />
<syntaxhighlight></div>
Kormoran