Link Smfl Library Clion Mac

C++/CLI
ParadigmStructured, imperative, object-oriented
FamilyC
Designed byMicrosoft
DeveloperMicrosoft
First appeared2005; 15 years ago
Stable release
PlatformCommon Language Infrastructure
Websitewww.ecma-international.org/publications/standards/Ecma-372.htm
Influenced by
C++, Managed Extensions for C++, C#

C++/CLI (C++ modified for Common Language Infrastructure) is a language specification created by Microsoft which supersedes Managed Extensions for C++. It is a complete revision that simplifies the now-deprecated Managed C++ syntax[1] and provides interoperability with Microsoft .Net languages such as C#. C++/CLI was standardized by Ecma as ECMA-372. It is currently available in Visual Studio 2005, 2008, 2010, 2012, 2013, 2015, 2017 and 2019 including the Express editions.

Open Library. Grenfell Support News Newspaper Halesowen Chronicle Newspaper Wharf Newspaper Harlow Star Newspaper Stourbridge Chronicle Newspaper Kidderminster Chronicle Newspaper Mk News Newspaper. Featured movies All video latest This Just In Prelinger Archives Democracy Now! Full text of 'The Gentleman's magazine'. Refer to our WSL guide for details on setting up WSL on your system and configuring WSL toolchains in CLion. Microsoft Visual C MSVC compiler. CLion supports the Microsoft Visual C compiler that ships with Visual Studio 2013, 2015, 2017, and 2019. Note that msbuild is not supported: CLion runs CMake with the NMAKE generator instead.

C++/CLI is not mentioned in 'The .NET Language Strategy' by Mads Torgersen, posted February 1, 2017.[2]

Syntax changes[edit]

C++/CLI should be thought of as a language of its own (with a new set of keywords, for example), instead of the C++ superset-oriented Managed C++ (MC++) (whose non-standard keywords were styled like __gc or __value). Because of this, there are some major syntactic changes, especially related to the elimination of ambiguous identifiers and the addition of .NET-specific features.

Many conflicting syntaxes, such as the multiple versions of operator new() in MC++, have been split: in C++/CLI, .NET reference types are created with the new keyword gcnew (i.e. garbage collected new()). Also, C++/CLI has introduced the concept of generics from .NET (similar, for the most common purposes, to standard C++ templates, but quite different in their implementation).

Handles[edit]

In MC++, there were two different types of pointers: __nogc pointers were normal C++ pointers, while __gc pointers worked on .NET reference types. In C++/CLI, however, the only type of pointer is the normal C++ pointer, while the .NET reference types are accessed through a 'handle', with the new syntax ClassName^ (instead of ClassName*). This new construct is especially helpful when managed and standard C++ code is mixed; it clarifies which objects are under .NET automatic garbage collection and which objects the programmer must remember to explicitly destroy.

Tracking references[edit]

A tracking reference in C++/CLI is a handle of a passed-by-reference variable. It is similar in concept to using '*&' (reference to a pointer) in standard C++, and (in function declarations) corresponds to the 'ref' keyword applied to types in C#, or 'ByRef' in Visual Basic .NET. C++/CLI uses a '^%' syntax to indicate a tracking reference to a handle.

The following code shows an example of the use of tracking references. Replacing the tracking reference with a regular handle variable would leave the resulting string array with 10 uninitialized string handles, as only copies of the string handles in the array would be set, due to their being passed by value rather than by reference.

Note that this would be illegal in C#, which does not allow foreach loops to pass values by reference. Hence, a workaround would be required.

Finalizers and automatic variables[edit]

Another change in C++/CLI is the introduction of the finalizer syntax !ClassName(), a special type of nondeterministic destructor that is run as a part of the garbage collection routine. The C++ destructor syntax ~ClassName() also exists for managed objects, and better reflects the 'traditional' C++ semantics of deterministic destruction (that is, destructors that can be called by user code with delete).

In the raw .NET paradigm, the nondeterministic destruction model overrides the protected Finalize method of the root Object class, while the deterministic model is implemented through the IDisposableinterface method Dispose (which the C++/CLI compiler turns the destructor into). Objects from C# or VB.NET code that override the Dispose method can be disposed of manually in C++/CLI with delete just as .NET classes in C++/CLI can.

Operator overloading[edit]

Link Smfl Library Clion Mac

Operator overloading works analogously to standard C++. Every * becomes a ^, every & becomes an %, but the rest of the syntax is unchanged, except for an important addition: for .NET classes, operator overloading is possible not only for classes themselves, but also for references to those classes. This feature is necessary to give a ref class the semantics for operator overloading expected from .NET ref classes. (In reverse, this also means that for .NET framework ref classes, reference operator overloading often is implicitly implemented in C++/CLI.)

For example, comparing two distinct String references (String^) via the operator will give true whenever the two strings are equal. The operator overloading is static, however. Thus, casting to Object^ will remove the overloading semantics.

C++/C# Interoperability[edit]

C++/CLI allows C++ programs to consume C# programs in C# DLLs.[3] Here the #using keyword shows the compiler where the DLL is located for its compilation metadata. This simple example requires no data marshalling.

The C# source code content of MyCS.DLL.

This examples shows how strings are marshalled from C++ strings to strings callable from C# then back to C++ strings. String marshalling copies the string contents to forms usable in the different environments.

The C# code is not in any way C++-aware.

C++/C# interoperability allows C++ simplified access to the entire world of .Net features.

C++/CX[edit]

C++/CX targeting WinRT, although it produces entirely unmanaged code, borrows the ref and ^ syntax for the reference-counted components of WinRT, which are similar to COM 'objects'.[4]

References[edit]

  1. ^Managed Extensions for C++ Syntax Upgrade Checklist - MSDN Library
  2. ^'The .NET Language Strategy' by Mads Torgersen - MSFT, posted February 1, 2017
  3. ^Using C++ Interop (Implicit PInvoke)
  4. ^Inside the C++/CX Design - Visual C++ Team Blog - Site Home - MSDN Blogs

External links[edit]

  • Herb Sutter: C++/CLI keywords: Under the hood
  • Herb Sutter: C++/CLI Rationale
  • Stanley B. Lippman: Hello, C++/CLI
  • Stanley B. Lippman: Why C++/CLI Supports both Templates for CLI Types and the CLI Generic Mechanism
Retrieved from 'https://en.wikipedia.org/w/index.php?title=C%2B%2B/CLI&oldid=930633767'

Home > Articles > Apple > Operating Systems

  1. The Libraries of Mac OS X: /System/Library
< BackPage 6 of 10Next >
This chapter is from the book
Mac OS X Disaster Relief, Updated Edition

This chapter is from the book

This chapter is from the book

The Libraries of Mac OS X: /System/Library

I now take a more detailed look at the contents of each of the main Library folders in Mac OS X, starting with /System/Library. The number and variety of files and folders in any of these Library folders are far too great for me to cite even a bare majority of them. so I will limit the list to the ones that are most relevant for any troubleshooting you may have to do. Feel free to open these folders and browse around yourself, however. There is no fee for just looking.

Figure 4.8 The /System/Library folder (partial view; items A through I seen).


Core Services

Core Services is the most critical folder in the /System/Library folder. Like the System folder itself, it has an X on it to denote its special status. It contains the BootX file, required for starting up from Mac OS X (as described in Chapter 5).

The folder also contains the Dock, Finder Classic Startup, Help Viewer, and Software Update applications, as well as the loginwindow process (also covered in Chapter 5) and the Menu Extras (covered in Chapter 3). There are also fake Mac OS 9 Finder and System files, created so that Carbon applications that expect to see these Mac OS 9-type files will 'find' them. Yes, you will see the word Fake used in the Version description in the files' Show Info windows.

The SystemVersion.plist file determines what Mac OS X version is listed in the About This Mac window.

Figure 4.9 Some of the files and directories in the Core Services folder.


CFMSupport

CFMSupport contains software used for running Carbon applications. The CarbonLib file is in this folder, for example.

Extensions

This folder contains the kext (for kernel extension) files that load at startup, primarily acting as driver software for hardware peripherals (covered in Chapter 5). As their name implies, kext files are extensions of the basic kernel software that loads at startup.

Fonts

This folder is one of several Fonts folders in Mac OS X. This one contains the fonts that are considered to be essential for Mac OS X.

SEE

'Take Note: Multiple Folders of the Same Name in Multiple Library Folders,' earlier in this chapter.

Frameworks

Frameworks are an important component of Mac OS X, but you will have little reason to work with them directly in troubleshooting.

Briefly, frameworks are the Mac OS X equivalents of Mac OS 9's dynamic shared libraries, which means that they contain code that can be used by more than one application simultaneously. The basic idea is to eliminate the need to repeat code that will be used by multiple applications.

Frameworks have the structure of package files, although they appear to be ordinary folders and can be opened without the Show Package Contents contextual menu. A framework package can contain multiple versions of the shared software; applications that require the newer version can access it, and those that are incompatible with the newer version will be able to access the older version.

Frameworks can occur in other locations besides this folder. The ones in this folder are simply the ones that are most essential for the OS.

SEE

Technically Speaking:'Understanding Packages,' in Chapter 2, for more details on packages.

Preference Panes

This folder contains the panes that you access via the System Preferences application.

Printers

This folder contains files needed for printers to work with Mac OS X. Among other things, it contains the PPD and PDE files required for LaserWriter printers in Mac OS X.

SEE

Chapter 7 for more information on printing, including details on PPD and PDE files.

QuickTime

This folder contains some QuickTime-related software, such as the QuickTime Updater application.

ScreenSavers

This folder contains the basic screen-saver options (Beach, Forest, and so on), which you accessed from the Screen Saver System Preferences window.

Link

Services

This folder contains software needed for some of Mac OS X's Services feature, which allows you to access certain features of one application while you are in another application. You typically access this feature via the Services command in the menu that has the name of the active application (such as Finder, if Finder is the active application). If this feature is working, it allows you to open TextEdit with the selected text of your open application already pasted into an untitled TextEdit document, for example. This feature works only if the given applications support Services technology. Most do not, so most often, these options will be dimmed.

In the current context, Services also refers to some options that can be incorporated into any Cocoa application. As of Mac OS X 10.1, just two such Services are stored here: AppleSpell and Summary. AppleSpell, for example, allows a developer to include a spelling-checking feature in his application without having to write his own code.

Sounds

This folder contains the sound files (in AIFF format) that are listed in the Alerts tab of the Sound System Preferences window.

Note: AIFF is one of several sound formats supported by Mac OS X. Another is the well-known MP3 format, commonly used for music files stored on your drive and used by iTunes and iPod.

StartupItems

This important folder contains the various protocols that load at startup while you wait for the log-in window and Desktop to appear. These items include the Apache Web server, AppleShare, AppleTalk, Networking, and Network Time.

SEE

Chapter 5 for more information on the startup sequence.

Related Resources

  • Book $55.99
  • Book $55.99
  • Book $55.99