ObjectClassRef

public struct ObjectClassRef : ObjectClassProtocol

The ObjectClassRef type acts as a lightweight Swift reference to an underlying GObjectClass instance. It exposes methods that can operate on this data type through ObjectClassProtocol conformance. Use ObjectClassRef only as an unowned reference to an existing GObjectClass instance.

The class structure for the GObject type.

(C Language Example):

// Example of implementing a singleton using a constructor.
static MySingleton *the_singleton = NULL;

static GObject*
my_singleton_constructor (GType                  type,
                          guint                  n_construct_params,
                          GObjectConstructParam *construct_params)
{
  GObject *object;

  if (!the_singleton)
    {
      object = G_OBJECT_CLASS (parent_class)->constructor (type,
                                                           n_construct_params,
                                                           construct_params);
      the_singleton = MY_SINGLETON (object);
    }
  else
    object = g_object_ref (G_OBJECT (the_singleton));

  return object;
}
  • ptr
    Untyped pointer to the underlying `GObjectClass` instance.
    

    For type-safe access, use the generated, typed pointer _ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

ObjectClass Record

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GObjectClass>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GObjectClass>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GObjectClass>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GObjectClass>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements ObjectClassProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : ObjectClassProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ObjectClassProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ObjectClassProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ObjectClassProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ObjectClassProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ObjectClassProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)