Perfect C++:C++/CLI.

Source: Internet
Author: User
Tags object model

What is C++/CLI? C + +, of course, refers to the C + + language invented by Bjarne Stroustrup in Bell Labs, which implements the static object model of speed and size optimization at run time, but it allows unlimited access to the underlying device, except for the dynamic modification of the program beyond the heap allocation. However, the activity type is almost impossible to manipulate during the program's operation, and the underlying structure associated with the program cannot be manipulated. Herb Sutter,c++/cli, one of the main constructors, said C + + is a "concrete" type of language.

The CLI refers to the common language structure, a multiple structure that supports the dynamic component programming model, which in many cases represents a completely inverted pattern from the C + + object model. A real-time software layer that effectively executes the system and runs between the underlying operating system and the program. The underlying device is limited, and the type of activity in the Operation execution program and the lower structure associated with the program are supported. The backslash (/) represents the binding of C + + and the CLI, and the details of this bundle are the main issues discussed in this article.

So, the first and closest answer to the "What's c++/cli" question is that it is a bundle of static C + + object models to the CLI's dynamic Component Object programming model. In short, it's how you program in. NET with C + +, not C # or Visual Basic.NET. Like C # and the CLI itself, C++/CLI is being standardized under the auspices of the ECMA (European Computer Manufacturers Association) to eventually conform to ISO standards.

The real-time universal language (CLR) is the Microsoft version of the CLI, which is very suitable for Microsoft's Windows operating system, and, similarly, Visual c++2005 is a C++/CLI implementation.

As a second approximate answer, I think C++/CLI is a combination of. NET programming patterns and C + +, just as generics are created by combining templates with C + +. In all this combination, the investment of C + + and the experience of developers using C + + will be preserved, which is the important basis for the development using C++/CLI.

Reading navigation

   ways to learn C++/CLI
There are three aspects involved in designing C++/CLI language. This also applies to all other program development languages: One is the mapping of language-level syntax to the underlying generic type system (CTS), and the second is the level selection of the underlying detail structure of the CLI provided to the program developer; The third is direct support beyond the CLI, Provides options for additional functional functions.

   mapping from C++/CLI to CTS?
It is important to understand the underlying CTS using C++/CLI programming time. The CTS includes the following three types of common classes:

1, polymorphic reference type, which is exactly what is used for all inheriting classes.

2, non-polymorphic value types, which are used for real-time and efficient specific types, such as numeric types.

3, the abstract interface type, which is used to define an action set, can also be used to implement the interface of a reference or a collection of value types.

   details of the CLI
The second issue that must be considered when designing a CLI language is the integration of the underlying execution pattern of the CLI into the level of detail of the language. What problem is this language used to solve? Does the language have the necessary tools to solve these problems? What kind of program developers can this language attract?

   the problems that exist
In the garbage collector scan crunch state, any object located on the managed heap is likely to face relocation issues. Pointers to objects can be tracked and modified in real time. Developers cannot manually track themselves, so if you are allowed to obtain an address for a value type that may be on the managed heap, you need a pointer to the trace shape in addition to the local pointer.

   additional features are added
In the garbage collector scan crunch state, any object located on the managed heap is likely to face relocation issues. Pointers to objects can be tracked and modified in real time. Developers cannot manually track themselves, so if you are allowed to obtain an address for a value type that may be on the managed heap, you need a pointer to the trace shape in addition to the local pointer.

Summary

C++/CLI represents the combination of hosting and local programming, which has been accomplished through a relatively independent but equally interdependent component and binary element, including mixed mode (a meta-level blend of local and CTS types, and a binary blend of local and CLI object files). Native mode (source-level blending of local and CTS types, all compiled into CLI object files), local classification (which can maintain the CTS type through a specific packaging class), and the CTS classification (you can keep the local type as a pointer).

Of course, C++/CLI developers can also programmatically use CLI types to provide verifiable code in a servo state, such as an SQL stored procedure that can be used as SQL Server2005.

Now, return to this question, what is C++/CLI? It was carried on. The best entry point for the net programming pattern. For C++/CLI, there is a migration path from C + +, which not only contains the underlying base of C + +, but also requires C + + programming experience, I am very satisfied with these.

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.