Criar  Editar  FrontPage  Índices  Buscar  Alterações  History  RSS  Back  Login

GLib::Type Diff - Ruby-GNOME2 Project Website

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

= class GLib::Type

The GLib Runtime type identification and management system

The GLib::Type API is the foundation of the GObject system. It provides the facilities for registering and managing all fundamental data types, user-defined object and interface types.

== Class Methods
--- GLib::Type[](key)
    Get a GLib::Type for the key.
    * key: type identifier. should be String or Integer.
    * Returns: a new GLib::Type

== Instance Methods
--- to_i
    integer valued type identifier

--- to_s
--- name
    type name

--- to_class
    Returns corresponding ruby class if exist.

--- fundamental
    Returns the fundamental type which is the ancestor of type. Fundamental types are types that serve as fundaments for the derived types, thus they are the roots of distinct inheritance hierarchies.

--- parent
    Returns the direct parent type of the passed in type. If the passed in type has no parent, i.e. is a fundamental type, nil is returned.

--- depth
    Returns the length of the ancestry of the passed in type. This includes the type itself, so that e.g. a fundamental type has depth 1.

--- next_base(root_type)
    Given a leaf_type and a root_type which is contained in its anchestry, return the type that root_type is the immediate parent of. In other words, this function determines the type that is derived directly from root_type which is also a base class of leaf_type. Given a root type and a leaf type, this function can be used to determine the types and order in which the leaf type is descended from the root type.
    * self : Descendant of root_type and the type to be returned.
    * root_type : Immediate parent of the returned type.
    * Returns : Immediate child of root_type and anchestor of leaf_type.

--- type_is_a?(is_a_type)
    If is_a_type is a derivable type, check whether type is a descendant of is_a_type. If is_a_type is an interface, check whether type conforms to it.
    * type : Type to check anchestry for.
    * is_a_type : Possible anchestor of type or interface type could conform to.
    * Returns : TRUE if type is_a is_a_type holds true.

--- children
    Return an array of GLib::Type, listing the child types of type.

--- interfaces
    Return an array of GLib::Type, listing the interface types that type conforms to. The return value has to be g_free()ed after use.

--- class_size

--- instance_size

--- fundamental?
    Returns TRUE if the instance is a fundamental type.

--- derived?
    Returns TRUE if type is derived (or in object-oriented terminology: inherited) from another type (this holds true for all non-fundamental types).

--- interface?
    Returns TRUE if type is an interface type. Interface types are types that provide pure APIs, the implementation of which is provided by another type (which is then said to conform to the interface). GLib interfaces are somewhat analogous to Java interfaces and C++ classes containing only pure virtual functions, with the difference that GLib::Type interfaces are not derivable (but see g_type_interface_add_prerequisite() for an alternative).

--- classed?
    Returns TRUE if type is a classed type.

--- instantiatable?
    Returns TRUE if type can be instantiated. Instantiation is the process of creating an instance (object) of this type.

--- derivable?
    Returns TRUE if type is a derivable type. A derivable type can be used as the base class of a flat (single-level) class hierarchy.

--- deep_derivable?
    Returns TRUE if type is a deep derivable type. A deep derivable type can be used as the base class of a deep (multi-level) class hierarchy.

--- abstract?
    Returns TRUE if type is an abstract type. An abstract type can not be instantiated and is normally used as an abstract base class for derived classes.

--- value_abstract?
    Indicates an abstract value type, i.e. a type that introduces a value table, but can't be used for g_value_init().

--- value_type?
    Returns TRUE if type is a value type

--- has_value_table?
    TRUE if type has a GTypeValueTable.

- ((<sakai>))