Difference between revisions of "Template:Object Types"

From Free Pascal wiki
Jump to navigationJump to search
m (Adding links)
m
Line 3: Line 3:
 
! Feature
 
! Feature
 
! [[Record]]
 
! [[Record]]
 +
! [[Record#Advanced_record|Adv Record]]
 
! [[Object]]
 
! [[Object]]
 
! [[Class]]
 
! [[Class]]
 
|-
 
|-
 
| Encapsulation (combining data and methods + hiding visibility)
 
| Encapsulation (combining data and methods + hiding visibility)
 +
| No
 
| Yes
 
| Yes
 
| Yes
 
| Yes
Line 12: Line 14:
 
|-
 
|-
 
| [[Inherited|Inheritance]]
 
| [[Inherited|Inheritance]]
 +
| No
 
| No
 
| No
 
| Yes
 
| Yes
Line 17: Line 20:
 
|-
 
|-
 
| Class constrcutor and destrutor
 
| Class constrcutor and destrutor
 +
| No
 
| Yes
 
| Yes
 
| Yes
 
| Yes
Line 22: Line 26:
 
|-
 
|-
 
| Polymorphism (virtual methods)
 
| Polymorphism (virtual methods)
 +
| No
 
| No
 
| No
 
| Yes
 
| Yes
Line 27: Line 32:
 
|-
 
|-
 
| Memory allocation
 
| Memory allocation
 +
| Stack
 
| Stack
 
| Stack
| Stack
+
| Stack  
| Heap
+
| Heap (Only)
 
|-
 
|-
 
| Operator overload (global)
 
| Operator overload (global)
 +
| No
 
| Yes
 
| Yes
 
| Yes
 
| Yes
Line 37: Line 44:
 
|-
 
|-
 
| Operator overload (in type only)
 
| Operator overload (in type only)
 +
| No
 
| Yes
 
| Yes
 
| No
 
| No
Line 42: Line 50:
 
|-
 
|-
 
| Type helpers
 
| Type helpers
 +
| No
 
| Yes
 
| Yes
 
| No
 
| No
Line 47: Line 56:
 
|-
 
|-
 
| Virtual constructors, class reference
 
| Virtual constructors, class reference
 +
| No
 
| No
 
| No
 
| No
 
| No
 
| Yes
 
| Yes
 
|-
 
|-
| Variant part (case) as c++ union
+
| Variant part (case) as c/c++ union
 +
| Yes
 
| Yes
 
| Yes
 
| No
 
| No
Line 57: Line 68:
 
|-
 
|-
 
| Bitpacked (really packing)
 
| Bitpacked (really packing)
 +
| Yes
 
| Yes
 
| Yes
 
| No
 
| No

Revision as of 00:03, 18 February 2021

Feature Record Adv Record Object Class
Encapsulation (combining data and methods + hiding visibility) No Yes Yes Yes
Inheritance No No Yes Yes
Class constrcutor and destrutor No Yes Yes Yes
Polymorphism (virtual methods) No No Yes Yes
Memory allocation Stack Stack Stack Heap (Only)
Operator overload (global) No Yes Yes Yes
Operator overload (in type only) No Yes No No
Type helpers No Yes No Yes
Virtual constructors, class reference No No No Yes
Variant part (case) as c/c++ union Yes Yes No No
Bitpacked (really packing) Yes Yes No No

Modified from https://forum.lazarus.freepascal.org/index.php/topic,30686.30.html (original author: ASerge).