[Reposted] Delphi's Data Structure Wizard Guide, STL in Delphi

xiaoxiao2021-03-06  39

Finally, I found the STL in DECAL, Delphi, and finally there was Map.

I choose, I like it!

The following is reproduced:

Vocal Mandarin, any individual or institution can be freely forwarded and referred to in the Internet on the Internet. However, the integrity of this article must be guaranteed during the forwarding process, and no changes are made. The author allows any individual or agency to describe, supplement or evaluate this paper in the forwarding process of this paper. However, it is not necessary to modify it in the original text of this article. Second, on the traditional media published, use, the declaration of this document is prohibited from publishing, use, reference, reference, reference, reference, reference, reference, refer to the part or all of the contents of this document without the written (including email) licenses. If you need to publish, use, reference this file, please contact your own with mail. I contact Mail: riceball@cq118.com or riceballl@hotmail.com. After writing N software projects, it is tired of each project needs to adjust its own data structure. Although it only needs to be adjusted slightly, it still feels uncomfortable, and if the original data or operating rules change, it is necessary to replace data. The structure can adapt to new needs, annoying. If you can abstract all the common features of all data structures, write a universal data structure class library, is it unhappy. Look online first: Containers is the general data structure and algorithm class library written by Ralf Junker: homepage: http://www.zeitungsjunge.de/delphi/containers/index.htm This class library is ShareWare, USD $ 60 00. EZDSL (Easy Data Structures Library for Delphi) is a general data structure and algorithm class library written by Julian M. Bucknall. It is said that the STL is faster than C : homepage: http://www.boyet.com/ Download address: http: //www.boyet.com/support/ezdsl303.zip author wrote a book: The Tomes of Delphi: Algorithms and Data Structures http://www.boyet.com/dads/reviews.htm This class library is free However, the author wants to be donated. Delphi Fundamentals is the general data structure written by David Butler and the algorithm class library http://prdownloads.sourceForge.Net/FundEmentals/fndutl31.zip This class library is free TurbOPower's Systools also have data structure and algorithm class library Container Classes. It is a fee, and now it has been open. Delphi Collections Data Structure and Algorithm Category Locations Http://www.warmachine.u-net.com/delphi_collections Copyright 2003 by Matthew Greet, Published Under LGPL V2.1. Using Interface Implementation. Delphi (ObjectPascal) DECAL data structure and algorithm generic class library http://sourceforge.net/projects/decal/Decal is a data structural class library based on Mozilla Open Source Protocol, which is SOletta. After comparing the above data structure and algorithm library, I selected the DECAL data structure and algorithm generic class library, but unfortunately all of the above data structural algorithm libraries, there is no expected data storage free zoom (autonomous) Decideting the data in a memory or file) function, see that this feature is only added.

Analysis of DECAL 1, DECAL SDL Universal Data Structure and Algorithm Category - Valer Programming Class Library I Personally think is a data structural class library that I have discovered in the class structure built-in construction, and performance is also quite prominent. Disadvantages: His thoughts are from Stepanov and Lee C STL (Standard Template Library) and ObjectSpace's JGL (Java Generic Library), so the function, variables in the library use STL's term name, these terms do not conform to Delphi programming languages The habit of norms, need to be re-understood, trouble. I decided to first try this class as much as possible to comply with the use of Delphi programming language norms. First, start from learning STL's terms. DECAL Introduction Decal's predecessor is SDL, a business general data structure and algorithm class library. DECAL deletes the code about the garbage collection section, and the other parts are open from the source, which is a good news for everyone. The full name of DECAL is Delphi Container and Algorithm Library, that is, the Delphi Data Container and Algorithm Category. Decal is a data structural class library based on Mozilla Open Source Protocol, which is Soletta. Some of DECAL is from Stepanov and Lee C STL (Standard Template Library) and ObjectSpace's JGL (Java Generic Library). DECAL offers a number of functions that are not available in many other Delphi libraries: * Based on a mature STL system, powerful underlying process. * Decal is based on generic computer algorithms and data structures. * Provide a variety of data types to provide easy usage. Such as Integers, Strings, Extended Values. * DECAL uses the array constant Array of Const function of Delphi 4, which greatly reduces the burden of programmers. * DECAL provides more than 60 common algorithms. * Decal Integrated SuperStream provides solutions for data storage to stream. * Complete data structure class library. DECAL includes: array arrays, two-way linked table Double-Linked Lists, mapping Maps, and Collection SETS. The mapping structure implements two algorithms including binary trees and hash forms. Now DECAL has at least 10 different data structures. Basic Concept Containers, Algorithms (Algorithm), and Persistence (Save). Containers: Note for the data structure class. Here we discuss various data structures of DECAL. Enume the pros and cons of various data structures. And show the concept of Iterator. Algorithms lists the main algorithm types in DECAL and tells you how to apply to Container! Persistence talks about how to save and read data from the stream. DECAL term: Item (data item) is in Decal, data item (Items) is the following basic data type: integer, string, currency, or character (char) type, etc.. An object (Object) is also a data item. The Container container is used to save the data item. It is a data structure. Different types of containers (data structures) have different capabilities. According to an example, some type of container may have fast deletion capabilities, but add slower, and another container supports fast random access, but slower deletion.

When you need a container to save your data item, select the appropriate container type will make your program efficiency multiply, and vice versa. The pros and cons of each container will be detailed later. Iterator is the data item pointer, which points to a particular data item in the container. The data item pointer can move before, and the access data item is implemented via the Iterator (data item pointer). Using the Iterator (Data Item Pointer) Access Data allows you to change the processing of data items after changing the container type. We often see the following code: item: = container.start; item: = container.finish; first line of code is the first data of the container, and the second line is the ATEND end data item of the container (last The latter position of the data item, the end of the flag is the comparrator, which should be a comparison event that is called when the size of the data item is required. This needs to be changed to Delphi habit. The comparison function (Comparator) is used to compare the size of the two data townships. If the first item is less than the second item, the function should return a value of less than zero; if it returns a value 0 if it is equal; if the first item is greater than the second item, the function should return a value greater than 0. The following is the definition of comparison functions: dComparator = function (const object): Integer of object; AtendDecal Using the Data Item Pointer Maintenance The location of the data in the container. There is a special data item pointer (Iterator) called: adend. The ATEND data item pointer indication has reached the end of the container, and there is no data available. Take data from this position is illegal! Sometimes write to this location is legal. A container adds an object to the Atend Being Written to The end of the contact, but not all containers do, especially mapping containers. Atend is very important that they will return Atend when the algorithm cannot advance to the next data item. Range range is two data item pointers, labeled the start position and end position of the data item. For example: data items between Container.Start and Container.finish are a range. PAIR (data pair) a data pair is two data items (two DOBJECTS, stored in a DPAIR). The data stored in the mapping container is data pair, and the stored data is composed of a keyword key (first field) and data value value (second field).

转载请注明原文地址:https://www.9cbs.com/read-72215.html

New Post(0)