Gobject简介

来源:互联网 发布:如何做淘宝美工 编辑:程序博客网 时间:2024/06/16 03:57

Introduction
Most modern programming languages come with their own native object systems and additional fundamental algorithmic language constructs. Just as GLib serves as an implementation of such fundamental types and algorithms (linked lists, hash tables and so forth), the GLib Object System provides the required implementations of a flexible, extensible, and intentionally easy to map (into other languages) object-oriented framework for C. The substantial elements that are provided can be summarized as:
A generic type system to register arbitrary single-inherited flat and deep derived types as well as interfaces for structured types. It takes care of creation, initialization and memory management of the assorted object and class structures, maintains parent/child relationships and deals with dynamic implementations of such types. That is, their type specific implementations are relocatable/unloadable during runtime.
A collection of fundamental type implementations, such as integers, doubles, enums and structured types, to name a few.
A sample fundamental type implementation to base object hierarchies upon - the GObject fundamental type.
A signal system that allows very flexible user customization of virtual/overridable object methods and can serve as a powerful notification mechanism.
An extensible parameter/value system, supporting all the provided fundamental types that can be used to generically handle object properties or otherwise parameterized types.

  1. 简介
    大多数现代编程语言都有自己的本地对象系统,和基本的算法语言结构。
    就像Glib提供了基本的类型和算法实现(像链表,哈希表等等)。
    Glib对象系统使用c提供了要求一个灵活的、扩展的,有意容易映射到一个面向对象框架的实现。
    这边本质元素提供到如下的总结中:
    <1>.一个通用结构系统能任意注册单继承平面和深度派生类型就像结构化类型的接口一样。
    它负责各种对象和类结构的创建、初始化、内存管理。
    维护了父子关系。处理这种类型的动态实现。
    也就是说,它们的类型特定实现在运行时可重新定位和卸载。
    <2>.一个收集了基本类型的实现,列入整数,浮点,枚举,结构类型。仅举几个例子。
    <3>.基于对象层次结构的基本类型实现 - GObject基本类型。
    <4>.一种信号系统,允许非常灵活的用户定制虚拟/可覆盖对象方法,并可作为强大的通知机制。
    <5>.一个可扩展 参数/值 系统,支持所有提供的基本类型,可用于一般处理对象属性或其他参数化类型。

来自: https://developer.gnome.org/gobject/stable/pr01.html

原创粉丝点击