JP2006302303A - Method for operating or accessing object of computer system and string class - Google Patents

Method for operating or accessing object of computer system and string class Download PDF

Info

Publication number
JP2006302303A
JP2006302303A JP2006153915A JP2006153915A JP2006302303A JP 2006302303 A JP2006302303 A JP 2006302303A JP 2006153915 A JP2006153915 A JP 2006153915A JP 2006153915 A JP2006153915 A JP 2006153915A JP 2006302303 A JP2006302303 A JP 2006302303A
Authority
JP
Japan
Prior art keywords
descriptor
operating system
text
classes
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.)
Granted
Application number
JP2006153915A
Other languages
Japanese (ja)
Other versions
JP4611245B2 (en
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 JP2006302303A publication Critical patent/JP2006302303A/en
Application granted granted Critical
Publication of JP4611245B2 publication Critical patent/JP4611245B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related 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 reduce code and cycle overhead concerning a text string operation in the case of describing an operating system in an object oriented language C++. <P>SOLUTION: An object oriented operating system handles all objects related to text strings as belonging to one of three classes, in which each class performs a different function and at least one such class is modified to do so in a way that reduces code and cycle overhead. This minimizes executable code overhead to minimize the amount of memory required, and allows execution in a minimum number of cycles to minimize power consumption. The operating system is particularly well suited to ROM based mobile computing devices. <P>COPYRIGHT: (C)2007,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 ++ language is widely used to describe application programs for computers such as personal computers, but is rarely used to describe operating systems. When writing an operating system for a personal computer, the requirement of minimizing the size of executable code or minimizing 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 assistant: PDA), smart phone (eg GSM cellular phone with built-in word processor, capable of sending and receiving facsimiles and browsing the Internet) and network computer (NC) environment is an operating system code An example of an environment where minimizing size is an advantage. That is, minimization can mainly reduce hardware (especially ROM and / or RAM) costs. This is particularly important in the above situation, since a wide range of consumer applications generally rely on relatively low cost hardware. Similarly, in the category of mobile computing and smartphones, minimizing processor execution cycles is very important because it minimizes power consumption and minimizing power consumption is essential to extending battery life. It is. 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 object"
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 can be performed on a string class (for example, two text strings are connected together). Thus, a particular object of the string class represents a specific text string. It is only operated in a specific, well-defined way.

テキストがファイリングシステムのファイルに存在するとき、テキストの項目からストリングクラスのオブジェクトを生成するためには、従来のC++プログラミングでは以下のステップが実行される。   In order to create a string class object from an item of text when the text is present in a filing system file, the following steps are performed in conventional C ++ programming.

・メモリ内のバッファ位置をずらす
・ファイル読み取りサービスを使用してテキストをバッファに読み込む
・ストリング生成サービスを使用してバッファされたデータをストリングクラスのオブジェクトに変える
・バッファの内容を破棄する
C++ではテキストストリングの実際の格納位置を識別するのは困難であるが、テキストストリングの位置を知る必要はない。なぜなら、直接操作するのはストリングクラスのオブジェクトであり、その結果実際のテキストストリングが操作される。従って、ストリングクラスのオブジェクトは、事実上テキストストリングのメモリ位置を知っており、テキスト操作に関連する必要なメモリ管理タスクの全てを扱うことができる。
• Shift the buffer position in memory. • Use the file read service to read the text into the buffer. • Use the string generation service to convert the buffered data into a string class object. • Discard the contents of the buffer. Although it is difficult to identify the actual storage location of the string, it is not necessary to know the location of the text string. Because it is a string class object that directly manipulates, the actual text string is manipulated as a result. 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 objects of the string class In the C ++ version known as the ANSI / ISO C ++ standard draft, all objects of the string class (strings in the standard part of the standard library draft referred to as <string>) Processed in such a way that sophisticated memory management tasks can be performed (as exemplified by the class) (eg, buffer space can be expanded, reduced, combined, ie fully dynamic) Relocation of buffer space for text). However, this level of memory management uses a large amount of code and requires a significant amount of 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 literal text is manipulated, a string class object must be created from it. However, by creating this string class object, a text string is created in memory, and this text string is actually manipulated by the newly created 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 then duplicated again 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, conventional C ++ (as implemented in the ANSI / ISO C ++ standard draft) does not have a mechanism to eliminate the inherent duplication of 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 limited C ++ length In C ++, a programmer uses heap memory to process text. Text with limited length does not actually require the sufficiently flexible approach needed 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 handling is code and cycle intensive.

C++の全体にわたるテキストのメモリ管理は、コードおよびサイクルを集中的に使用する。コード空間および消費電力はモバイル環境では重要であるので、従来のC++の手法では、受容できないほどコードサイズが大きく、かつ、電力も大量に消費するオペレーティングシステムとなってしまう。   Text memory management across C ++ uses code and cycles intensively. 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 structure of string class objects, mainly 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. Although well-functioning 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つの異なったクラス、を提供することで、コードサイズおよびサイクルオーバヘッドを最小化することである。これは柔軟性を与える。すなわち、例えば、全ての機能を果たすメモリ管理関数は、今や実際にそれを必要とするテキストストリングにだけ適用されうる。   Thus, the generalization of the inventive concept of the present invention allows the computer operating system to have three different classes dealing with text strings: three different classes, each of which is suitable for a different situation, Is to minimize code size and cycle overhead. This gives flexibility. That is, for example, a memory management function that performs all functions can now be applied only to text strings that actually need it.

この新しいストリングクラスのオブジェクトのファミリを「ディスクリプタ(descriptor)」として参照することにする。好ましい実施形態では、このファミリのメンバを「ポインタディスクリプタ」、「バッファディスクリプタ」および「ヒープディスクリプタ」と呼ぶ。これらの概念は、当業者が親しんでいる「ポインタ」、「バッファ」および「ヒープ」の確立された概念とは(関連するが)異なることに注意が必要である。また、本明細書で想定するディスクリプタも、同じ名前のVMS設備や、アクティブオペレーティングシステムを識別するのに使用される小さな整数用のUNIX(登録商標)用語とは何の関係もないことにも注意が必要である。当業者には、テキストストリングを扱うクラスの数が3つを越えるようにオペレーティングシステムを設計することができることが理解されるであろう。そのような変形も本発明の範囲に含まれる。3重構造は、クラスの増殖(proliferation of Classes)としては最小(かつほとんど全ての場合にもっとも有効)である。   This new string class object family will be referred to as a “descriptor”. 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 an operating system can be designed to have more than three classes that handle text strings. Such modifications are also included in the 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, so a single service operates on all descriptors. This results in significant code and lesser overhead reduction since each different descriptor requires a differently modified service.

本発明の第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 (for example) three different form objects, each form optimized for different situations. Is based on the knowledge that the operating system needs to be redesigned.

本発明の好適な形態では、従来の、メモリを集中的に使用するテキスト処理技法は、そのような技法を要求するオブジェクトを定義する新しいディスクリプタクラス(すなわち、ヒープディスクリプタ)に属するオブジェクトにのみ適用される。しかしながら、ポインタおよびバッファディスクリプタクラスは、従来のストリングクラスと比べてコードおよびプロセッササイクルを減少させるように設計されている。   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 However, the pointer and buffer descriptor classes are designed to reduce code and processor cycles compared to conventional 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) treats literal text to eliminate the need for duplication of literal text, and (ii) is dynamically determined at runtime to perform intensive use of heap memory code only in the limited circumstances actually required In other situations (eg when the programmer knows the maximum length of the text in advance), use static memory instead to handle the text. Further details of the specific process are given below.

好ましくは、オペレーティングシステムは同じ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 progressive aspects could be handled 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 this 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 herein 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.

上記従来技術の検討で挙げた、リテラルテキストおよび長さが制限されたテキストの例に戻り、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 ++, the text string for literal text is 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++では、本質的にポインタは通常オブジェクトとして認識されていない。   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 TPtrC pointer descriptor in EPOC32) is a string class object for literal text. (In C ++, a pointer is essentially not recognized as a normal object.

従って、EPOC32のポインタ/オブジェクトのハイブリッドによって、リテラルテキストの追加のコピーの必要が完全に除去される。   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 noted above, conventional C ++ only has a mechanism to use sufficiently flexible and well-characterized string class objects, regardless of the text length. There is no mechanism to use other than that. 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 for string objects called size limited buffer descriptors. Since they are limited in size, they do not require complex memory allocation code to operate. Furthermore, the buffer descriptor can use static memory (not heap memory). Static memory is more efficient to use because it requires less code cycles to perform the necessary operations, although it cannot relocate memory in a way that uses heap memory intensively. (Thus power savings). 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 はストリングクラスのそのようなオブジェクトに対して一定の共通プロパティを定義する。)
EPOC32は、コードサイズおよびサイクルオーバヘッドを最小化する以外の重要な特徴も示す。それは主に以下の点である。
The EPOC 32 defines a string class parameter with a limited length using a class template of the “TBuf” class. (A class template defines the properties of a number of objects of a string class. For example, TBuf is a template for all objects of a string class of all buffer descriptors, ie, buffer variants. TBuf is such a string class such as Define certain common properties for objects.)
EPOC 32 also exhibits important features other than minimizing code size and cycle overhead. The main points are as follows.

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

これはEPOC32で、バッファおよびポインタについて以下のように達成される。   This is achieved in EPOC 32 for buffers and pointers as follows.

バッファディスクリプタ(TBuf)は、バッファによって参照される実際のテキストを含んでおり、従って、バッファをコピーすると本質的に関連するテキストをコピーする。C++のようにポインタおよび関連するデータのコピーは必要ない。   The buffer descriptor (TBuf) contains the actual text referenced by the buffer, so copying the buffer essentially copies the associated text. There is no need for a copy of the pointer and associated data as in C ++.

ポインタディスクリプタ(TPtr)は、C++型のポインタを内部に含んでいるので、複製するときにはTPtrだけが必要である。従来のC++では、1つのエンティティだけでなく関連する別のポインタおよびテキストもコピーする必要があった。   Since the pointer descriptor (TPtr) contains a C ++ type pointer, only 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ビット長のフィールドも使用される。
Descriptors as polymorphic objects A group of objects is said to exhibit polymorphism when all objects in the group act like a single object, even though common actions are achieved by different mechanisms. Polymorphism is brought about by a virtual function in conventional C ++, where all objects that are polymorphic to each other contain a pointer to a virtual function table (and thus a pointer is needed in each object) at a common location. . 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 the mobile operating system environment (especially) this 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 examines the 4 bits and points to the correct text position (eg, if the descriptor is a buffer, in the descriptor itself). 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. 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倍にすることとなる。また、従来は、プログラマがソースコードを書くときに、アスキーまたはユニコードのどちらを使用して記述するかを決定する必要があった。
Unicode and ASCII unchanging code 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 クラスネームを使用して作成する。   In EPOC32, the same source code is used regardless of the final choice of ASCII or Unicode. This is accomplished by configuring the system with class name aliases that are not changed by ASCII and Unicode, but by the classes themselves (eg, pointer descriptors, buffer descriptors and heap descriptors). Thus, instead of using the pointer TPtr16 to describe Unicode or using TPtr8 to describe ASCII, the programmer creates it using the TPtr class name.

作成時に、クラスネームは16ビットユニコードまたは8ビットアスキーコードのいずれかでコンパイルできる。この手法は、異なったビット長でコード化される全ての文字セットを含むように適用できる。   At creation time, class names can be compiled in 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 ++, text strings usually end with “0”, which allows the system to easily know where the text string ends. 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. This eliminates the need to use "0" to indicate the end of each text item, further saving code.

ディスクリプタの特徴の要約
ディスクリプタには3つのクラスがある。すなわち、ポインタディスクリプタ、バッファディスクリプタおよびヒープディスクリプタである。
・ポインタディスクリプタには2つの形態がある。不変ポインタディスクリプタ TPtrC と可変ポインタディスクリプタTPtrである。
Summary of descriptor features There are three classes of descriptors. That is, a pointer descriptor, a buffer descriptor, and a heap descriptor.
There are two types of pointer descriptors. An invariant pointer descriptor TPtrC and a variable pointer descriptor TPtr.

・不変ポインタディスクリプタ:TPtrC
・これによりデータは変更できない。
・全てのメンバ関数が一定。
・不変ストリングまたはデータ(例えば変更されてはいけないデータ)
・TDesC から導出され、従って多数のメンバ関数を有する。
Invariant pointer descriptor: TPtrC
-Data cannot be changed by this.
・ All member functions are constant.
Invariant strings or data (eg data that must not be changed)
Derived from TDesC and thus has a large number of member functions.

・可変ポインタディスクリプタ:TPtr
・設計者によって設定された最大長を越えない範囲で、このディスクリプタによってデータを変更できる。
・変更されている領域を含むメモリ領域を直接指し示す。
・ポインタ長により含まれるデータ項目数が決定される。
・全てのTDesC メンバ関数に加えデータの変更および操作のためのTDes ・ポインタディスクリプタはデータ表現とは別であるが、メモリ内の予め存在する領域から構成される。
Variable pointer descriptor: TPtr
-Data can be changed by this descriptor as long as the maximum length set by the designer is not exceeded.
Directly point to the memory area that contains the area that has been changed.
-The number of data items included is determined by the pointer length.
-TDes for changing and manipulating data in addition to all TDesC member functions-The pointer descriptor is separate from the data representation, but consists of pre-existing areas in memory.

・バッファディスクリプタには2つの形態がある。   There are two forms of buffer descriptors.

・不変バッファディスクリプタ:Tbuf<;TintS>;
・作成時または後で代入演算子(演算子=)により、ディスクリプタにデータを設定できる。
・整数テンプレートにより長さが定義される。すなわち、TBufC<;40>;は40のデータ項目を含んでいる。
・全てのTDesC メンバ関数を継承する。
Invariant buffer descriptor: Tbuf <;TintS>;
-Data can be set in the descriptor at the time of creation or later by 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.

・可変バッファデイスクリプタ:Tbuf<;TintS>;
・最大長を越えない範囲で変更できるデータを含んでいる。
・最大長が最大データ項目数を定義する。
・実際の長さが実際のデータ項目数を定義する。
・整数テンプレートにより長さが定義される。すなわち、TBuf<;40>;は40のデータ項目だけを含んでいる。
・データ領域はディスクリプタオブジェクトの一部である。
・操作および変更の必要なデータを含めるのに有効であるが、その長さは既知の最大値(例えばWPテキスト)を越えない。
・全てのTDesC メンバ関数に加えデータの変更および操作のためのTDesメンバ関数を継承する。
Variable buffer descriptor: Tbuf <;TintS>;
-Data that can be changed within the range not exceeding the maximum length is included.
• 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>; contains 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 メンバ関数を継承する。
・再割り当て可能、すなわち、データ領域は拡張および縮小できる。
-There is only one form of heap descriptor.
Invariant heap descriptor: HBufC
• Consecutive length with data.
The data area is a part of the descriptor object, and the entire object occupies cells allocated from the heap.
-Data can be set in the descriptor at the time of creation or later by an assignment operator (operator =).
Inherit all TDesC member functions.
Reassignable, ie the data area can be expanded and contracted.

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

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

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

ディスクリプタは、表わされたデータのタイプで区別をしないので、ストリングおよびバイナリデータの両方は同様に扱われる。ディスクリプタオブジェクトのメンバ関数のあるものはテキストデータを操作するように設計されているにもかかわらず、それらはバイナリデータにも作用する。これによりストリングおよびバイナリデータの扱いを統一し、コードを共有できるようにして効率を高める。   Since descriptors do not differentiate by the type of data represented, both string and binary data are treated similarly. Although some of the descriptor object member functions are designed to manipulate text data, they also work on binary data. This unifies the handling of strings and binary data and increases efficiency by allowing code to be shared.

ディスクリプタクラスはいくつかの重要な用件を満足する:
・ユニコードおよびアスキーテキスト両方のサポートを提供する。マクロ UNIC0DEは、アスキーまたはユニコードで作成された変数を選択するのに使用される。
・ストリングおよびバイナリデータの扱いを統一する。
・ROM内のテキストまたはデータの安全かつ便利な参照を可能にする。
・関連するテキストまたはデータを操作する多くのメンバ関数を提供する。
・データの変更を可能とするが、定められたデータ領域外へ書き込もうとするあらゆる試みを防止する。
・仮想関数に関連するメモリオーバヘッドをなくす。
・組み込みタイプのように作用し、スタック上に安全に作成され、安全に孤立化(orphaned)され得る。
・(HBufC がヒープ上に割り当てられ、規則の例外となる。)。
Descriptor classes satisfy several important requirements:
Provide support for both Unicode and ASCII text. The macro UNICODE is used to select variables created in ASCII or Unicode.
・ Unify handling of strings and binary data.
Enables safe and convenient reference of text or data in ROM.
Provides a number of member functions that operate on related text or data.
• Allows data modification, but prevents 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.ディスクリプタ文字セット
アスキーテキスト文字は8ビット(1バイト)で表わされるが、ユニコード文字は16ビット(2バイト)を必要とする。アスキーおよびユニコードテキストの両方をサポートするために、ディスクリプタクラスは、8ビットと16ビットの2つの変形を有する。例えば、TPtr8 およびTPtr16 の2つのポインタディスクリプタクラスがある。
_____________________________________________________
ASCII and Unicode text E32. Descriptor character 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 のいずれかを使用するようにシステムを構成できる。マクロ UNIC0DE が定義されたか否かによって、作成時(build time)に決定される。   The program can be configured to support either Unicode or ASCII text using a class name that is independent of the created variable. For example, the descriptor class TPtr can be used to configure the system to use either TPtr8 or TPtr16. It is determined at the time of creation (build time) depending on whether or not the macro UNICODE is defined.

ヘッダファイルE3232def.h(SDKの付録1参照)から抽出した次のコードは、変数から独立したクラスネームを適切に定義することによって実現する方法を示している。   Header file E3232def. The following code extracted from h (see Appendix 1 of the SDK) shows how to achieve it by properly defining class names independent of 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 macro S should be used to return the appropriate type of pointer to generate the appropriate width “C” style string. Also, macro L (L for "literal") should be used to create the appropriate type of descriptor. For definitions of these macros, see e32. macro. _S and e32. macro. See _L.

例えば、
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. See _L16.

______________________________________
長さおよびサイズ
E3232.ディスクリプタ長さおよびサイズ
ディスクリプタは、表わすデータをそのデータの長さで特徴付ける。ディスクリプタの長さは、データ項目の数である。8ビットの変数に対しては、ディスクリプタの長さはそれが表わす1バイトデータの数であり、16ビットの変数に対しては、ディスクリプタの長さはそれが表わす2バイトデータの数である。
_____________________________________________________
Length and size E3232. Descriptor 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である。   Descriptor size is the number of bytes occupied by descriptor data, and need not be the same as the descriptor length. For an 8-bit variable, the size is the same as the length, and for a 16-bit variable, the size is twice the length. A descriptor that allows data to be modified is also characterized by its maximum length. For these descriptors, the length of the data represented can vary with a maximum value from zero to this maximum value. The maximum length of any descriptor is 228.

______________________________________
テキストおよびバイナリデータ
E3232.ディスクリブタテキストおよびバイナリ
「C」では、ストリングスは、ストリングの終端を示すゼロターミネータを必要とすることによって特徴付けられる。これらは多数の問題を招く。特に、これらは(データがバイナリゼロを含む場合に)バイナリデータを中に含むことができず、それらに対する操作は一般的に効率的でない。「C」ストリングスは、ANSIの「C」ライブラリの関数グループ、memxxx()およびstrxxx()に反映されているように、バイナリデータとは異なった方法で扱う必要がある。ディスクリプタはストリングとバイナリデータを同じ方法で表わすことを可能とし、これは両方の場合に同じ関数を使用することを可能とする。バイナリデータに対しては、明示的に8ビットのディスクリプタを使用しなければならない。バイナリデータにとっては、ユニコードをアスキーの区別は意味がない。16ビットバイナリデータは事実上使用しないことに注意せよ。
_____________________________________________________
Text and binary data E3232. In discrete text and binary “C”, strings are 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 group, 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.ディスクリプタ割り当て
ディスクリプタクラスは(HBufC を除いて)、組み込みタイプのように作用する。これらはメモリの割り当てを行わず、デストラクタを持たない。これは、ディスクリプタクラスが組み込みタイプと同様にスタック上で孤立化され得ることを意味する。これは特に、コードを残せる状況では重要である。(孤立化の影響については、E3232.例外トラップ.クリーンアップ.用件を参照せよ)
HBufCディスクリプタオブジェクトはヒープ上に割り当てられ、スタック上には作成されない。
_____________________________________________________
Memory allocation E3232. Descriptor Assignment Descriptor classes (except HBufC) act 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.ディスクリプタ例外
ディスクリプタメンバ関数の全てのパラメータは、操作が正しく指定され、どのデータもディスクリプタのデータ領域外に書き込まれないことを保証するべく検査される。特定の結果は、どのメンバ関数も、可変ディスクリプタをその最大割り当て長を越えて拡張できないこととなる。元の割り当てを十分大きくするか、より大きいディスクリプタの必要性を見越して実行時により大きなディスクリプタを動的に割り当てるかによって、全てのディスクリプタがデータを収容できるように十分大きいことを保証するのは、プログラマの責任である。スタティックな手法は実施がより簡単であるが、これが無駄であると判明した特定の場合には、動的手法がより効果的であろう。例外の場合には、どんな認められていないメモリのアクセスも実行しないこと、およびどんなデータも移動または損傷されないことが安全であると考えられている。
_____________________________________________________
Exception E3232. Descriptor Exception 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. The particular result is that no member function can extend a variable descriptor beyond its maximum allocation length. Depending on whether the original allocation is large enough or a larger descriptor is dynamically allocated at runtime 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. Although the static approach is easier to implement, the dynamic approach may be more effective in certain cases where it turns out to be useless. In the case of exceptions, it is considered safe not to perform any unauthorized memory access and to prevent any data from being moved or damaged.

______________________________________
ディスクリプタタイプ
E3232.ディスクリプタタイプ
ディスクリプタオブジェクトには3種類ある。
_____________________________________________________
Descriptor type E3232. Descriptor types There are three types of descriptor objects.

すなわち、
・ポインタディスクリプタ
ディスクリプタオブジェクトは、それが表わすデータとは別であるが、メモリ内の予め存在する領域に生成される。これには、
不変ポインタディスクリプタ、TPtrC
可変ポインタディスクリプタ、TPtr
の2つの形態がある。
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<;TlntS>;
可変バッファディスクリプタ、TBuf<;TlntS>;
の2つの形態がある。
Buffer descriptor The data area is a part of the descriptor object. This includes
Immutable buffer descriptor, TBufC <;TlntS>;
Variable buffer descriptor, TBuf <;TlntS>;
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.ディスクリプタポインタディスクリプタ.TPtrC
TPtrC は、それによってどのデータも変更されない、不変ディスクリプタである。そのメンバ関数の全ては(コンストラクタを除いて)不変(constant)である。図1にTPtrC が概略的に示されている。TPtrC は不変ストリングまたはデータを参照する、例えば、ROM常駐コード中に生成されたテキストをアクセスするとき、またはその参照によってデータが変更されてはならないRAM内のデータに参照を渡すときに有効である。TPtrC は、例えば、テキストまたはデータの抽出部分内の文字の位置決めなどの、その内容を操作する多くのメンバ関数を提供するTDesC から導出される。
_____________________________________________________
Pointer descriptor-TPtrC
E3232. Descriptor pointer 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, when accessing text generated in ROM resident code, or passing a reference to data in RAM whose data must 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.ディスクリプタ.ポインタディスクリプタ.TPtr
TPtr は、データが最大長を越えない範囲で、それによってデータを変更できるポインタディスクリプタである。最大長はコンストラクタによって設定される。
TPtr は、変更されているデータを含むメモリ内の領域を直接指し示す。TPtr は、図2Aおよび2Bに概略的に示されている。
_____________________________________________________
Pointer descriptor-TPtr
E3232. descriptor. Pointer 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 points directly to the area in memory that contains the data being 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. TPtr represents 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 generates a reference to an area of RAM that contains data that is intended to be modified by reference, or to a RAM area that has no data yet, but uses descriptor references and member functions to generate data It is effective to do.

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 modified. TPtr used in this way points to a TBufC or HBufC descriptor. The data contained 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 modify data, such as adding characters to the end of existing text. .

______________________________________
バッファディスクリプタ−TBufC<;TInt S>;
E3232.ディスクリプタ.バッフアディスクリプタ.TBufC
TBufC は、データ領域が続く長さを有するバッファディスクリプタである。データは、生成時にまたは他のあらゆるときに割り当てられた演算子(演算子=)によって、ディスクリプタ内に設定される。ディスクリプタによって保持されたデータは不変である。TBufC は、図3に概略的に示されている。TBufC の長さは、例えば、TBufC<;40>;が40までのデータ項目を含むことができるTBufC を定義するように、整数テンプレートによって定義される。
_____________________________________________________
Buffer descriptor-TBufC <; TInt S>;
E3232. descriptor. Buffer descriptor. TBufC
TBufC is a buffer descriptor having a length followed by a data area. Data is set in the descriptor by an operator (operator =) assigned at generation time or at any other time. The data held by the descriptor is unchanged. TBufC is schematically shown in FIG. The length of TBufC is defined by an integer template, for example, 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 a number of member functions that manipulate its contents, for example, locating characters in the text or data extractor. TBufC provides a member function Des () that creates a variable pointer descriptor (TPtr) that references TBufC. As a result, the 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.ディスクリプタ.バッファディスクリプタ.TBuf
TBuf は、データが最大長を越えない範囲で、変更できるデータを含むバッファディスクリプタである。図5にTBuf が概略的に示されている。TBuf が内部のデータ領域に含むことができるデータ項目の数は、最大長によって定義される。
_____________________________________________________
Buffer descriptor-TBuf <; TInt S>;
E3232. descriptor. Buffer descriptor. TBuf
TBuf is a buffer descriptor including data that can be changed within a range in which 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.

ディスクリプタの長さは、データ領域に現在いくつのデータ項目が含まれているかを表わしている。この値が最大値より小さいとき、データ領域のある部分は未使用である。TBuf の最大長は、例えば、TBuf<;40>;が40までの(かつ越えない!)データ項目を含むことができるTBuf を定義するように、整数テンプレートによって定義される。TBuf は、例えばワードプロセッサのテキスト等の、操作および変更が必要であるが、その長さが既知の最大値を越えないデータを収容するのに有効である。TBuf は、TDesC から導出されたTDes から導出される。   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, for example, by an integer template such that TBuf <; 40>; defines a TBuf that can contain up to 40 (and no more!) Data items. TBuf is useful for accommodating 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.

従って、TPtr は、TDesC で定義された全てのconst メンバ関数に加え、例えば、既存のテキストの末端に文字を付加する等の、データの操作および変更が可能なTDes のメンバ関数を継承している。   Therefore, TPtr inherits all the const member functions defined in TDesC, as well as the TDes member functions that can manipulate and modify data, such as adding characters to the end of existing text. .

______________________________________
ヒープディスクリプタ−HBufC
E3232.ディスクリプタ.ヒ−プディスクリプタ.HBufC
HBufC は、データ領域が続く長さを有するディスクリプタである。スタティックメンバ関数、New()、NewL()またはNewLC()を使用してヒープ上に割り当てられる。ディスクリプタの長さはこれらスタティック関数へのパラメータとして渡される。図6にHBufC が概略的に示されている。データは、生成時にまたは他のあらゆるときに割り当てられた演算子(演算子=)によって、ディスクリプタ内に設定される。HBufC は、例えばテキストまたはデータの抽出部分内の文字の位置を決める、その内容物を操作する多くのメンバ関数を提供するTDesC から導出される。
_____________________________________________________
Heap descriptor-HBufC
E3232. descriptor. Heap descriptor. HBufC
HBufC is a descriptor having a length followed by a data area. It is allocated on the heap using the static member function, New (), NewL () or NewLC (). The descriptor length is passed as a parameter to these static functions. FIG. 6 schematically shows HBufC. Data is set in the descriptor by an operator (operator =) assigned at generation time or at any other time. HBufC is derived from TDesC, which provides a number of member functions that operate on its contents, for example, locating characters within the text or data extractor.

HBufC は、HBufC を参照する可変ポインタディスクリプタ(TPtr)を作成する、メンバ関数Des()を提供する。TPtr の最大長は、HBufC データ領域の長さである。図7はこれを概略的に示している。   HBufC provides a member function Des () that creates a variable pointer descriptor (TPtr) that refers to HBufC. 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 using a call to User :: Free () or the keyword delete.

______________________________________
ディスクリプタクラスの継承・派生関係
E32.ディスクリプタ.クラス
全てのディスクリプタクラス、TPtrC,TPtr,TBufC,TBufおよびHBufC は、抽象的基底クラス(abstract base class)TDesC およびTDes から導出される。
_____________________________________________________
Descriptor class inheritance / derivation relationship E32. descriptor. Class All descriptor classes, TPtrC, TPtr, TBufC, TBuf and HBufC are derived from the abstract base classes TDesC and TDes.

クラスTBufCBase を抽象的基底クラスとして示したが、これは単に実施が容易なためである。図8はクラス間の関係を概略的に示している。   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.

実際のディスクリプタクラスの作用は非常に似ており、従って、ディスクリプタのほとんどの関数は抽象的基底クラスによって提供される。ディスクリプタは(特にスタックで)広く使用されるので、ディスクリプタオブジェクトのサイズを最小にする必要がある。これを補助するように、各ディスクリプタオブジェクトにおいて仮想関数テーブルポインタのオーバーへッドをなくすため、仮想関数の定義をしない。その結果、基底クラスはそこから導出されるクラスの知識を潜在的に持っている。   The action 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, the virtual function is not 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は、8ビット(アスキー)テキストおよびバイナリデータを扱うものと、16ビット(ユニコード)テキストを扱うものとの2つのディスクリプタクラスの変数を供給する。実際のクラスの8ビット変数は、TPtrC8,TPtr8,TBufC8<;TInt S>;,TBuf8<;TInt S>;およびHBufC8であり、抽象クラスの8ビット変数は、TDesC8 およびTDes8 である。同様に、16ビット変数の名前はそれぞれ、TPtrC16,TPtr16,TBufC16<;Tlnt S>;,TBuf16<;TIntS>;,HBufC8,TDesC16およびTDes16である。   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 class 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 <; TIntS> ;, HBufC8, TDesC16 and TDes16, respectively.

この区別はテキストを表わすのに使用されるディスクリプタにはトランスペアレントである。TPtrC,TPtr,TBufC<;TInt S>;,TBuf<;TInt S>;およびHBufCクラスを生成し使用するプログラムを書くことにより、ユニコードおよびアスキーの両方に対する互換性が維持される。マクロ_UNIC0DEが定義されたか否かに応じて、構成時に適切な変数が選択される。マクロ_UNIC0DEが定義されていると16ビット変数が変数が使用され、そうでなければE32.ディスクリプタ.文字セットで説明したように8ビットの変数が使用される。   This distinction is transparent to descriptors used to represent 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 macro_UNIC0DE is defined, an appropriate variable is selected at the time of configuration. If macro_UNIC0DE is defined, a 16-bit variable is used, otherwise E32. descriptor. As described in the character set, 8-bit variables are used.

バイナリデータのディスクリプタは、明示的に8ビット変数を使用する必要があり、換言すると、コードは明示的に TPtrC8,TPtr8,TBufC8<;TInt S>;,TBuf8<;TInt S>;およびHBufC8のクラスを生成する。   Binary data descriptors must explicitly use 8-bit variables, in other words, the code explicitly uses TPtrC8, TPtr8, TBufC8 <; TInt S> ;, TBuf8 <; TInt S>; and HBufC8 classes Is generated.

バイナリデータに対して16ビット変数を明示的に使用することもできるが、勧められない。一般に、8ビットおよび16ビットの変数は、構造および実施において同一であり、クラス自体の記述は全体に渡り構成とは独立した名前を使用する。   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 configuration throughout.

多くのメンバ関数が、ディスクリプタが8ビットか16ビットの変数であるかに応じて、TUint8*タイプまたはTUint16*タイプの引数を取ることに特に注意せよ。説明を単純にするため、これらの引数を関数プロトタイプTUint??*として記載する。   Note in particular 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.
JP2006153915A 1997-06-13 2006-06-01 Computer device and method for manipulating or accessing a string class object Expired - Fee Related JP4611245B2 (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
JP11501913A Division JP2000501873A (en) 1997-06-13 1998-06-12 Object-oriented operating system

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2008185277A Division JP2009059350A (en) 1997-06-13 2008-07-16 Information processing apparatus and method, program, and recording medium

Publications (2)

Publication Number Publication Date
JP2006302303A true JP2006302303A (en) 2006-11-02
JP4611245B2 JP4611245B2 (en) 2011-01-12

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 (1)

Application Number Title Priority Date Filing Date
JP11501913A Withdrawn JP2000501873A (en) 1997-06-13 1998-06-12 Object-oriented operating system

Family Applications After (1)

Application Number Title Priority Date Filing Date
JP2008185277A Pending JP2009059350A (en) 1997-06-13 2008-07-16 Information processing apparatus and method, program, and recording medium

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
JP2009059350A (en) 2009-03-19

Similar Documents

Publication Publication Date Title
Krall Efficient JavaVM just-in-time compilation
US5481708A (en) System and methods for optimizing object-oriented compilations
JP4571710B2 (en) Method and apparatus for dispatch table structure
US5535390A (en) Method for reusing temporaries and reclaiming shared memory
Stroustrup Parameterized Types for C++.
JP4562918B2 (en) Compiling program generation for an interpretive runtime environment
CN107924326B (en) Overriding migration methods of updated types
US6049667A (en) Computer system, method of compiling and method of accessing address space with pointer of different width therefrom
JP3606561B2 (en) Method, system, program, and data structure for converting first bit architecture instructions to second bit architecture instructions
US20040194071A1 (en) Compiling device, computer-readable recording medium on which a compiling program is recorded and a compiling method
US6334212B1 (en) Compiler
US6901591B1 (en) Frameworks for invoking methods in virtual machines
EP0922250B1 (en) Object oriented operating system
Demoen et al. Herbrand Constraint Solving in HAL.
JP4611245B2 (en) Computer device and method for manipulating or accessing a string class object
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)
JPH11345127A (en) Compiler
White LISP/370: a short technical description of the implementation
JP3889227B2 (en) Program execution device, program execution method, recording medium, and control program
WO2002052409A2 (en) Method and apparatus for increasing performance of an interpreter
Pennello Compiler challenges with RISCs
Luna et al. HiPE on AMD64
JP3630086B2 (en) Program conversion apparatus, program conversion method, and recording medium

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070727

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20071024

A602 Written permission of extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A602

Effective date: 20071029

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080125

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080317

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080716

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20080723

A912 Re-examination (zenchi) completed and case transferred to appeal board

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20080815

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20090309

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

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100922

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101013

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131022

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees