Differences between STL, ATL, and wtl

Source: Internet
Author: User
Tags microsoft website
STL (standard template library STL) is a general term for a series of software developed by the HP lab. It was developed by Alexander Stepanov, Meng Lee, and David R musser while working at the HP lab. Although it mainly appears in C ++, this technology has existed for a long time before it was introduced into C ++. STL code is broadly divided into three types: algorithm (algorithm), container (container), and iterator (iterator ), almost all code uses the template class and template function, which provides a better chance of code reuse than the traditional library composed of functions and classes. In the C ++ standard, STL is organized into the following 13 header files: <algorithm>, <deque>, <functional>, <iterator>, <vector>, <list>, <map>, <me Mory>, <numeric>, <queue>, <set>, <stack>, and <utility>. The following describes the main features of each part of st l. Basically, STL is a set of "containers", which include list, vector, set, map, and so on. STL is also a set of algorithms and other components. The collection of containers and algorithms here refers to the masterpiece of many smart people in the world for many years. The purpose of STL is to standardize components so that you do not need to re-develop them. You can only use these ready-made components. STL is now part of C ++, so no additional installation is required. It is built into your compiler. Because STL list is a simple container, I plan to introduce how to use STL from it. If you understand this concept, there will be no other problems. In addition, the list container is quite simple and we will see this. STL containers can save objects, built-in objects, and class objects. They securely Save the object and define the interface of the object that we can operate on. The eggs on the egg won't roll to the table. They are safe. Therefore, objects in STL containers are safe. I know this metaphor sounds very old, but it is correct. STL algorithms are standard algorithms. We can apply them to objects in those containers. These algorithms have well-known execution features. They can sort, delete, count, and compare objects, find special objects, merge them into another container, and perform other useful operations. STL iterator is like a pointer to an object in a container. STL algorithms use iterator to operate on containers. Iterator sets the boundary of the algorithm, the length of the container, and other things. For example, some iterator only allows the algorithm to read elements, some allow the algorithm to write elements, and some allow both. Iterator also determines the processing direction in the container. You can call the container member function begin () to obtain an iterator pointing to the starting position of a container. You can call the end () function of a container to obtain the last value of the past (that is, the value of the stopped value ). This is all about STL, containers, algorithms, and iterator that allows algorithms to work on elements in containers. The algorithm operates the object in an appropriate and standard method, and the precise length of the container can be obtained through iterator. Once this is done, they will not "run out of the boundary ". There are also some other components with enhanced functionality for these core component types, such as function objects. ATL: Let's take a look at Pan aimin's book reviews on ATL internals: ATL It is a framework for generating C ++/COM code, just as the C language is a framework for generating assembly code. ATL is different from MFC, and it is completely oriented to com components, the technical route is different from that of MFC. MFC uses the inheritance, encapsulation, nesting, and other conventional technologies in C ++, however, ATL uses C ++ templates, multi-inheritance and other advanced technologies, and even uses STL.Therefore, learning and using ATL requires us to be familiar with these C ++ advanced features. On the other hand, the ATL Structure fully targets many standards in COM, which requires that the user must have a good understanding of the COM norms before they can really use ATL for the development of COM applications, ATL is undoubtedly the preferred tool. Compared with MFC, the size of ATL is not large, but we can see from the above introduction that ATL involves all aspects of COM. In fact, the content of ATL is much more, such as ole db support and MTS support. However, if we have the content in this book as the basis, then it will be much easier to learn about these extensions. We can easily master these development technologies by combining the basic methods of implementing COM in ATL with the background knowledge of these application technologies. However, if we want to be familiar with or even master ATL, this is just the beginning, and there is still a long way to go. There are many reasons for this. One is that com itself is very complex, so it is difficult to get a full view of it. The other is that ATL does have a lot of details, and it reflects the profound and profound C ++ syntax; 3. There are still many errors in ATL. Although the author points out some errors, there must be more actual errors, which puts forward higher requirements for ATL users, if these errors cannot be found or avoided during use, using ATL will hinder our work. Although ATL is more profound, the explanation in this book is very easy to understand, the language is concise, and the organization is very clear. Even after reading this book, it can still serve as a reference book to guide our development and learning work. I think this is the value of a good book. Wtl introduction when ATL appeared, some com programmers began to think that developing com application is a pleasure, because it is very convenient to develop small-scale COM components, but it is not a long time, the reality of the COM components is quite extensive, especially when they are ready to use wrap my window controls, it is found that ATL provides quite a few. Therefore, Microsoft has launched a semi-finished product and a wtl without technical support, which is why wtl was born. Many of the first wtl contacts asked "What are the three letters of wtl ?": Wtl is called Windows template library. It is structured on the ATL and uses the C ++ template technology to encapsulate most window controls and provides an application framework similar to MFC. They followed and asked, "How can I get it ?": Since wtl was launched by Microsoft, wtl is an extension of ATL in Microsoft's platform SDK and also developed by the ATL team, included in the Development Platform SDK Package released by Microsoft in January 2000 (which can also be downloaded from the Microsoft website), though not officially supported by Microsoft. Wtl provides a lightweight framework for compiling and controlling Win32 applications, some special views, GDI objects, and practical classes, extends the wtl design features of the ATL window class-the incidental advantages over the MFC-including templated, so there is a small amount of code. For example, for a simple "Hello World" SDI application, the wtl-based program only has 24 KB, while the MFC static connection result is kb, And the MFC dynamic connection result is 24 KB + 1 MB. There is not much relevance, and it can be freely mixed with SDK code. It does not force the use of a specific application model, especially relative to the application framework of MFC. Wtl categories include: Standard Control (edit box, list box, button, etc.) public control (including list view, tree view, progress bar, fine-tune button) IE control (rebar, plane scroll bar, calendar, etc.) command bar, menu, and update UI-class public dialog box properties sheet and page-class frame window, MDI frame and sub-frame, separation bar, And scrollable window device environment (DC) and GDI object (pen, brush, bitmap, etc.) printers and their information and device mode utilities: including cpoint, crect, csize, and cstring wtl Appwizard allows you to generate SDI, MDI, multi-thread SDI and dialog box-based applications. Multi-threaded SDI applications, like IE or Windows Explorer (my computer), seem to have started multiple instances, essentially multiple views of the same process. These views can be common csf-wimpl-based windows, or control based on forms, lists, edit boxes, list views, tree views, rich text edit boxes, or HTML. You can give your application rebar, command bar (like Windows CE), tool bar, or status bar. Your application can contain ActiveX control or even a COM server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.