JP2009059350A - Information processing apparatus and method, program, and recording medium - Google Patents

Information processing apparatus and method, program, and recording medium Download PDF

Info

Publication number
JP2009059350A
JP2009059350A JP2008185277A JP2008185277A JP2009059350A JP 2009059350 A JP2009059350 A JP 2009059350A JP 2008185277 A JP2008185277 A JP 2008185277A JP 2008185277 A JP2008185277 A JP 2008185277A JP 2009059350 A JP2009059350 A JP 2009059350A
Authority
JP
Japan
Prior art keywords
descriptor
classes
text
operating system
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2008185277A
Other languages
Japanese (ja)
Inventor
Nicholas Simon Myers
マイヤーズ,ニコラス,サイモン
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Symbian Ltd
Original Assignee
Symbian Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Symbian Ltd filed Critical Symbian Ltd
Publication of JP2009059350A publication Critical patent/JP2009059350A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4432Reducing the energy consumption
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Executing Machine-Instructions (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that it is required to minimize the size of an executable code and minimize the number of cycles. <P>SOLUTION: The computer system is provided with: a means for providing a plurality of classes for managing text string data; and a means for managing the text string data to be managed in a memory using a class specified by a user among the plurality of classes provided by the providing means. The providing means provides both classes for managing the text string data by using and not by using a heap memory. An overhead of the executable code is minimized to minimize a required memory capacity, and power consumption is minimized by execution in the minimum number of cycles. The operating system is particularly well suited to ROM based mobile computing devices. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、コンピュータ用のオブジェクト指向オペレーティングシステムの改良に関する。本発明は特に、C++プログラミング技法に基づいたオペレーティングシステムに関する。このオペレーティングシステムの市場で入手可能な実施形態は、英国のPsion Software Plcで製造されるEPOC32オペレーティングシステムである。EPOC32はモバイルコンピュータ環境に適したオペレーティングシステムである。   The present invention relates to improvements in object oriented operating systems for computers. The invention particularly relates to an operating system based on C ++ programming techniques. A commercially available embodiment of this operating system is the EPOC32 operating system manufactured by Psion Software Plc, UK. The EPOC 32 is an operating system suitable for a mobile computer environment.

C++プログラミング言語は、パーソナルコンピュータなどのコンピュータ用のアプリケーションプログラムを記述するのに広く使用されているが、オペレーティングシステムを記述するのには、まれにしか用いられてこなかった。パーソナルコンピュータ用のオペレーティングシステムを記述するときには、通常、実行可能コードのサイズを最小化するという要件、あるいは、プログラム内でステップを実行するのに必要なサイクル数を最小化するという要件は、優先されない。一般的には、性能と記述の容易さがより重要な要件である。
とくになし
The C ++ programming language is widely used to describe application programs for computers such as personal computers, but has rarely been used to describe operating systems. When writing an operating system for a personal computer, the requirement to minimize the size of executable code or to minimize the number of cycles required to execute a step in a program is usually not preferred. . In general, performance and ease of description are more important requirements.
Nothing in particular

しかしながら、他の状況では、(例えば、それを格納するROMおよび/またはRAMの容量を最少とするため)実行可能コードの占めるスペースを最小としなければならず、(例えば、消費電力を最少とするため)最小数のサイクルで実行する必要が生じる場合がある。   However, in other situations, the space occupied by executable code must be minimized (eg, to minimize power consumption) (eg, to minimize the capacity of the ROM and / or RAM that stores it). May need to be executed in a minimum number of cycles.

モバイルコンピューティング(例えば、パーソナルデジタル支援機器:PDA)、スマートフォン(例えば、ワードプロセッサが組み込まれ、ファクシミリの送受信およびインターネットの閲覧が可能なGSMセルラ電話)、およびネットワークコンピュータ(NC)環境は、オペレーティングシステムのコードサイズを最小化することが利点となる環境の実例である。すなわち、最小化によって、ハードウェア(特にROMおよび/またはRAM)のコストを削減することができる。広範囲に及ぶ民生用機器への適用は、一般的にハードウェアの価格が相対的に低いことに依存しているので、この点は上記状況において特に重要である。同様に、モバイルコンピューティングおよびスマートフォンの範疇においては、プロセッサの実行サイクルを最小化することは消費電力を最少化し、消費電力の最少化はバッテリの長寿命化に不可欠であるので、非常に重要である。C++で記述され十分に設計されたオペレーティングシステムは、通常、サイズが相当大きく電力をかなり消費するものとなる。従って、これはモバイルコンピューティング、スマートフォンおよびNC環境に適さない。   Mobile computing (eg, personal digital assistants: PDAs), smart phones (eg, GSM cellular phones with built-in word processors that can send and receive facsimiles and browse the Internet), and network computer (NC) environments are It is an example of an environment where it is advantageous to minimize code size. That is, minimization can reduce the cost of hardware (particularly ROM and / or RAM). This is particularly important in the above situation, as extensive consumer applications typically rely on relatively low hardware prices. Similarly, in the category of mobile computing and smartphones, minimizing processor execution cycles minimizes power consumption, and minimizing power consumption is critical to extending battery life. is there. A well-designed operating system written in C ++ is usually quite large and consumes considerable power. This is therefore not suitable for mobile computing, smartphones and NC environments.

更に、コードサイズとオーバーヘッドサイクルの厳しい要求、特に、モバイル、スマートフォンおよびNCコンピューティング環境に関する厳しい要求を満たし、十分に機能的なオペレーティングシステムをC++で設計するのは、一般的に困難であると考えられている。   In addition, it is generally considered difficult to design a fully functional operating system in C ++ that meets the stringent requirements of code size and overhead cycles, especially the demanding requirements of mobile, smartphone and NC computing environments. It has been.

(用語)
「ストリングクラスのオブジェクト」
C++では、テキスト(例えば、コンピュータの画面に実際に現れる文字のストリング(文字列))は「オブジェクト」として表わされる。C++または他のオブジェクト指向言語の当業者は、このカテゴリ化に精通しているであろう。このようなテキストに関連したオブジェクトは、「ストリングクラスのオブジェクト」と呼ばれる特定のタイプである。オブジェクトが属するクラスの種類(例えば、テキストの場合はストリングクラス)は、そのオブジェクトに実行することが許される操作を規定する。ストリングクラスには一定の操作(例えば、2つのテキストストリングをまとめて連結すること)だけが行える。従って、ストリングクラスのある特定のオブジェクトは、特定のテキストストリングを表わしている。それは特定の、十分に定義された方法でのみ操作される。
(the term)
"String Class Objects"
In C ++, text (eg, a string of characters that actually appears on a computer screen) is represented as an “object”. Those skilled in the art of C ++ or other object-oriented languages will be familiar with this categorization. Such text-related objects are of a specific type called “string class objects”. The type of class to which the object belongs (eg, a string class in the case of text) defines the operations that are allowed to be performed on the object. Only certain operations (eg, concatenating two text strings together) can be performed on a string class. Thus, a particular object of the string class represents a specific text string. It is only operated in a specific, well-defined way.

テキストがファイリングシステムのファイルに存在するとき、テキストの項目からストリングクラスのオブジェクトを生成するためには、従来のC++プログラミングでは以下のステップが実行される:
・メモリ内のバッファ位置をずらす。
・ファイル読み取りサービスを使用してテキストをバッファに読み込む。
・ストリング生成サービスを使用して、バッファされたデータをストリングクラスのオブジェクトに変える。
・バッファの内容を破棄する。
To create a string class object from an item of text when the text is present in a filing system file, conventional C ++ programming performs the following steps:
• Shift the buffer position in memory.
Read the text into the buffer using a file read service.
Use a string generation service to turn buffered data into string class objects.
-Discard the contents of the buffer.

C++ではテキストストリングの実際の格納位置を識別するのは困難であるが、テキストストリングの位置を知る必要はない。なぜなら、直接操作するのはストリングクラスのオブジェクトであり、その結果実際のテキストストリングが操作されるからである。従って、ストリングクラスのオブジェクトは、事実上テキストストリングのメモリ位置を知っており、テキスト操作に関連する必要なメモリ管理タスクの全てを扱うことができる。   In C ++, it is difficult to identify the actual storage position of the text string, but it is not necessary to know the position of the text string. This is because it is a string class object that is directly manipulated, so that the actual text string is manipulated. Thus, a string class object knows virtually the memory location of a text string and can handle all of the necessary memory management tasks associated with text manipulation.

(ストリングクラスのオブジェクトの多重クラス)
ANSI/ISOのC++標準の草案(ドラフト)として知られるC++のバージョンでは、ストリングクラスの全てのオブジェクト(例えば、上記標準のスタンダードライブラリの草案の部分で、<string>として参照されるストリングクラス)は、洗練されたメモリ管理タスクを実行可能な方法で処理される(例えば、拡張や、縮小や、結合が可能な、すなわち、完全に動的な、テキスト用のバッファスペースの再配置)。しかし、このレベルのメモリ管理は、大量のコードを使用し、非常に大きなヒープ空間を必要とする。
(Multiple classes of string class objects)
In the C ++ version, known as the ANSI / ISO C ++ standard draft, all objects of the string class (for example, the string class referred to as <string> in the standard library draft section above) are Sophisticated memory management tasks are handled in a way that is feasible (e.g. expansion, contraction, and merging, i.e. fully dynamic, buffer space relocation for text). However, this level of memory management uses a large amount of code and requires a very large heap space.

ここで従来のC++のメモリ管理の2つの例を示す。   Here, two examples of conventional C ++ memory management are shown.

(例1:C++のリテラルテキストの処理)
C++では、ソースコードがテキストストリングを含むインスタンスが多数ある。これらのテキストストリングは「リテラルテキスト」として知られ、ソースコードを実行可能なオブジェクトコードへとコンパイルする時に、リテラルテキストはバッファメモリに永久的に格納される。リテラルテキストを操作するときは、ストリングクラスのオブジェクトを、そこから生成しなければならない。しかしながら、このストリングクラスのオブジェクトを生成することで、メモリ内にテキストストリングが生成されることになり、このテキストストリングは、新たに生成されたストリングクラスのオブジェクトによって実際に操作されることになる。要するに、テキストストリングがメモリ内で複製されるのである。すなわち、テキストストリングは、ソースコードのコンパイルによって生じるオリジナルバッファで一度生成され、さらに、テキストの操作を可能とするストリングクラスのオブジェクトに関連したメモリ位置で再度生成される。
(Example 1: C ++ literal text processing)
In C ++, there are many instances where the source code contains a text string. These text strings are known as “literal text” and are literally stored in buffer memory when the source code is compiled into executable object code. When working with literal text, you must create a string class object from it. However, by generating this string class object, a text string is generated in memory, and this text string is actually manipulated by the newly generated string class object. In short, the text string is duplicated in memory. That is, the text string is generated once in the original buffer resulting from the compilation of the source code, and is again generated at the memory location associated with the string class object that allows the manipulation of the text.

上記のように、あるコンピュータ環境では、コード空間および消費電力は重要である。しかしながら、(ANSI/ISOのC++標準の草案で実現されるような)従来のC++では、リテラルテキストに特有の複製を解消する機構がない。オペレーティングシステムではリテラルテキストを扱わなければならない場合が多数あるので、これはオペレーティングシステムでは特に問題である。   As mentioned above, code space and power consumption are important in certain computer environments. However, with conventional C ++ (as implemented in the ANSI / ISO C ++ standard draft), there is no mechanism to eliminate duplication specific to literal text. This is particularly a problem with operating systems, as the operating system often has to deal with literal text.

(例2:C++の長さが制限されたテキストの処理)
C++では、プログラマはヒープメモリを使用してテキストを処理する。長さが制限されたテキストは、実際には、長さが制限されていないテキストの処理に必要な十分に柔軟な手法を必要としない。それにもかかわらず、従来のC++では、テキストの長さに関係なく、ストリングクラスのオブジェクトに十分特徴付けられた、十分に柔軟な機構しかなく、それ以外の機構がない。ヒープメモリの操作はコードおよびサイクルを集中的に使用するので、これは、メモリ管理コードにおけるオーバーヘッドを大きくしてしまう。
(Example 2: Processing text with C ++ length limited)
In C ++, the programmer uses heap memory to process text. Text with limited length does not actually require the sufficiently flexible approach necessary to process text with unlimited length. Nevertheless, with conventional C ++, there is only a sufficiently flexible mechanism well characterized for string class objects, and no other mechanism, regardless of the length of the text. This increases the overhead in the memory management code because heap memory operations are code and cycle intensive.

全体的に、C++におけるテキストのメモリ管理は、コードおよびサイクルを集中的に使用する。コード空間および消費電力はモバイル環境では重要であるので、従来のC++の手法では、受容できないほどコードサイズが大きく、かつ、電力も大量に消費するオペレーティングシステムとなってしまう。   Overall, text memory management in C ++ is code and cycle intensive. Since code space and power consumption are important in a mobile environment, the conventional C ++ approach results in an operating system that has an unacceptably large code size and consumes a large amount of power.

本発明のオペレーティングシステムは、ストリングクラスのオブジェクト(例えば、ANSI/ISOのC++標準の草案で定義されるような)を、3重構造のストリングクラスのオブジェクト、すなわち、3つの新しいオブジェクトのクラスで置き換えることで再定義する。従来の、ANSI/ISOのC++標準の草案による<string>に機能的に関連し十分特徴付けられたメモリ管理関数は、3つの新しいクラスの全てに適用されない。完全な機能を備えていることは多くの環境で有用であるが、コード空間および消費電力が重要なモバイルコンピューティング環境では(とりわけ)問題である。   The operating system of the present invention replaces a string class object (eg, as defined in the ANSI / ISO C ++ standard draft) with a triple string object, ie three new object classes. Redefine it. Traditionally well-characterized memory management functions that are functionally related to <string> according to the draft ANSI / ISO C ++ standard do not apply to all three new classes. While having full functionality is useful in many environments, it is a problem (among others) in mobile computing environments where code space and power consumption are important.

従って、本発明の一般的な発明思想は、コンピュータのオペレーティングシステムに、テキストストリングを扱う3つの異なったクラス、すなわち、異なる状況にそれぞれ適している3つの異なったクラスを提供することで、コードサイズおよびサイクルオーバヘッドを最小化することである。これによって柔軟性がもたらされる。例えば、完全な機能を有するメモリ管理関数を、実際にそれを必要とするテキストストリングにだけ適用するようにすることができるのである。   Accordingly, the general inventive idea of the present invention is to provide code operating systems with three different classes for handling text strings, ie, three different classes, each suitable for different situations. And minimizing cycle overhead. This provides flexibility. For example, a fully functional memory management function can be applied only to text strings that actually require it.

この新しいストリングクラスのオブジェクトのファミリを「ディスクリプタ(descriptor)」と呼ぶことにする。好適な実施形態では、このファミリのメンバを「ポインタディスクリプタ」、「バッファディスクリプタ」および「ヒープディスクリプタ」と呼ぶ。これらの概念は、当業者が親しんでいる「ポインタ」、「バッファ」および「ヒープ」の確立された概念とは(関連するが)異なることに注意が必要である。また、本明細書で想定するディスクリプタも、同じ名前のVMS設備や、アクティブオペレーティングシステムを識別するのに使用される小さな整数用のUNIX(登録商標)用語とは何の関係もないことにも注意が必要である。当業者は、テキストストリングを扱うクラスの数が3つを越えるようにオペレーティングシステムを設計することも可能であることを理解するだろう。そのような変形も本発明の技術的範囲に含まれる。3重構造は、クラスの増殖(proliferation of Classes)としては最小(かつほとんど全ての場合にもっとも有効)である。   This family of new string class objects will be referred to as “descriptors”. In the preferred embodiment, members of this family are referred to as “pointer descriptors”, “buffer descriptors” and “heap descriptors”. It should be noted that these concepts are different (although related) to the established concepts of “pointers”, “buffers” and “heaps” familiar to those skilled in the art. Also note that the descriptors envisioned herein have nothing to do with the VMS facility of the same name or the small integer UNIX® term used to identify the active operating system. is required. One skilled in the art will appreciate that the operating system can be designed to have more than three classes that handle text strings. Such modifications are also included in the technical scope of the present invention. The triple structure is the least (and most effective in almost all cases) as a propagation of classes.

更に、ディスクリプタは、好ましくはポリモルフィックである(ポリモーフィズムを有する)。従って、単一のサービスが全てのディスクリプタに作用可能である。これによって、かなりのコードと節約でき、また、それよりは程度は小さいが、オーバーヘッドを削減することができる。このような構成でなければ異なったディスクリプタの各々が変更されたサービスを必要とするからである。   Furthermore, the descriptor is preferably polymorphic (has polymorphism). Thus, a single service can work on all descriptors. This saves considerable code and, to a lesser extent, reduces overhead. This is because each of the different descriptors requires a modified service unless such a configuration is used.

本発明の第1の態様によれば、テキストストリングに関するオブジェクトを扱うように構成されたオブジェクト指向オペレーティングシステムでプログラムされたコンピュータであって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった機能を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラス(主に、ポインタディスクリプタクラス、バッファディスクリプタクラスおよびヒープディスクリプタクラス)の1つに属するものとして扱うことを特徴とするコンピュータが提供される。   According to a first aspect of the present invention, a computer programmed with an object-oriented operating system configured to handle objects related to text strings, wherein the operating system changes all of the objects to different ones. Perform functions and treat as belonging to one of three classes (mainly pointer descriptor class, buffer descriptor class and heap descriptor class), at least one of which has been modified to reduce code and cycle overhead A computer characterized by this is provided.

本発明は、コードおよびサイクルオーバヘッドを大幅に削減するためには、従来の単一形態のストリングクラスのオブジェクトを、(例えば)各形態が異なった状況に最適化された、3つの異なった形態のオブジェクトに置き換えて、オペレーティングシステムを再設計する必要があるという知見に基づいている。   In order to significantly reduce code and cycle overhead, the present invention replaces a conventional single form string class object with three different forms (for example), each form optimized for different situations. Based on the knowledge that the operating system needs to be redesigned instead of objects.

本発明の好適な形態では、従来の、メモリを集中的に使用するテキスト処理技法は、そのような技法を要求するオブジェクトを定義する新しいディスクリプタクラス(すなわち、ヒープディスクリプタ)に属するオブジェクトにのみ適用される。一方で、ポインタおよびバッファディスクリプタクラスは、従来のストリングクラスと比べてコードおよびプロセッササイクルを減少させるように設計されている。   In the preferred form of the present invention, conventional memory intensive text processing techniques apply only to objects that belong to a new descriptor class (ie, heap descriptor) that defines objects that require such techniques. The On the other hand, pointer and buffer descriptor classes are designed to reduce code and processor cycles compared to traditional string classes.

上記従来技術で記載した2つの例(すなわち、例1:C++のリテラルテキストの処理と、例2:C++の長さが制限されたテキストの処理)を使用して、本発明のオペレーティングシステムは、(i)リテラルテキストの複製が必要なくなるようにリテラルテキストを扱い、(ii)実際に必要な限られた状況でのみヒープメモリのコードの集中的使用を行い、他の状況(例えば、プログラマが前もってテキストの最大長を知っているとき)では、代わりにスタティックメモリを使用するように、実行時に動的に決定されるテキストを扱う。特定の処理の更なる詳細は以下で説明する(発明を実施するための最良の形態を参照)。   Using the two examples described in the above prior art (ie, Example 1: C ++ literal text processing and Example 2: C ++ length limited text processing), the operating system of the present invention: (I) handle literal text so that duplication of literal text is no longer necessary, (ii) make intensive use of heap memory code only in limited situations where it is actually needed, and (When you know the maximum length of the text), instead of using static memory, handle text that is determined dynamically at runtime. Further details of the specific process are described below (see the best mode for carrying out the invention).

好ましくは、オペレーティングシステムは同じ3重構造を用いて、テキストだけでなく生のデータも扱うように構成される。   Preferably, the operating system is configured to handle not only text but also raw data using the same triple structure.

先に定義したコンピュータ/オペレーティングシステムの組み合わせに加えて、他の発明的側面も同様に認めることができるだろう。例えば、そのようなオペレーティングシステムをインタフェースしなければならないあらゆるデバイスも、ストリングクラスのオブジェクト用の同じ3重構造を使用する必要がある。例えば、固体メモリデバイスのような周辺機器用ドライバソフトウェアは、このような3重構造を使用する必要がある。周辺機器用制御パネルのソフトウェアも同様である。   In addition to the computer / operating system combinations defined above, other inventive aspects could be recognized as well. For example, any device that must interface with such an operating system must use the same triple structure for string class objects. For example, peripheral device driver software such as a solid-state memory device needs to use such a triple structure. The software for the peripheral device control panel is the same.

従って、本発明の第2の態様では、テキストストリングに関するオブジェクトを扱うように構成されたオブジェクト指向オペレーティングシステムでプログラムされたコンピュータの周辺装置であって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった関数を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラス(主に、ポインタディスクリプタクラス、バッファディスクリプタクラスおよびヒープディスクリプタクラス)の1つに属するものとして扱うこと、さらにまた前記周辺装置が、オブジェクトを前記3つのクラスにはいるものとして扱うようにプログラムされていることを特徴とする周辺装置が提供される。   Accordingly, in a second aspect of the present invention, there is provided a computer peripheral device programmed with an object-oriented operating system configured to handle objects related to text strings, wherein the operating system receives all of the objects respectively. Belongs to one of three classes (mainly pointer descriptor class, buffer descriptor class, and heap descriptor class) that perform different functions, at least one of which has been modified to reduce code and cycle overhead A peripheral device is provided, characterized in that the peripheral device is programmed to treat the object as if it were in the three classes.

本発明の第3の態様では、テキストストリングに関するオブジェクトを扱うように構成され、コンピュータで読み取り可能な媒体にコード化されたコンピュータのオペレーティングシステムであって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった関数を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラス(主に、ポインタディスクリプタクラス、バッファディスクリプタクラスおよびヒープディスクリプタクラス)の1つに属するものとして扱うことを特徴とするオペレーティングシステムが提供される。   In a third aspect of the present invention, a computer operating system configured to handle objects related to text strings and encoded on a computer readable medium, the operating system comprising: In one of three classes (mainly pointer descriptor class, buffer descriptor class, and heap descriptor class), each executing a different function, at least one of which has been modified to reduce code and cycle overhead An operating system is provided which is characterized as being treated as belonging.

本発明の第4の態様では、テキストストリングに関するオブジェクトを扱うように構成されたコンピュータのオペレーティングシステムを使用してマイクロプロセッサを操作する方法であって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった関数を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラス(主に、ポインタディスクリプタクラス、バッファディスクリプタクラスおよびヒープディスクリプタクラス)の1つに属するものとして扱うことを特徴とする方法が提供される。   According to a fourth aspect of the present invention, there is provided a method for operating a microprocessor using a computer operating system configured to handle objects related to text strings, wherein the operating system includes: Belongs to one of three classes (mainly pointer descriptor class, buffer descriptor class, and heap descriptor class) that perform different functions, at least one of which has been modified to reduce code and cycle overhead A method is provided that is characterized as being treated as a thing.

第5の態様では、テキストストリングに関するオブジェクトを扱うように構成されたコンピュータのオペレーティングシステムでコード化された、コンピュータで読み取り可能な媒体であって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった関数を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラス(主に、ポインタディスクリプタクラス、バッファディスクリプタクラスおよびヒープディスクリプタクラス)の1つに属するものとして扱うことを特徴とする媒体が提供される。典型的には、コンピュータで読み取り可能な媒体はマスクROMである。配布用に、媒体は一般的なCD−ROMまたはフロッピー(登録商標)ディスクであってもよい。   In a fifth aspect, a computer-readable medium encoded with a computer operating system configured to handle objects related to text strings, wherein the operating system includes all of the objects, each Those that belong to one of three classes (primarily pointer descriptor classes, buffer descriptor classes, and heap descriptor classes) that perform different functions, at least one of which has been modified to reduce code and cycle overhead A medium characterized in that it is treated as is provided. Typically, the computer readable medium is a mask ROM. For distribution, the medium may be a general CD-ROM or floppy disk.

本発明をEPOC32として知られる実施形態に関して説明する。EPOC32は、英国のPsion Software Plcによって開発された、(特に)モバイルおよびスマートフォン環境用の、32ビットオペレーティングシステムである。EPOC32の実施形態のより詳細な説明は、英国のPsion Software Plcによって発行されたEPOC32に関するSDKの、付録1として添付された部分に開示されている。本発明者および譲受人の権利があらゆる意味で限定されない範囲において、SDK全体を本明細書に参照によって組み込む。   The present invention will be described with respect to an embodiment known as EPOC32. EPOC32 is a 32-bit operating system (particularly) for mobile and smartphone environments developed by Psion Software Plc, UK. A more detailed description of the EPOC32 embodiment is disclosed in the part attached to Appendix 1 of the SDK for EPOC32 published by Psion Software Plc, UK. To the extent that the rights of the inventor and assignee are not limited in any way, the entire SDK is incorporated herein by reference.

EPOC32は、多数の異なったマイクロプロセッサアーキテクチャ上で実行するように移植された。オペレーティングシステムの移植の詳細は本質的に本明細書の範囲外であるが、当業者には理解できるであろう。特に、EPOC32は英国のAdvanced RISC MachinesのARM RISC型マイクロプロセッサに移植されている。ARMマイクロプロセッサの様々なモデルは、デジタルセルラ電話に広く使用されており、当業者にはよく知られている。しかしながら、本発明は多数の異なったマイクロプロセッサ上で実現できる。従って、本明細書に添付された特許請求の範囲は、オペレーティングシステムが特許請求の範囲に記載されたような関数を実行する、あらゆる全てのハードウェアおよびソフトウェアの実施に及ぶものと理解すべきである。   The EPOC 32 has been ported to run on a number of different microprocessor architectures. Details of operating system porting are essentially outside the scope of this specification, but will be appreciated by those skilled in the art. In particular, EPOC32 has been ported to the ARM RISC type microprocessor of Advanced RISC Machines in the UK. Various models of ARM microprocessors are widely used in digital cellular telephones and are well known to those skilled in the art. However, the present invention can be implemented on a number of different microprocessors. Accordingly, the claims appended hereto should be understood to cover any and all hardware and software implementations in which the operating system performs the functions as recited in the claims. is there.

上記従来技術の検討で挙げた、リテラルテキストおよび長さが制限されたテキストの例に戻り、EPOC32は、ストリングクラスのオブジェクト用の上記3重構造を以下のように使用する。   Returning to the example of literal text and limited-length text given in the prior art discussion above, EPOC 32 uses the triple structure for string class objects as follows.

(例1:EPOC32におけるリテラルテキスト)
上記のように、従来のC++では、リテラルテキストに関するテキストストリングはメモリ内で複製される。すなわち、ソースコードのコンパイルで生じるオリジナルバッファ内で一度生成され、テキストの操作を可能にするストリングクラスのオブジェクトに関するメモリ位置で再度複製される。この複製は無駄である。
(Example 1: Literal text in EPOC32)
As mentioned above, in conventional C ++, text strings for literal text are duplicated in memory. That is, it is generated once in the original buffer that results from the compilation of the source code and then replicated again at the memory location for the string class object that allows the manipulation of the text. This duplication is useless.

しかしながら、EPOC32は、リテラルテキストの元のメモリ位置(すなわち、コンパイラによって定められたメモリ位置)を指し示すポインタディスクリプタを使用する。このポインタディスクリプタ(EPOC32ではTPtrCポインタディスクリプタと呼ぶ)は、リテラルテキスト用のストリングクラスのオブジェクトである(C++では、通常、本質的にポインタはオブジェクトとして認識されていない)。従って、EPOC32のポインタ/オブジェクトのハイブリッドによって、リテラルテキストの追加のコピーの必要が完全に除去される。   However, EPOC 32 uses a pointer descriptor that points to the original memory location of the literal text (ie, the memory location defined by the compiler). This pointer descriptor (referred to as a TPtrC pointer descriptor in EPOC32) is an object of a string class for literal text (in C ++, normally a pointer is not essentially recognized as an object). Thus, the EPOC32 pointer / object hybrid completely eliminates the need for additional copies of literal text.

(例2:EPOC32における長さが制限されたテキスト)
上記のように、従来のC++では、テキストの長さに関係なく、十分に柔軟で十分に特徴付けられたストリングクラスのオブジェクトを使用する機構しかなく、それ以外を使用する機構はない。ヒープメモリの処理はコードおよびサイクルを集中的に使用するので、これによりメモリ管理コードに多くのオーバーヘッドが生じる。
(Example 2: Text with limited length in EPOC32)
As described above, in conventional C ++, there is only a mechanism that uses a sufficiently flexible and well-characterized string class object regardless of the length of the text, and no other mechanism. Since heap memory processing is code and cycle intensive, this creates a lot of overhead in the memory management code.

EPOC32では、バッファディスクリプタと呼ばれる、サイズが制限された、ストリングオブジェクトの特別なクラスがある。これはサイズが制限されているので、操作するのに複雑なメモリアロケーションコードを必要としない。更に、バッファディスクリプタは(ヒープメモリではなく)スタティックメモリを使用できる。スタティックメモリはヒープメモリで可能なコードを集中的に使用する方式でメモリを再配置することはできないが、必要な操作を行うのに必要となるコードサイクルが少ない点で、使用するのにより効率的である(従って電力の削減となる)。EPOC32は、実際に動的な場合に限って、多くのサイクルオーバヘッドを伴うヒープメモリを使用する。その場合には、ヒープディスクリプタクラスを使用する。   In EPOC32, there is a special class of string objects of limited size called buffer descriptors. Since it is limited in size, it does not require complex memory allocation code to operate. Furthermore, the buffer descriptor can use static memory (not heap memory). Static memory cannot be relocated in a manner that uses heap memory intensive code, but it is more efficient to use because it requires fewer code cycles to perform the necessary operations. (Thus reducing power consumption). The EPOC 32 uses heap memory with a lot of cycle overhead only if it is actually dynamic. In that case, heap descriptor class is used.

EPOC32は、長さが制限されたストリングクラスのパラメータを、「TBuf」クラスのクラステンプレートを使用して定義する(クラステンプレートはストリングクラスの多数のオブジェクトのプロパティを定義する。例えば、TBufは全てのバッファディスクリプタのテンプレート、すなわち、バッファの変形のストリングクラスの全てのオブジェクトのテンプレートである。TBufは、そのようなストリングクラスのオブジェクトの全てに対して一定の共通プロパティを定義する。)。   The EPOC 32 defines a length-limited string class parameter using a class template of the “TBuf” class (a class template defines the properties of a number of objects of the string class. For example, TBuf A template for buffer descriptors, that is, a template for all objects of the string class of buffer variants, TBuf defines certain common properties for all such string class objects.)

EPOC32は、コードサイズおよびサイクルオーバヘッドを最小化することの他に、いくつかの重要な特徴も示す。それは主に以下の点である。
・ストリングおよび生の、データバッファクラスのオブジェクトが、「フラット」構造として動作すること。
・ディスクリプタがポリモルフィック特性(ポリモーフィズム)を与えること。
・ディスクリプタが、ユニコード(UNICODE)およびアスキー(ASCII)の一様なコーディングを可能とすること。
In addition to minimizing code size and cycle overhead, EPOC 32 exhibits several important features. The main points are as follows.
• Strings and raw data buffer class objects behave as “flat” structures.
• Descriptors give polymorphic properties (polymorphism).
Descriptors allow for uniform coding of Unicode (ASCII) and ASCII (ASCII).

(フラット構造としてのストリングおよび生のデータバッファクラスのオブジェクト)
全てのディスクリプタは「フラット」構造である(すなわち、ディスクリプタがコピーされると、ディスクリプタ自身だけがコピーされる。従来のC++では、オブジェクトのコピーは、オブジェクト自身のコピーだけでなく、関連する全てのポインタおよびポインタによって指されているデータのコピー、すなわち、オブジェクトに意味を与える複雑な関連する構造のコピーも必要であった。)。従って、EPOC32では、ディスクリプタをコピーすることは、通常のC++で等価であるオブジェクトをコピーすることよりも、メモリオーバヘッドおよびサイクルにおいてはるかに経済的である。
(Strings as flat structures and raw data buffer class objects)
All descriptors have a “flat” structure (ie, when a descriptor is copied, only the descriptor itself is copied. In conventional C ++, copying an object is not just a copy of the object itself, but all related objects. There was also a need for a copy of the pointer and the data pointed to by the pointer, that is, a copy of the complex associated structure that gives the object meaning. Thus, in EPOC32, copying descriptors is much more economical in memory overhead and cycles than copying objects that are equivalent in normal C ++.

これはEPOC32で、バッファおよびポインタについて以下のように実現される。:
バッファディスクリプタ(TBuf)は、バッファによって参照される実際のテキストを含んでいる。従って、バッファをコピーすると本質的に関連するテキストをコピーすることになる。C++のようにポインタおよび関連するデータのコピーは必要ない。
ポインタディスクリプタ(TPtr)は、C++型のポインタを内部に含んでいるので、複製するときに必要なのはTPtr単体のコピーだけである。従来のC++では、1つのエンティティだけでなく関連する別のポインタおよびテキストもコピーする必要があった。
This is implemented in EPOC 32 as follows for buffers and pointers. :
The buffer descriptor (TBuf) contains the actual text referenced by the buffer. Thus, copying the buffer essentially copies the associated text. There is no need for a copy of the pointer and associated data as in C ++.
Since the pointer descriptor (TPtr) contains a C ++ type pointer, only a copy of the single TPtr is required when copying. In conventional C ++, it was necessary to copy not only one entity but also other related pointers and text.

(ポリモルフィックオブジェクトとしてのディスクリプタ)
共通の作用が異なった機構によって実現されるが、グループ内の全てのオブジェクトが単一のオブジェクトのように作用するとき、そのオブジェクトのグループはポリモルフィズムを示すという。従来のC++では、ポリモルフィズムは仮想関数によって提供される。すなわち、互いにポリモルフィックな全てのオブジェクトは、仮想関数テーブルへのポインタを共通の位置に有している(従って各オブジェクト内にポインタが必要である)。このテーブルは各ポリモルフィック関数に対する実際のコードを識別する。ポリモルフィズムを共有する各クラスに対して別個のテーブルが必要である。しかしこの手法は、各ポインタが32ビット(すなわち4文字)であり各オブジェクトが仮想関数テーブルへのポインタを必要とするので、比較的大きな空間を使用する。更に、各オブジェクトで32ビット長のフィールドも使用される。
(Descriptor as a polymorphic object)
A common effect is achieved by different mechanisms, but when all objects in a group act like a single object, the group of objects is said to exhibit polymorphism. In conventional C ++, polymorphism is provided by virtual functions. That is, all the polymorphic objects have a pointer to the virtual function table at a common position (thus a pointer is required in each object). This table identifies the actual code for each polymorphic function. A separate table is required for each class that shares polymorphism. However, this approach uses a relatively large space because each pointer is 32 bits (ie 4 characters) and each object requires a pointer to a virtual function table. In addition, a 32-bit long field is used in each object.

(特に)モバイルオペレーティングシステム環境においては、このオーバーヘッドは問題である。EPOC32では、ストリングクラスのオブジェクトに対して次のように対処する。すなわち、32ビット長のフィールドが細分割され、最初の4ビットがディスクリプタのタイプを記述する。そして関数はその4ビットを参照し、正しいテキスト位置を指し示す(例えば、ディスクリプタがバッファ等の場合は、ディスクリプタ自体の中)。従って、ストリングクラスのオブジェクトに対する3つの異なったクラスのディスクリプタ(すなわち、ポインタディスクリプタ、バッファディスクリプタおよびヒープディスクリプタ)の各々が、単一の32ビットフィールドの最初の4ビットだけを使用して記述できるようにすることによってポリモルフィズムが提供される。このようにしてかなりのメモリの節約が達成される。より一般的には、フィールドは別のデータ項目と機械語を共有する。   In (especially) mobile operating system environments, this overhead is a problem. In EPOC32, the string class object is handled as follows. That is, a 32-bit long field is subdivided, and the first 4 bits describe the descriptor type. The function then refers to the 4 bits and points to the correct text position (for example, in the descriptor itself if the descriptor is a buffer or the like). Thus, each of the three different classes of descriptors for string class objects (ie, pointer descriptor, buffer descriptor, and heap descriptor) can be described using only the first 4 bits of a single 32-bit field. This provides polymorphism. In this way, considerable memory savings are achieved. More generally, a field shares a machine language with another data item.

(ユニコードおよびアスキーで変化しないコード)
C++では、16ビットのユニコードのコーディングは、そうでなければ8ビットコードとなる全てのテキストデータのサイズを2倍にすることとなる。また、従来は、プログラマがソースコードを書くときに、アスキーまたはユニコードのどちらを使用して記述するかを決定する必要があった。
(Code that does not change in Unicode and ASCII)
In C ++, 16-bit Unicode coding would double the size of all text data that would otherwise be 8-bit code. Conventionally, when a programmer writes source code, it has been necessary to decide whether to use ASCII or Unicode.

EPOC32では、アスキーまたはユニコードの最終的な選択にかかわらず、同じソースコードが使用される。これは、クラスそれ自体(例えば、ポインタディスクリプタ、バッファディスクリプタおよびヒープディスクリプタ)でなく、アスキーおよびユニコードによって変化しない、クラスネームのエイリアスを使用してシステムをビルドすることによって達成される。従って、ユニコードのコードを指し示すポインタTPtr16を使用したり、アスキーのコードを指し示すTPtr8を使用してビルドを行う代わりに、プログラマはTPtrクラスネームを使用してビルドを行う。ビルド時に、クラスネームは、16ビットユニコードまたは8ビットアスキーコードのいずれかとしてコンパイルすることができる。この手法は、異なったビット長でコード化される全ての文字セットを含むように適用できる。   In EPOC32, the same source code is used regardless of the final choice of ASCII or Unicode. This is accomplished by building the system using class name aliases that are not changed by ASCII and Unicode, but not the class itself (eg, pointer descriptors, buffer descriptors and heap descriptors). Therefore, instead of using the pointer TPtr16 indicating the Unicode code or using TPtr8 indicating the ASCII code, the programmer performs the build using the TPtr class name. At build time, the class name can be compiled as either 16-bit Unicode or 8-bit ASCII code. This approach can be applied to include all character sets encoded with different bit lengths.

(EPOC32の補足的利点)
C++では、テキストストリングは通常「0」で終了し、これによりシステムはテキストストリングの終了位置を容易に知ることができる。EPOC32ではこれはもはや必要ない。なぜなら、ディスクリプタが参照されるデータの長さを定義する記述を含んでいるからである。従って、全てのテキスト項目毎に終端を示すのに「0」を使用する必要がなくなるので、コードをさらに節約することができる。
(Supplementary benefits of EPOC32)
In C ++, the text string normally ends with “0”, which allows the system to easily know the end position of the text string. In EPOC32 this is no longer necessary. This is because the descriptor includes a description that defines the length of data to be referred to. Therefore, it is not necessary to use “0” to indicate the end of every text item, so that the code can be further saved.

(ディスクリプタの特徴の要約)
ディスクリプタには3つのクラスがある。すなわち、ポインタディスクリプタ、バッファディスクリプタおよびヒープディスクリプタである。
(Summary of descriptor characteristics)
There are three classes of descriptors. That is, a pointer descriptor, a buffer descriptor, and a heap descriptor.

●「ポインタディスクリプタ」には2つの形態がある。不変(const:定数)ポインタディスクリプタTPtrCと、可変ポインタディスクリプタTPtrである。
・不変ポインタディスクリプタ:TPtrC
・これにおいてはデータは変更できない。
・全てのメンバ関数が不変である。
・不変のストリングまたはデータ(例えば変更が禁止されているデータ)の参照に用いられる。
・TDesCから導出されるため、多数のメンバ関数を有する。
・可変ポインタディスクリプタ:TPtr
・設計者によって設定された最大長を越えない範囲で、このディスクリプタによってデータを変更できる(可変)。
・変更対象の領域を含むメモリ領域を直接指し示す。
・ポインタ長により含まれるデータ項目数が決定される。
・全てのTDesCメンバ関数に加え、データの操作および変更を行うTDesメンバ関数を継承する。
・ポインタディスクリプタはデータ表現とは別であるが、メモリ内の予め存在する領域から構成される。
● There are two types of “pointer descriptors”. An invariant (const) constant descriptor TPtrC and a variable pointer descriptor TPtr.
Invariant pointer descriptor: TPtrC
・ The data cannot be changed.
• All member functions are invariant.
Used for references to immutable strings or data (eg, data that cannot be changed).
Since it is derived from TDesC, it has a large number of member functions.
Variable pointer descriptor: TPtr
Data can be changed by this descriptor (variable) as long as the maximum length set by the designer is not exceeded.
-Directly point to the memory area that contains the area to be changed.
-The number of data items included is determined by the pointer length.
Inherit all TDesC member functions, plus TDes member functions that manipulate and modify data.
A pointer descriptor is separate from the data representation, but consists of a pre-existing area in the memory.

●「バッファディスクリプタ」には2つの形態がある。
・不変バッファディスクリプタ:TbufC<Tint S>
・作成時、または、代入演算子(演算子=)を用いて後で、ディスクリプタにデータを設定できる。
・整数テンプレートにより長さが定義される。すなわち、TBufC<40>は40個のデータ項目を含んでいる。
・全てのTDesCメンバ関数を継承する。
・可変バッファデイスクリプタ:Tbuf<Tint S>
・最大長を越えない範囲で変更できる(可変)データを含んでいる。
・最大長が、最大データ項目数を定義する。
・実際の長さが実際のデータ項目数を定義する。
・整数テンプレートにより長さが定義される。すなわち、TBuf<40>は40個のデータ項目だけを含んでいる。
・データ領域はディスクリプタオブジェクトの一部である。
・操作および変更の必要なデータを含めるのに有効であるが、その長さは既知の最大値(例えばWPテキスト)を越えない。
・全てのTDesCメンバ関数に加え、データの変更および操作のためのTDesメンバ関数を継承する。
● There are two forms of “buffer descriptors”.
Invariant buffer descriptor: TbufC <Tint S>
Data can be set in the descriptor at the time of creation or later using an assignment operator (operator =).
• The length is defined by an integer template. That is, TBufC <40> includes 40 data items.
Inherit all TDesC member functions.
Variable buffer descriptor: Tbuf <Tint S>
-It contains (variable) data that can be changed within the maximum length.
• Maximum length defines the maximum number of data items.
• The actual length defines the actual number of data items.
• The length is defined by an integer template. That is, TBuf <40> includes only 40 data items.
The data area is a part of the descriptor object.
It is useful for including data that needs to be manipulated and changed, but its length does not exceed a known maximum (eg WP text).
Inherit all TDesC member functions plus TDes member functions for data modification and manipulation.

●ヒープディスクリプタは1つの形態だけである
・不変ヒープディスクリプタ:HBufC
・長さの情報の後にデータを含む
・データ領域はディスクリプタオブジェクトの一部であり、オブジェクト全体はヒープから割り当てられたセルを占める
・作成時、または、代入演算子(演算子=)を用いて後で、ディスクリプタにデータを設定できる
・全てのTDesCメンバ関数を継承する
・再割り当て可能、すなわち、データ領域は拡張または縮小できる。
-Heap descriptor is only one form-Invariant heap descriptor: HBufC
-Data is included after the length information-The data area is part of the descriptor object, and the entire object occupies cells allocated from the heap-At the time of creation or using the assignment operator (operator =) Later, data can be set in the descriptor. • Inherits all TDesC member functions. • Reassignable, ie the data area can be expanded or reduced.

======================================
<<付録1>>
Psion Software Plc.から1997年に発行されることになっているEPOC32「ディスクリプタ」SDK(抜粋)。Psion Software Plc.から1997年7月(改訂1.0)に発行されたSDK全文を参照する。
=====================================
<< Appendix 1 >>
Psion Software Plc. EPOC32 “Descriptor” SDK (excerpt) to be issued in 1997. Psion Software Plc. Refers to the entire SDK published in July 1997 (Revision 1.0).

______________________________________
(SDK:ディスクリプタ概要)
ディスクリプタクラスの3重構造(すなわち、ポインタディスクリプタクラス、バッファディスクリプタクラスおよびヒープディスクリプタクラス)は、ストリングおよび一般的バイナリデータの両方に対して、それらが存在するメモリのタイプに関係なく、アクセスおよび操作を行うための安全かつ一貫した機構を提供する。例えば、ROM内のコード部分のストリングを、RAM内のファイルレコードと同様に扱うことができる。
__________________________________
(SDK: descriptor outline)
The triple structure of descriptor classes (ie, pointer descriptor class, buffer descriptor class, and heap descriptor class) allows access and manipulation of both strings and general binary data, regardless of the type of memory in which they reside. Provide a safe and consistent mechanism to do. For example, a string of code parts in ROM can be handled in the same way as a file record in RAM.

ディスクリプタによって表わされるデータは、メモリ内の定められた位置のデータ領域に存在する。このデータ領域は拡張可能ではない。定められたデータ領域外のメモリに対する偶発的あるいは故意のアクセスが許されないという意味で、ディスクリプタデータの操作は安全である(一般的に、無効なアクセスを行うコードは、(通常パニックとして知られる)例外の原因となる)。   The data represented by the descriptor exists in a data area at a predetermined position in the memory. This data area is not expandable. Manipulation of descriptor data is safe in the sense that accidental or deliberate access to memory outside the defined data area is not allowed (generally code that performs invalid access (usually known as panic) Cause an exception).

ディスクリプタは、表わされたデータのタイプで区別をしないので、ストリングおよびバイナリデータは両方とも同様に扱われる。ディスクリプタオブジェクトのメンバ関数のあるものはテキストデータを操作するように設計されているが、それらはバイナリデータにも作用する。これによりストリングおよびバイナリデータの扱いが統一し、コードを共有できるようにすることで効率が高まる。ディスクリプタクラスは多くの重要な要件を満足する。:
・ユニコードおよびアスキーテキスト両方のサポートを提供する。_UNICODEマクロは、アスキーまたはユニコードのビルド変数を選択するのに使用される。
・ストリングおよびバイナリデータの扱いを統一する。
・ROM内のテキストまたはデータの安全かつ便利な参照を可能にする。
・関連するテキストまたはデータを操作する豊富なメンバ関数を提供する。
・データの変更を可能とするが、定められたデータ領域外へ書き込もうとするあらゆる試みを禁止する。
・仮想関数に関連するメモリオーバヘッドをなくす。
・組み込みタイプのように作用し、スタック上に安全に作成可能であり、安全に孤立化(orphaned)することができる。
・(HBufCがヒープ上に割り当てられ、規則の例外となる。)
Since descriptors do not differentiate between the type of data represented, both string and binary data are treated similarly. Some of the descriptor object member functions are designed to manipulate text data, but they also work on binary data. This unifies the handling of strings and binary data and increases efficiency by allowing code to be shared. Descriptor classes satisfy many important requirements. :
Provide support for both Unicode and ASCII text. The _UNICODE macro is used to select ASCII or Unicode build variables.
・ Unify handling of strings and binary data.
Enables safe and convenient reference of text or data in ROM.
Provide rich member functions that operate on related text or data.
• Allows data modification, but prohibits any attempt to write outside the defined data area.
Eliminate memory overhead associated with virtual functions.
It acts like a built-in type, can be created safely on the stack, and can be safely orphaned.
(HBufC is allocated on the heap and is an exception to the rule.)

______________________________________
(アスキーおよびユニコードテキスト)
E32.descriptors.char-set

アスキーテキスト文字は8ビット(1バイト)で表わされるが、ユニコード文字は16ビット(2バイト)を必要とする。アスキーおよびユニコードテキストの両方をサポートするために、ディスクリプタクラスは、8ビットと16ビットの2つの変形を有する。例えば、TPtr8およびTPtr16の2つのポインタディスクリプタクラスがある。
__________________________________
(ASCII and Unicode text)
E32.descriptors.char-set

ASCII text characters are represented by 8 bits (1 byte), while Unicode characters require 16 bits (2 bytes). To support both ASCII and Unicode text, the descriptor class has two variants, 8-bit and 16-bit. For example, there are two pointer descriptor classes, TPtr8 and TPtr16.

プログラムは、ビルド変数から独立したクラスネームを使用してユニコードまたはアスキーテキストのいずれかをサポートするように構成することができる。例えば、ディスクリプタクラスTPtrを使用して、TPtr8またはTPtr16のいずれかを使用するようにシステムを構成できる。_UNICODEマクロが定義されたか否かによって、ビルド時(build time)に決定される。   The program can be configured to support either Unicode or ASCII text using class names that are independent of build variables. For example, the descriptor class TPtr can be used to configure the system to use either TPtr8 or TPtr16. It is determined at build time depending on whether or not the _UNICODE macro is defined.

ヘッダファイルE3232def.h(SDKの付録1参照)から抽出した次のコードは、変数から独立したクラスネームを適切に定義することによってこれを実現する方法を示している。   The following code extracted from the header file E3232def.h (see Appendix 1 of the SDK) shows how to achieve this by properly defining a class name independent of the variables.

#if defined(_UNICODE)
・・・
typedef TPtr16 TPtr;
・・・
#else
・・・
typedef TPtr8 TPtr;
・・・
#endif
#If defined (_UNICODE)
...
typedef TPtr16 TPtr;
...
#Else
...
typedef TPtr8 TPtr;
...
#Endif

アプリケーションコードには、「C」スタイルのストリングリテラルを直接使用しないようにすべきである。その代わり、適切な幅の「C」スタイルのストリングを生成するのに、適切なタイプのポインタに戻す、_Sマクロを使用すべきである。また、適切なタイプのディスクリプタを作成するには、_Lマクロ(「リテラル」に対する_L)を使用すべきである。これらのマクロの定義については、e32.macro._Sおよびe32.macro._Lを参照せよ。   Application code should not use "C" style string literals directly. Instead, the _S macro should be used to return the appropriate type of pointer to generate the appropriate width “C” style string. Also, the _L macro (_L for "literal") should be used to create the appropriate type of descriptor. See e32.macro._S and e32.macro._L for definitions of these macros.

例えば、
const TText* str=_S(“Hello”);
は、アスキーで作成された1バイト文字のストリングを生成するが、ユニコード作成では2バイト文字のストリングを生成する。
For example,
const TText * str = _S (“Hello”);
Generates a string of 1-byte characters created in ASCII, but generates a string of 2-byte characters in Unicode creation.

_L(“Hello”);
は、アスキーで作成された8ビットディスクリプタおよびユニコードで作成された16ビットディスクリプタを生成する。常に正しい変数のディスクリプタを作成するように、例えば、平文“abcdef”ではなく、常に_L(“abcdef”)を使用する。
_L (“Hello”);
Generates an 8-bit descriptor created in ASCII and a 16-bit descriptor created in Unicode. For example, _L (“abcdef”) is always used instead of plaintext “abcdef” so as to always create a correct variable descriptor.

macro_S8およびmacro_L8をそれぞれ使用することによって、作成された変数とは独立して、8ビット「C」スタイルストリングおよび8ビットポインタディスクリプタが明白に生成される。対応する16ビットのバージョン、_S16および_L16も使用できる。これらの定義については、e32.macro._S8, e32.macro._L8, e32.macro._S16 および e32.amcro._L16を参照せよ。   By using macro_S8 and macro_L8, respectively, an 8-bit “C” style string and an 8-bit pointer descriptor are explicitly generated independent of the created variables. Corresponding 16-bit versions, _S16 and _L16 can also be used. For these definitions, see e32.macro._S8, e32.macro._L8, e32.macro._S16 and e32.amcro._L16.

______________________________________
(長さおよびサイズ)
E3232.descriptors.length-and-size

ディスクリプタは、表わすデータをそのデータの長さで特徴付ける。ディスクリプタの長さは、データ項目の数である。8ビットの変数に対しては、ディスクリプタの長さはそれが表わす1バイトデータの数であり、16ビットの変数に対しては、ディスクリプタの長さはそれが表わす2バイトデータの数である。
__________________________________
(Length and size)
E3232.descriptors.length-and-size

A descriptor characterizes the data it represents by the length of that data. The length of the descriptor is the number of data items. For an 8-bit variable, the descriptor length is the number of 1-byte data it represents, and for a 16-bit variable, the descriptor length is the number of 2-byte data it represents.

ディスクリプタのサイズは、ディスクリプタのデータが占めるバイト数である。これは、必ずしもディスクリプタの長さと同じである必要はない。8ビットの変数に対しては、サイズは長さと同じであるが、16ビットの変数に対しては、サイズは長さの2倍である。データの変更を許可するディスクリプタもまた、その最大長によって特徴付けられる。これらのディスクリプタに対しては、表わされるデータの長さは、ゼロからこの最大値まで最大値を含めて変化し得る。あらゆるディスクリプタの最大長は228である。 The descriptor size is the number of bytes occupied by the descriptor data. This need not be the same as the descriptor length. For an 8-bit variable, the size is the same as the length, but for a 16-bit variable, the size is twice the length. A descriptor that allows modification of data is also characterized by its maximum length. For these descriptors, the length of the data represented can vary from zero to this maximum value, including the maximum value. The maximum length of any descriptor is 2 28.

______________________________________
(テキストおよびバイナリデータ)
E3232.descriptors.text-and-binary

「C」では、ストリングは、ストリングの終端を示すゼロターミネータを必要とすることによって特徴付けられる。これらは多数の問題を招く。特に、これらは(データがバイナリゼロを含む場合に)バイナリデータを中に含むことができず、それらに対する操作は一般的に効率的でない。「C」ストリングは、ANSIの「C」ライブラリの関数グループ、memxxx()およびstrxxx()に反映されているように、バイナリデータとは異なった方法で扱う必要がある。ディスクリプタはストリングとバイナリデータを同じ方法で表わすことを可能とし、これは両方の場合に同じ関数を使用することを可能とする。バイナリデータに対しては、明示的に8ビットのディスクリプタを使用しなければならない。バイナリデータにとっては、ユニコードをアスキーの区別は意味がない。16ビットバイナリデータは事実上使用しないことに注意せよ。
__________________________________
(Text and binary data)
E3232.descriptors.text-and-binary

In “C”, the string is characterized by requiring a zero terminator to indicate the end of the string. These cause a number of problems. In particular, they cannot contain binary data (if the data contains binary zeros) and operations on them are generally not efficient. “C” strings need to be handled differently from binary data, as reflected in the ANSI “C” library function groups, memxxx () and strxxx (). Descriptors allow string and binary data to be represented in the same way, which allows the same function to be used in both cases. For binary data, an 8-bit descriptor must be explicitly used. For binary data, the distinction between Unicode and ASCII is meaningless. Note that 16-bit binary data is virtually unused.

______________________________________
(メモリ割り当て)
E3232.descriptors.alloc

ディスクリプタクラスは(HBufCを除いて)、組み込みタイプのように作用する。これらはメモリの割り当てを行わず、デストラクタを持たない。これは、ディスクリプタクラスが組み込みタイプと同様にスタック上で「孤立化」され得ることを意味する。これは特に、コードを残せる状況では重要である。(孤立化の影響については、E3232.exception.trap.cleanup.requirementsを参照せよ)
HBufCディスクリプタオブジェクトはヒープ上に割り当てられ、スタック上には作成されない。
______________________________________________________
(Memory allocation)
E3232.descriptors.alloc

Descriptor classes (except HBufC) behave like built-in types. They do not allocate memory and have no destructors. This means that descriptor classes can be "isolated" on the stack as well as built-in types. This is especially important in situations where you can leave code. (See E3232.exception.trap.cleanup.requirements for the impact of isolation)
The HBufC descriptor object is allocated on the heap and is not created on the stack.

______________________________________
(例外)
E3232.descriptors.exceptions

ディスクリプタメンバ関数の全てのパラメータは、操作が正しく指定され、どのデータもディスクリプタのデータ領域外に書き込まれないことを保証するべく検査される。この結果、どのメンバ関数も、可変ディスクリプタをその最大割り当て長を越えて拡張できないこととなる。元の割り当てを十分大きくするか、より大きいディスクリプタの必要性を見越して実行時により大きなディスクリプタを動的に割り当てるかによって、全てのディスクリプタがデータを収容できるように十分大きいことを保証するのは、プログラマの責任である。スタティックな手法は実施がより簡単であるが、特定の場合にこれが無駄であると判明した特定の場合には、動的手法がより効果的であろう。例外の場合には、認められていないどのようなメモリのアクセスも実行しないことと、およびどんなデータも移動または損傷されないことを、安全に想定することができる。
__________________________________
(exception)
E3232.descriptors.exceptions

All parameters of the descriptor member function are examined to ensure that the operation is correctly specified and no data is written outside the descriptor's data area. As a result, no member function can extend the variable descriptor beyond its maximum allocation length. Depending on whether the original allocation is large enough or a larger descriptor is dynamically allocated at run time in anticipation of the need for larger descriptors, ensuring that all descriptors are large enough to accommodate the data is It is the responsibility of the programmer. The static approach is simpler to implement, but the dynamic approach may be more effective in certain cases where it turns out to be useless in certain cases. In the case of an exception, it can safely be assumed that no unauthorized memory access is performed and that no data is moved or damaged.

______________________________________
(ディスクリプタタイプ)
E3232.descriptors.types

ディスクリプタオブジェクトには3種類ある。すなわち、
・ポインタディスクリプタ
ディスクリプタオブジェクトは、それが表わすデータとは別であるが、メモリ内の予め存在する領域に生成される。これには、
不変ポインタディスクリプタ、TPtrC
可変ポインタディスクリプタ、TPtr
の2つの形態がある。
__________________________________
(Descriptor type)
E3232.descriptors.types

There are three types of descriptor objects. That is,
Pointer descriptor A descriptor object is created in a pre-existing area in memory, although it is separate from the data it represents. This includes
Immutable pointer descriptor, TPtrC
Variable pointer descriptor, TPtr
There are two forms.

・バッファディスクリプタ
データ領域はディスクリプタオブジェクトの一部である。これには、
不変バッファディスクリプタ、TBufC<Tlnt S>
可変バッファディスクリプタ、TBuf<Tlnt S>
の2つの形態がある。
Buffer descriptor The data area is a part of the descriptor object. This includes
Immutable buffer descriptor, TBufC <Tlnt S>
Variable buffer descriptor, TBuf <Tlnt S>
There are two forms.

・ヒープディスクリプタ
データ領域はディスクリプタオブジェクトの一部であり、オブジェクト全体がヒープから割り当てられたセルを占有する。これは、
不変ヒープディスクリプタ、HBufC
の1つの形態だけである。
-Heap descriptor The data area is a part of the descriptor object, and the entire object occupies cells allocated from the heap. this is,
Immutable heap descriptor, HBufC
There is only one form.

______________________________________
(ポインタディスクリプタ−TPtrC)
E3232.descriptors.buffer-descriptor.TPtrC

TPtrCは、それによってどのデータも変更されない、不変ディスクリプタである。そのメンバ関数の全ては(コンストラクタを除いて)不変(constant)である。図1にTPtrCが概略的に示されている。TPtrCは不変ストリングまたはデータを参照するのに有用である。例えば、ROM常駐コード中に生成されたテキストをアクセスするとき、または、その参照によってデータが変更されてはならないRAM内のデータに参照を渡すときに有用である。TPtrCは、例えば、テキストまたはデータの抽出部分内の文字の位置決めなどの、その内容を操作する多くのメンバ関数を提供するTDesCから導出される。
_____________________________________________
(Pointer descriptor-TPtrC)
E3232.descriptors.buffer-descriptor.TPtrC

TPtrC is an immutable descriptor that does not change any data. All of its member functions are constant (except for constructors). FIG. 1 schematically shows TPtrC. TPtrC is useful for referencing immutable strings or data. For example, it is useful when accessing text generated in ROM resident code or when passing a reference to data in RAM whose data should not be altered by that reference. TPtrC is derived from TDesC, which provides a number of member functions that manipulate its contents, such as, for example, the positioning of characters in the extracted portion of text or data.

______________________________________
(ポインタディスクリプタ−TPtr)
E3232.descriptors.buffer-descriptor.TPtr

TPtrは、データが最大長を越えない範囲で、それによってデータを変更できるポインタディスクリプタである。最大長はコンストラクタによって設定される。TPtrは、変更対象のデータを含むメモリ内の領域を直接指し示す。TPtrは、図2Aおよび2Bに概略的に示されている。
________________________________
(Pointer descriptor-TPtr)
E3232.descriptors.buffer-descriptor.TPtr

TPtr is a pointer descriptor that can change data within a range in which the data does not exceed the maximum length. The maximum length is set by the constructor. TPtr directly points to an area in the memory containing the data to be changed. TPtr is shown schematically in FIGS. 2A and 2B.

領域が含むことができるデータ項目の最大数は、最大長で定義される。TPtrの長さは、データ内に現在いくつのデータ項目が含まれているかを表わす。この値が最大値より小さいとき、データ領域の一部は未使用である。TPtrは、参照により変更が意図されたデータを含むRAMの領域への参照や、または、まだデータがないが、ディスクリプタの参照およびメンバ関数を使用してデータが生成されるRAMの領域への参照を生成するのに有効である。   The maximum number of data items that an area can contain is defined by the maximum length. The length of TPtr indicates how many data items are currently included in the data. When this value is smaller than the maximum value, a part of the data area is unused. TPtr is a reference to an area of RAM that contains data that is intended to be changed by reference, or a reference to an area of RAM that has no data yet but is generated using descriptor references and member functions. It is effective to generate

TPtrはまた、変更されているデータを含む、TBufCまたはHBufCディスクリプタへの参照を生成するのに有効である。このように使用されるTPtrは、TBufCまたはHBufCディスクリプタを指し示す。TBufCまたはHBufCディスクリプタに含まれるデータはTPtrによって変更することができる。TPtrは、TDesCから導出されたTDesから導出される。従って、TPtrは、TDesCで定義された全てのconstメンバ関数に加え、例えば、既存のテキストの末端に文字を付加する等の、データの操作および変更が可能なTDesのメンバ関数を継承している。   TPtr is also useful for generating a reference to a TBufC or HBufC descriptor that contains the data being changed. TPtr used in this way points to a TBufC or HBufC descriptor. Data included in the TBufC or HBufC descriptor can be changed by TPtr. TPtr is derived from TDes derived from TDesC. Therefore, TPtr inherits all the const member functions defined in TDesC, as well as the TDes member functions that can manipulate and change data, such as adding characters to the end of existing text. .

______________________________________
(バッファディスクリプタ−TBufC<TInt S>)
E3232.descriptors.buffer-descriptor.TBufC

TBufCは、長さの情報とそれに後続するデータ領域を有するバッファディスクリプタである。データは、生成時に、または、割り当てられた演算子(演算子=)を用いて他の任意時に、ディスクリプタ内に設定することができる。ディスクリプタによって保持されたデータは不変である。TBufCは、図3に概略的に示されている。TBufCの長さは、例えば、TBufC<40>が40個までのデータ項目を含むことができるTBufCを定義するように、整数テンプレートによって定義される。
_____________________________________________
(Buffer descriptor-TBufC <Tint S>)
E3232.descriptors.buffer-descriptor.TBufC

TBufC is a buffer descriptor having length information followed by a data area. Data can be set in the descriptor at generation time or at any other time using the assigned operator (operator =). The data held by the descriptor is unchanged. TBufC is shown schematically in FIG. The length of TBufC is defined by an integer template, for example, so that TBufC <40> defines TBufC that can contain up to 40 data items.

TBufCは、例えば、テキスト内の文字を位置決めしたり、あるいはデータの一部を抽出したりするような、その内容物を操作する多くのメンバ関数を提供するTDesCから導出される。TBufCは、TBufCを参照する可変ポインタディスクリプタ(TPtr)を作成する、メンバ関数Des()を提供する。これにより、図4に概略的に表わしたように、TPtrによってTBufCのデータを変更することができる。TPtrの最大長は、整数テンプレートパラメータの値である。   TBufC is derived from TDesC, which provides many member functions that manipulate its contents, such as positioning characters in text or extracting a portion of data. TBufC provides a member function Des () that creates a variable pointer descriptor (TPtr) that refers to TBufC. As a result, TBufC data can be changed by TPtr as schematically shown in FIG. The maximum length of TPtr is the value of the integer template parameter.

______________________________________
(バッファディスクリプタ−TBuf<TInt S>)
E3232.descriptors.buffer-descriptor.TBuf

TBufは、データが最大長を越えない範囲で、変更できるデータを含むバッファディスクリプタである。図5にTBufが概略的に示されている。TBufが内部のデータ領域に含むことができるデータ項目の数は、最大長によって定義される。ディスクリプタの長さは、データ領域に現在いくつのデータ項目が含まれているかを表わしている。この値が最大値より小さいとき、データ領域のある部分は未使用である。TBufの最大長は整数テンプレートによって定義される。例えば、TBuf<40>は、40個までの(かつ越えない!)データ項目を含むことができるTBufを定義する。TBufは、例えばワードプロセッサのテキストのように、操作および変更が必要であるが、その長さが既知の最大値を越えないデータを保持するのに有効である。TBufは、TDesCから導出されたTDesから導出される。従って、TPtrは、TDesCで定義された全てのconstメンバ関数に加え、例えば、既存のテキストの末端に文字を付加する等の、データの操作および変更が可能なTDesのメンバ関数を継承している。
__________________________________
(Buffer descriptor-TBuf <Tint S>)
E3232.descriptors.buffer-descriptor.TBuf

TBuf is a buffer descriptor including data that can be changed within a range where the data does not exceed the maximum length. FIG. 5 schematically shows TBuf. The number of data items that TBuf can contain in the internal data area is defined by the maximum length. The length of the descriptor indicates how many data items are currently included in the data area. When this value is smaller than the maximum value, a part of the data area is unused. The maximum length of TBuf is defined by an integer template. For example, TBuf <40> defines a TBuf that can contain up to 40 (and not exceed!) Data items. TBuf is useful for holding data that requires manipulation and modification, such as word processor text, but whose length does not exceed a known maximum. TBuf is derived from TDes derived from TDesC. Therefore, TPtr inherits all the const member functions defined in TDesC, as well as the TDes member functions that can manipulate and change data, such as adding characters to the end of existing text. .

______________________________________
(ヒープディスクリプタ−HBufC)
E3232.descriptors.buffer-descriptor.HBufC

HBufCは、長さの情報とそれに後続するデータを有するディスクリプタである。これは、スタティックメンバ関数の、New()、NewL()またはNewLC()を使用してヒープ上に割り当てられる。ディスクリプタの長さはこれらスタティック関数へのパラメータとして渡される。図6にHBufCが概略的に示されている。データは、生成時に、または、割り当てられた演算子(演算子=)を用いて他の任意時に、ディスクリプタ内に設定することができる。ディスクリプタがすでに有しているデータは不変(constant)である。HBufCは、例えばテキスト内の文字の位置決めや、または、データの一部の抽出を行う、その内容物を操作する多くのメンバ関数を提供するTDesCから導出される。
__________________________________
(Heap descriptor-HBufC)
E3232.descriptors.buffer-descriptor.HBufC

HBufC is a descriptor having length information and subsequent data. It is allocated on the heap using the static member functions New (), NewL () or NewLC (). The descriptor length is passed as a parameter to these static functions. FIG. 6 schematically shows HBufC. Data can be set in the descriptor at generation time or at any other time using the assigned operator (operator =). The data that the descriptor already has is constant. HBufC is derived from TDesC, which provides a number of member functions that manipulate its contents, for example, positioning characters in text or extracting a portion of data.

HBufCは、HBufCを参照する可変ポインタディスクリプタ(TPtr)を作成する、メンバ関数Des()を提供する。これにより、TPtrを用いてHBufCデータを変更することが可能になる。TPtrの最大長は、HBufCデータ領域の長さである。図7はこれを概略的に示している。   HBufC provides a member function Des () that creates a variable pointer descriptor (TPtr) that refers to HBufC. This makes it possible to change the HBufC data using TPtr. The maximum length of TPtr is the length of the HBufC data area. FIG. 7 schematically illustrates this.

ヒープディスクリプタは再配置することができる。関数ReAlloc()またはReAllocL()は、ヒープディスクリプタのデータ領域の拡張あるいは縮小を可能にする。しかしながら、データ領域の長さは、現在保持しているデータの長さより短くすることはできない。データ領域を縮小する前に、ディスクリプタが保持するデータを小さくしなければならない。割り当て演算子がヒープディスクリプタ中に設定できるデータの長さは、ディスクリプタのデータ領域に割り当てられたスペースに制限される。ヒープディスクリプタによって占有されたメモリは、User::Free()をコールするか、または、キーワードdeleteを使用して明示的に開放する必要がある。   Heap descriptors can be relocated. The function ReAlloc () or ReAllocL () enables expansion or contraction of the data area of the heap descriptor. However, the length of the data area cannot be shorter than the length of data currently held. Before reducing the data area, the data held by the descriptor must be reduced. The length of data that can be set in the heap descriptor by the allocation operator is limited to the space allocated to the data area of the descriptor. The memory occupied by the heap descriptor needs to be explicitly freed by calling User :: Free () or using the keyword delete.

______________________________________
(ディスクリプタクラスの関係)
E32.descriptors.classes

全てのディスクリプタクラス、TPtrC,TPtr,TBufC,TBufおよびHBufCは、抽象的基底クラス(abstract base class)TDesCおよびTDesから導出される。クラスTBufCBaseを抽象的基底クラスとして示したが、これは単に実装が容易なためである。図8はクラス間の関係を概略的に示している。
__________________________________
(Relationship between descriptor classes)
E32.descriptors.classes

All descriptor classes, TPtrC, TPtr, TBufC, TBuf, and HBufC are derived from the abstract base classes TDesC and TDes. The class TBufCBase has been shown as an abstract base class, simply because it is easy to implement. FIG. 8 schematically shows the relationship between classes.

実際のディスクリプタクラスの作用は非常に似ており、従って、ディスクリプタのほとんどの関数は抽象的基底クラスによって提供される。ディスクリプタは(特にスタックで)広く使用されるので、ディスクリプタオブジェクトのサイズを最小にする必要がある。これを補助するように、各ディスクリプタオブジェクトにおける仮想関数テーブルポインタのオーバーへッドをなくすため、仮想関数の定義をしない。その結果、基底クラスはそこから導出されるクラスの知識を潜在的に持っている。E32は、8ビット(アスキー)テキストおよびバイナリデータを扱うものと、16ビット(ユニコード)テキストを扱うものとの2つのディスクリプタクラスの変数を供給する。実際のクラスの8ビット変数は、TPtrC8,TPtr8,TBufC8<TInt S>,TBuf8<TInt S>およびHBufC8であり、抽象クラスの8ビット変数は、TDesC8およびTDes8である。同様に、16ビット変数の名前はそれぞれ、TPtrC16,TPtr16,TBufC16<Tlnt S>,TBuf16<TInt S>,HBufC16,TDesC16およびTDes16である。この区別はテキストを表わすのに使用されるディスクリプタにはトランスペアレント(透過的)である。TPtrC,TPtr,TBufC<TInt S>,TBuf<TInt S>およびHBufCクラスを生成し使用するプログラムを書くことにより、ユニコードおよびアスキーの両方に対する互換性が維持される。_UNICODEマクロが定義されたか否かに応じて、ビルド時に適切な変数が選択される。_UNICODEマクロが定義されている場合は16ビット変数が変数が使用され、そうでなければE32.descriptors.char-setで説明したように8ビットの変数が使用される。   The behavior of the actual descriptor class is very similar, so most functions of the descriptor are provided by the abstract base class. Since descriptors are widely used (especially in the stack), it is necessary to minimize the size of descriptor objects. To assist this, no virtual function is defined in order to eliminate the overhead of the virtual function table pointer in each descriptor object. As a result, the base class potentially has knowledge of the classes derived from it. E32 supplies two descriptor class variables, one that handles 8-bit (ASCII) text and binary data, and one that handles 16-bit (Unicode) text. The actual 8-bit variables are TPtrC8, TPtr8, TBufC8 <Tint S>, TBuf8 <TInt S>, and HBufC8, and the 8-bit variables of the abstract class are TDesC8 and TDes8. Similarly, the names of the 16-bit variables are TPtrC16, TPtr16, TBufC16 <Tlnt S>, TBuf16 <TInt S>, HBufC16, TDesC16, and TDes16, respectively. This distinction is transparent to the descriptor used to represent the text. By writing programs that generate and use TPtrC, TPtr, TBufC <Tint S>, TBuf <Tint S> and HBufC classes, compatibility for both Unicode and ASCII is maintained. Depending on whether the _UNICODE macro is defined, the appropriate variable is selected at build time. If the _UNICODE macro is defined, a 16-bit variable is used, otherwise an 8-bit variable is used as described in E32.descriptors.char-set.

バイナリデータのディスクリプタは、明示的に8ビット変数を使用する必要がある。換言すると、コードは明示的にTPtrC8,TPtr8,TBufC8<TInt S>,TBuf8<TInt S>およびHBufC8のクラスを生成しなければならない。バイナリデータに対して16ビット変数を明示的に使用することもできるが、推奨されない。一般に、8ビットおよび16ビットの変数は、構造および実装において同一であり、クラス自体の記述は全体に渡りビルドとは独立した名前を使用する。   Binary data descriptors must explicitly use 8-bit variables. In other words, the code must explicitly generate classes TPtrC8, TPtr8, TBufC8 <Tint S>, TBuf8 <TInt S>, and HBufC8. Although it is possible to explicitly use 16-bit variables for binary data, it is not recommended. In general, 8-bit and 16-bit variables are identical in structure and implementation, and the description of the class itself uses names that are independent of the build throughout.

なお、多くのメンバ関数が、ディスクリプタが8ビットか16ビットの変数であるかに応じて、TUint8*タイプまたはTUint16*タイプの引数を取ることに特に注意せよ。説明を単純にするため、これらの引数を関数プロトタイプTUint??*として記載する。   Note that many member functions take TUint8 * or TUint16 * type arguments, depending on whether the descriptor is an 8-bit or 16-bit variable. To simplify the explanation, these arguments are replaced with the function prototype TUint? ? Describe as *.

TPtrCの概略を示す図である。It is a figure which shows the outline of TPtrC. TPtrの概略を示す図である。It is a figure which shows the outline of TPtr. TBufCの概略を示す図である。It is a figure which shows the outline of TBufC. TPtrとTBufCの関係を示す図である。It is a figure which shows the relationship between TPtr and TBufC. TBufCの概略を示す図である。It is a figure which shows the outline of TBufC. HBufCの概略を示す図である。It is a figure which shows the outline of HBufC. TPtrとHBufCの関係を示す図である。It is a figure which shows the relationship between TPtr and HBufC. クラス間の継承・派生の関係を示す図である。It is a figure which shows the relationship of inheritance and derivation between classes.

Claims (19)

テキストストリングに関するオブジェクトを扱うように構成されたオブジェクト指向オペレーティングシステムでプログラムされたコンピュータ装置であって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった関数を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラスの1つに属するものとして扱うことを特徴とするコンピュータ装置。 A computer device programmed with an object-oriented operating system configured to handle objects related to text strings, the operating system performing all of the objects, each performing a different function, at least one of which is code And a computer apparatus characterized in that it is treated to belong to one of three classes that have been modified to reduce cycle overhead. テキストストリングに関するオブジェクトを扱うように構成されたオブジェクト指向オペレーティングシステムでプログラムされたコンピュータの周辺装置であって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった関数を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラスの1つに属するものとして扱うこと、さらにまた前記周辺装置が、オブジェクトを前記3つのクラスにはいるものとして扱うようにプログラムされていることを特徴とする周辺装置。 A computer peripheral programmed with an object-oriented operating system configured to handle objects related to text strings, wherein the operating system performs all of the objects, each performing a different function, at least one of them. Program to treat one as belonging to one of the three classes, one of which has been modified to reduce code and cycle overhead, and also so that the peripheral treats the object as belonging to the three classes Peripheral device characterized by being made. テキストストリングに関するオブジェクトを扱うように構成され、コンピュータで読み取り可能な媒体にコード化されたコンピュータのオペレーティングシステムであって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった関数を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラスの1つに属するものとして扱うことを特徴とするオペレーティングシステム。 A computer operating system configured to handle objects related to text strings and encoded in a computer readable medium, wherein the operating system performs all of the objects, each performing a different function, An operating system, characterized in that it is treated as belonging to one of three classes, at least one of which has been modified to reduce code and cycle overhead. テキストストリングに関するオブジェクトを扱うように構成されたコンピュータのオペレーティングシステムを使用してマイクロプロセッサを操作する方法であって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった関数を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラスの1つに属するものとして扱うことを特徴とする方法。 A method of operating a microprocessor using a computer operating system configured to handle objects related to text strings, wherein the operating system performs all of the objects, each performing a different function, at least A method characterized in that it is treated as belonging to one of three classes, one of which has been modified to reduce code and cycle overhead. テキストストリングに関するオブジェクトを扱うように構成されたコンピュータのオペレーティングシステムでコード化された、コンピュータで読み取り可能な媒体であって、前記オペレーティングシステムが、前記オブジェクトの全てを、各々が異なった関数を実行し、少なくともその1つがコードおよびサイクルオーバヘッドを減少するように変更されている、3つのクラスの1つに属するものとして扱うことを特徴とする媒体。 A computer readable medium encoded with a computer operating system configured to handle objects related to text strings, wherein the operating system performs all of the objects, each performing a different function. A medium characterized in that it is treated as belonging to one of three classes, at least one of which has been modified to reduce code and cycle overhead. 前記3つのクラスの1つのオブジェクトがポインタであることを特徴とする請求項1から5のいずれか1項に記載の装置または方法。 6. The apparatus or method according to claim 1, wherein one object of the three classes is a pointer. ポインタがリテラルテキストの元のメモリ位置を指し示すことを特徴とする請求項6に記載の装置または方法。 The apparatus or method of claim 6, wherein the pointer points to the original memory location of the literal text. 前記オブジェクトがフラット構造であることを特徴とする請求項6に記載の装置または方法。 The apparatus or method according to claim 6, wherein the object has a flat structure. 前記3つのクラスの1つのオブジェクトが、長さが制限されたテキストを扱うことを特徴とする請求項1から5のいずれか1項に記載の装置または方法。 6. An apparatus or method according to any one of the preceding claims, wherein one object of the three classes handles text of limited length. 長さが制限されたテキストを扱う前記オブジェクトが、入手可できる可能性のあるメモリ管理関数の限定されたサブセットによって供給されることを特徴とする請求項9に記載の装置または方法。 10. The apparatus or method of claim 9, wherein the object handling length limited text is provided by a limited subset of memory management functions that may be available. 長さが制限されたテキストを扱う前記オブジェクトが、スタティックメモリを使用することを特徴とする請求項10に記載の装置または方法。 11. The apparatus or method of claim 10, wherein the object that handles text of limited length uses static memory. 長さが制限されたテキストを扱う前記オブジェクトが、フラット構造であることを特徴とする請求項9に記載の装置または方法。 10. The apparatus or method of claim 9, wherein the object that handles text of limited length is a flat structure. 前記3つのクラスの1つのオブジェクトが、ヒープメモリを使用し、入手できるメモリ管理関数のフルセットを必要とすることを特徴とする請求項1から5のいずれか1項に記載の装置または方法。 6. An apparatus or method according to any one of the preceding claims, wherein one object of the three classes uses heap memory and requires a full set of available memory management functions. 前記3つのクラスのいずれかのオブジェクトがポリモルフィックであることを特徴とする請求項1から13のいずれか1項に記載の装置または方法。 14. An apparatus or method according to any one of the preceding claims, wherein the object of any of the three classes is polymorphic. ポリモルフィズムが、各オブジェクト内の所定のフィールドを検査し、前記フィールド内の値に応じて、異なった種類の作用をもたらす関数を含むオペレーティングシステムによって、1つのインスタンスで達成されることを特徴とする請求項14に記載の装置または方法。 Polymorphism is achieved in one instance by an operating system that includes a function that examines a given field in each object and provides different types of action depending on the value in the field. Item 15. The apparatus or method according to Item 14. 前記フィールドが機械語と別のデータ項目を共有することを特徴とする請求項15に記載の装置または方法。 The apparatus or method of claim 15, wherein the field shares another data item with the machine language. 8ビット文字セットおよび16ビット文字セットで変化しないクラスネームのエイリアスを使用して、8ビット文字セットおよび16ビット文字セットで変化しない形態で記述されていることを特徴とする請求項1から16のいずれか1項に記載の装置または方法。 17. An object according to claim 1, characterized in that it is written in a form that does not change in an 8-bit character set and a 16-bit character set using an alias of a class name that does not change in an 8-bit character set and a 16-bit character set An apparatus or method according to any one of the preceding claims. アスキーおよびユニコードで変化しないクラスネームのエイリアスを使用して、アスキーおよびユニコードで変化しない形態で記述されていることを特徴とする請求項17に記載の装置または方法。 18. Apparatus or method according to claim 17, characterized in that it is written in a form that does not change in ASCII and Unicode, using an alias for class names that does not change in ASCII and Unicode. 前記3つのクラスのいずれかのオブジェクトが、本質的に長さが指定され、従って「0」ターミネータを持たないことを特徴とする請求項1から18のいずれか1項に記載の装置または方法。 19. An apparatus or method according to any one of the preceding claims, wherein an object of any of the three classes is essentially specified in length and therefore has no "0" terminator.
JP2008185277A 1997-06-13 2008-07-16 Information processing apparatus and method, program, and recording medium Pending JP2009059350A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
GBGB9712436.6A GB9712436D0 (en) 1997-06-13 1997-06-13 Operating system for a computer based on C++ programming techniques

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2006153915A Division JP4611245B2 (en) 1997-06-13 2006-06-01 Computer device and method for manipulating or accessing a string class object

Publications (1)

Publication Number Publication Date
JP2009059350A true JP2009059350A (en) 2009-03-19

Family

ID=10814181

Family Applications (3)

Application Number Title Priority Date Filing Date
JP11501913A Withdrawn JP2000501873A (en) 1997-06-13 1998-06-12 Object-oriented operating system
JP2006153915A Expired - Fee Related JP4611245B2 (en) 1997-06-13 2006-06-01 Computer device and method for manipulating or accessing a string class object
JP2008185277A Pending JP2009059350A (en) 1997-06-13 2008-07-16 Information processing apparatus and method, program, and recording medium

Family Applications Before (2)

Application Number Title Priority Date Filing Date
JP11501913A Withdrawn JP2000501873A (en) 1997-06-13 1998-06-12 Object-oriented operating system
JP2006153915A Expired - Fee Related JP4611245B2 (en) 1997-06-13 2006-06-01 Computer device and method for manipulating or accessing a string class object

Country Status (3)

Country Link
JP (3) JP2000501873A (en)
GB (1) GB9712436D0 (en)
WO (1) WO1998057257A2 (en)

Also Published As

Publication number Publication date
JP4611245B2 (en) 2011-01-12
GB9712436D0 (en) 1997-08-13
WO1998057257A3 (en) 1999-03-04
JP2000501873A (en) 2000-02-15
WO1998057257A2 (en) 1998-12-17
JP2006302303A (en) 2006-11-02

Similar Documents

Publication Publication Date Title
Krall Efficient JavaVM just-in-time compilation
JP4571710B2 (en) Method and apparatus for dispatch table structure
EP3143500B1 (en) Handling value types
US5481708A (en) System and methods for optimizing object-oriented compilations
US5535390A (en) Method for reusing temporaries and reclaiming shared memory
CN107924326B (en) Overriding migration methods of updated types
Stroustrup Parameterized Types for C++.
US6738966B1 (en) Compiling device, computer-readable recording medium on which a compiling program is recorded and a compiling method
US6334212B1 (en) Compiler
US7356812B2 (en) Passing parameters by implicit reference
US20090144697A1 (en) Refractor inner class with object-oriented program optimizer tool for reduced footprint and faster application start
Agesen et al. Finding references in Java stacks
US6836879B1 (en) Object oriented operating system
EP0790555B1 (en) Compile apparatus and method
JP4611245B2 (en) Computer device and method for manipulating or accessing a string class object
Ditzel Reflections on the high-level language symbol computer system
JP2003256215A (en) Program conversion method, data processor using the same, and program
US8468511B2 (en) Use of name mangling techniques to encode cross procedure register assignment
Sagonas et al. All you wanted to know about the HiPE compiler: (but might have been afraid to ask)
White LISP/370: a short technical description of the implementation
GB2355085A (en) Translating a source operation to a target operation
JPH11345127A (en) Compiler
JP3889227B2 (en) Program execution device, program execution method, recording medium, and control program
Luna et al. HiPE on AMD64
Griswold et al. Version 7 of Icon

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090227

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20090304

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20090319

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20090319

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090716