Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GObject
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Fundamental types=== Types that do not have any associated [[class (programming)|class]]es are called ''non-classed''. These types, together with all types that correspond to some form of [[root class]], are known as ''fundamental types'': the types from which all other types are derived. These make up a relatively closed set, but although the average user is not expected to create their own fundamental types, the possibility does exist and has been exploited to create custom [[class hierarchy|class hierarchies]] — i.e., class hierarchies not based on the <code>GObject</code> class. As of GLib 2.9.2,<ref>{{cite web|url=https://developer.gnome.org/gobject/stable|title=GObject Reference Manual - Stable}}</ref> the ''non-classed'' built-in fundamental types are: * an empty type, corresponding to C's <code>void</code> (<code>G_TYPE_NONE</code>); * types corresponding to C's signed and unsigned <code>char</code>, <code>int</code>, <code>long</code>, and 64-bit integers (<code>G_TYPE_CHAR</code>, <code>G_TYPE_UCHAR</code>, <code>G_TYPE_INT</code>, <code>G_TYPE_UINT</code>, <code>G_TYPE_LONG</code>, <code>G_TYPE_ULONG</code>, <code>G_TYPE_INT64</code>, and <code>G_TYPE_UINT64</code>); * a Boolean type (<code>G_TYPE_BOOLEAN</code>); * an enumeration type and a “flags” type, both corresponding to C's <code>enum</code> type, but differing in that the latter is only used for [[bit field]]s (<code>G_TYPE_ENUM</code> and <code>G_TYPE_FLAGS</code>); * types for single- and double-precision [[IEEE float]]s, corresponding to C's <code>float</code> and <code>double</code> (<code>G_TYPE_FLOAT</code> and <code>G_TYPE_DOUBLE</code>); * a string type, corresponding to C's <code>char *</code> (<code>G_TYPE_STRING</code>); * an opaque pointer type, corresponding to C's <code>void *</code> (<code>G_TYPE_POINTER</code>). The ''classed'' built-in fundamental types are: * a base class type for instances of <code>GObject</code>, the root of the standard class inheritance tree (<code>G_TYPE_OBJECT</code>) * a base interface type, analogous to the base class type but representing the root of the standard ''interface'' inheritance tree (<code>G_TYPE_INTERFACE</code>) * a type for [[Boxed type|boxed]] structures, which are used to wrap simple value objects or foreign objects in reference-counted “boxes” (<code>G_TYPE_BOXED</code>) * a type for “parameter specification objects,” which are used in GObject to describe [[metadata]] for object properties (<code>G_TYPE_PARAM</code>). Types that can be instantiated automatically by the type system are called ''instantiable''. An important characteristic of these types is that the first bytes of any instance always contain a pointer to the ''class structure'' (a form of [[virtual table]]) associated to the type of the instance. For this reason, any instantiable type must be classed. Contrapositively, any non-classed type (such as ''integer'' or ''string'') must be non-instantiable. On the other hand, most classed types are instantiable, but some, such as interface types, are not.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)