The Gerris Object System

From Gerris

(Difference between revisions)
Jump to: navigation, search
Revision as of 01:24, 10 December 2007
Zaleski (Talk | contribs)
(This is just a placeholder)
← Previous diff
Revision as of 16:43, 21 August 2012
GeordieMcBain (Talk | contribs)
(linked to GLib, Gnome, GTK+, C operator precedence table, etc.)
Next diff →
Line 1: Line 1:
-Gerris and Gts are programmed in a style analogous to that of Glib, Gnome and GTK . It is a style of C programming that offers several advantages: +Gerris and [http://gts.sf.net GTS] are programmed in a style analogous to that of [http://developer.gnome.org/glib GLib], [http://developer.gnome.org Gnome] and [http://developer.gnome.org/platform-overview/stable/gtk GTK+]. It is a style of C programming that offers several advantages:
-* Most aspects of Object-Oriented Programming (OOP) , such as the existence of classes with their own methods and inheritance.+* Most aspects of Object-Oriented Programming (OOP), such as the existence of classes with their own methods and inheritance.
-* The ability to interface to other programming languages. (As far as I know, this feature is not used in Gerris/Gts)+* The ability to interface to other programming languages. (As far as I know, this feature is not used in Gerris, but this has been exploited to give GTS [http://python.org Python] bindings in [http://pygts.sf.net PyGTS].)
- +
-To implement Object-Oriented Programming, Gerris/Gts uses its own “Object system”. This system is analogous to the Glib object system (Gobject), but not identical to it. +
 +To implement Object-Oriented Programming, Gerris/GTS uses its own ‘Object system’. This system is analogous to the GLib object system ([http://developer.gnome.org/gobject GObject]), but not identical to it.
Line 29: Line 28:
In that case, because '()' has precedence over indirection '*', In that case, because '()' has precedence over indirection '*',
we would define a function of an integer returning a pointer to an integer. we would define a function of an integer returning a pointer to an integer.
-(That precedence table comes handy here.)+(That [http://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html#Operator-Precedence C operator precedence table] comes in handy here.)

Revision as of 16:43, 21 August 2012

Gerris and GTS are programmed in a style analogous to that of GLib, Gnome and GTK+. It is a style of C programming that offers several advantages:

  • Most aspects of Object-Oriented Programming (OOP), such as the existence of classes with their own methods and inheritance.
  • The ability to interface to other programming languages. (As far as I know, this feature is not used in Gerris, but this has been exploited to give GTS Python bindings in PyGTS.)

To implement Object-Oriented Programming, Gerris/GTS uses its own ‘Object system’. This system is analogous to the GLib object system (GObject), but not identical to it.


THIS CHAPTER IS CURRENTLY BEING WRITTEN.


Note for dummies: pointers to functions

At this stage you (or your teacher if this is a live class) should remind the basic facts about pointers to functions. Remember in particular that

int foo(int bar);

declares a function of an integer returning an integer and

int (*ptr_foo) (int bar);

declares a pointer to an integer function. If we were to write

int *ptr_foo (int bar);

In that case, because '()' has precedence over indirection '*', we would define a function of an integer returning a pointer to an integer. (That C operator precedence table comes in handy here.)

Personal tools
communication