Movatterモバイル変換


[0]ホーム

URL:


IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
logo dvp
Accueil
Delphi
Tutoriels
Génériques
Generics (en)
Plug-in et compo
Procédure et méthode
Composants
Refactoring
Const changeant
Delphi 2005
E-mail

Generics with Delphi 2009 Win32

With, as a bonus, anonymous routines and routine references

Date de publication : November 13th, 2008

ParSébastien Doeraene (sjrd.developpez.com)
 

We have been waiting for them for a while! Now they are here: generics in Delphi Win32. Those little awesome things arecoming with Delphi 2009. This tutorial will help you understand and use them, and design your own generic classes.
ideafr Your comments, critics, suggestions, etc. are welcomed on theblog.
This is a translation of a tutorial initially written in French:fr Les génériques avec Delphi 2009 Win32.I have translated my own tutorial, but I am no perfect English speeker. I therefore apologize for all the mistakes Icertainly did in this translation.

Juan Badell has also translated this tutorial into Spanish:Los genéricos en Delphi2009(HTTP mirror)

Aleksey Timohin hasalso madea translationinto Russian.
This translation may be read inPDFform, which was built byAndrew Tishkin(HTTPmirror).

Introduction
I. Introduction
I-A. Prerequisite
I-B. What are generics?
Daily usage
II. Daily usage: the example of TList<T>
II-A. A simple code to start with
II-B. Assignments between generic classes
II-C. Methods of TList<T>
II-D. TList<T> and comparers
II-D-1. Writing a comparer using TComparer<T>
II-D-2. Writing a comparer using a simple comparison function
Design of a generic class
III. Design of a generic class
III-A. Class declaration
III-B. Implementing a method
III-C. The pseudo-routine Default
III-D. Routine references with tree walks
III-D-1. Other methods using anonymous routines?
III-E. And the rest
III-F. How to use TTreeNode<T> ?
Design of a generic record
IV. Design of a generic record
More with generics: constraints, several parameters
V. Contraints on generic types
V-A. What are the available constraints?
V-B. But what is the purpose of it?
V-C. A variant with constructor
VI. Parameterizing with more than on type
VII. Other generic types
Generic methods
VIII. Generic methods
VIII-A. A generic Min function
VIII-B. Overloading and constraints
VIII-C. Some extras for TList<T>
RTTI and generics
IX. RTTI and generics
IX-A. Changes to the pseudo-routine TypeInfo
IX-A-1. A more general TypeInfo function
IX-B. Do generic types have RTTI?
Conclusion
X. Conclusion
XI. Download the sources
XII. Acknowlegments



Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in/home/developpez/www/developpez-com/upload/sjrd/delphi/tutoriel/generics/index.php on line41

Warning: include(http://sjrd.developpez.com/references.inc): failed to open stream: no suitable wrapper could be found in/home/developpez/www/developpez-com/upload/sjrd/delphi/tutoriel/generics/index.php on line41

Warning: include(): Failed opening 'http://sjrd.developpez.com/references.inc' for inclusion (include_path='.:/opt/php56/lib/php') in/home/developpez/www/developpez-com/upload/sjrd/delphi/tutoriel/generics/index.php on line41

Valid XHTML 1.0 TransitionalValid CSS!

Copyright © 2008-2009 Sébastien Doeraene.Aucune reproduction, même partielle, ne peut être faitede ce site ni de l'ensemble de son contenu : textes, documents, images, etc.sans l'autorisation expresse de l'auteur. Sinon vous encourez selon la loi jusqu'àtrois ans de prison et jusqu'à 300 000 € de dommages et intérêts.


[8]ページ先頭

©2009-2025 Movatter.jp