GInitable: GInitable

Description Methods and Functions Hierarchy Implementations Detailed Description Structures Author(s) References

Description

Failable object initialization interface

Methods and Functions

gInitableInit(object, cancellable = NULL, .errwarn = TRUE)
gInitableNew(object.type, cancellable, ..., .errwarn = TRUE)

Hierarchy

1
2
GInterface
   +----GInitable

Implementations

GInitable is implemented by GSocket.

Detailed Description

GInitable is implemented by objects that can fail during initialization. If an object implements this interface the gInitableInit function must be called as the first thing after construction. If gInitableInit is not called, or if it returns an error, all further operations on the object should fail, generally with a G_IO_ERROR_NOT_INITIALIZED error.

Users of objects implementing this are not intended to use the interface method directly, instead it will be used automatically in various ways. For C applications you generally just call gInitableNew directly, or indirectly via a fooThingNew() wrapper. This will call gInitableInit under the cover, returning NULL and setting a GError on failure.

For bindings in languages where the native constructor supports exceptions the binding could check for objects implemention GInitable during normal construction and automatically initialize them, throwing an exception on failure.

Structures

GInitable

Interface for initializable objects. Since 2.22

Author(s)

Derived by RGtkGen from GTK+ documentation

References

https://developer.gnome.org/gio/stable/GInitable.html


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.

Related to GInitable in RGtk2...