Specifications of the C++ Infrastructure
Uploaded by pandalover1000 on wallpapercave.com

Specifications of the C++ Infrastructure

Bjarne Stroustrup, a Danish computer scientist, developed the high-level general-purpose programming language C++ (originally named "C with Classes") in 1983. In the summer of 1983, Rick Mascitti came up with the term C++ which Bjarne Stroustrup eventually decided to use instead of "C with Classes". Since '++' is the C increment operator, the term refers to the evolutionary nature of the modifications. C++ was created to provide the efficiency and adaptability of C for systems development along with Simula's program organization features (usually referred to as object-oriented programming).

The modest details that contribute to its success include its user-friendly syntax and implementation, faster performance than other programming languages, efficient memory management, and algorithmic advancements have kept this language effective for the past 35 years. But the major specifications of C++ which are its base are encapsulation and abstraction, class concept, memory model and the architecture of hardware.

1.?????Encapsulation and Abstraction

If an object combines a collection of operations and a set of data into a single entity, it is said to be encapsulated. Encapsulation thus provides objects with the data and operations necessary to carry out the desired tasks. By combining operations with data, the programmer is able to hide implementation details and create a solution in terms of high level abstractions. By obscuring the implementation details from publicly accessible operations and functions, encapsulation enforces the abstraction barrier. Encapsulation is implemented in certain ways in C++ classes by strict access controls in the format of the reserved words private and protect. The private and protected components of the class are inaccessible to user code.

Data abstraction, the separation of the properties of a data type from its implementation, depends heavily on encapsulation. In object-oriented programming languages, data abstraction and encapsulation are provided by the class mechanism. The class, a program representation of an abstract data type (ADT), encapsulates both structure (the concrete data representation of the abstract data) and behavior (algorithms that implement operations on the abstract data). C++'s abstraction mechanisms were created especially to be used with programming tasks that demand the highest levels of flexibility and efficiency. ?

2.?????Class Concept

The class concept is the foundation of object-oriented programming. Data and functions belonging to classes are typically divided into "public" and "private" parts. The public properties can be evaluated when the object is made from the outside. Private properties are data that is kept completely confidential within the object and is only accessible by the functions of the object. In some ways, the private and protected reserved words in C++ classes act as strict access controls to ensure that encapsulation is maintained. Client code cannot access any of the class's private and protected components. One of the most important aspect of classes is inheritance. The "iostream" is one of the concrete examples of inheritance, specifically one of the kinds of inheritance; multiple inheritance. The iostream classes, which AT&T provides as the default I/O interface, are without a doubt the most widely used multiple inheritance C++ classes. Because it can be customized to manage "I/O" to in-core buffers and communication with other processes in addition to the normal files and devices, the iostream library is an example of reusable code.

3.?????Memory Model

A memory model explains how threads behave with regard to fundamental memory operations, primarily reads and writes of variables that could be shared by multiple threads. In this article, I am going to illustrate the three components of C++ memory model:

  • Garbage Collector

Memory allocation in the majority of computer languages is either completely the responsibility of the programmer or completely under the control of a garbage collector. The job of the garbage collector is to locate data objects that are no longer in use and free up their space for the software to use. Programmers are relieved of the responsibility of managing memory by automatic garbage collection, and a number of methods have been developed to make garbage collection practical in a variety of contexts, such as real-time applications or within general-purpose programming languages. The general assumption of full control over memory management by a garbage collector can sometimes?be problematic.

  • CMM

In addition to the garbage collector, the C++ memory management framework is useful. Multiple stacks of memory are organized in the Customizable Memory Manager (CMM). Without any specialized assistance from the language or compiler, the CMM is implemented in C++. The CMM's performance is examined and contrasted with that of other cautious collectors for C/C++?in a variety of combinations. Multiple policies can coexist in CMM. Users can implement their own specialized memory management or select from a few pre-built variants that range from manual management to completely automatic garbage collection. Utilizing C++'s object-oriented paradigm, the framework's extensibility is achieved while still keeping a straightforward and consistent user interface for programmers.?

  • Multithreading

The central part of the C++ memory model, aside from the garbage collectors and frameworks is multithreading. Contrary to Ada, C++ does not come with built-in concurrency functionality. As long as it's feasible to generate and respond to timer interrupts, and also save and restore the register state for the current process, it is possible to define classes in C++ that provide the necessary abstractions. These classes can either use a thread mechanism provided by the underlying operating system or can provide thread support "by hand" without resorting to operating system facilities. Dos Thread is an abstract base class from which application-specific thread classes are built. These thread class entities will all run simultaneously. For multithreaded applications, MS-DOS is especially hostile because it does not support reentrant programming.

Because it is object-oriented, C++ is an exceptionally effective language for creating libraries. The non-application-specific multithreading support methods can be provided by a base class. The behavior of the base class will be automatically inherited by the derived classes, which only need to specify the extra, application-specific behavior needed. The base class can provide a set of thread management functions that are accessible for use by any derived class, and it can practically complete all the required housekeeping automatically whenever instances of classes derived from it are created or destroyed. The DOSThread basic class, which is defined by the multithreading library, offers all of a thread's fundamental capabilities. It declares the main function as a pure virtual function that a derived class must specify in order to provide the function that will be used by a specific thread.

4.?????Hardware Model

It has been proven that high level programming using C/C++ models is effective for exploring and verifying architecture, and the implementability of these models evolves as their efficiency incentives are shown to engineers and managers. Although complexity of C++ model is widely known, it can be difficult to abstract from and predict in a behavioral specification, which makes it difficult to create floorplans and layouts.

Following are some specifications of good hardware model.

Desirable Semantics The following semantics should be present in a decent hardware design language: reactivity, concurrency, composability, and binary data types.

Structural Layout Structure involves the connectedness of components, the orientation and how they are connected. In a high level design language, a designer must describe several types of structure:

  • what components nest inside others; parent-child relationships
  • how sub-components are juxtaposed ; sibling relationships e.g., the incidence structure in terms of north, south, east, west what ports are attached to the component
  • where on the component those ports are attached?

Working on C++ reveals its hardware desirable semantic and structural layout.

Conclusion

In the preceding paragraphs, four fundamental structural components of C++ are mentioned that distinguish it from other computer languages and contribute to its extensive use. By going through the whole discussion, it is illustrated that these four elements, in addition to other C++ features like polymorphism, objects, arrays, pointers, etc., are all highly integrated. We can say where there is a C++ class, there is encapsulation, abstraction, inheritance, memory management, hardware management, and thus almost whole C++. This is the beauty and strength of C++: all the concepts are intricately intertwined, enabling users and hardware to solve complex issues quickly and effectively while also ensuring user satisfaction and memory management.


I hope you find this article useful. Thank you for taking the time to read my article.

要查看或添加评论,请登录

Rabia Naz的更多文章

  • The Role of Visual Hierarchy in User Experience

    The Role of Visual Hierarchy in User Experience

    When you visit a website or use an app, certain parts grab your attention first. This isn't by accident.

    4 条评论
  • User Research Methods

    User Research Methods

    In UX design, understanding users is primary goal. It is crucial to understand what users need and want from the…

  • Empathy in UX Design

    Empathy in UX Design

    Have you ever found yourself checking an app or website and feeling as if it just "gets" you? Consider your favorite…

  • Microinteractions in UX Design

    Microinteractions in UX Design

    Imagine you are using a navigation app and as you approach a turn, the arrow indicating the direction smoothly…

  • UX Design Principles in E-Learning

    UX Design Principles in E-Learning

    UX design has become a key influencing factor in unlocking the true potential of e-learning. The combination of useful…

  • Color Psychology in UX Design

    Color Psychology in UX Design

    In UX design, color choices hold a remarkable power. They can influence emotions, shape perceptions and guide user…

  • Difference Between UI and UX

    Difference Between UI and UX

    In today's digital age, where online experiences influence our daily lives, understanding the fundamental difference…

  • Google UX Design Professional Certificate Experience

    Google UX Design Professional Certificate Experience

    It's been a month since I completed the Google UX Design Professional Certificate from Coursera. It was beautiful…

    2 条评论
  • Contribution of Designers and Developers in Today's Applications

    Contribution of Designers and Developers in Today's Applications

    Do you know people spend an average of 4-5 hours everyday on their mobile phones? They spend their time on several…

  • E-Learning: An Evolution in Learning

    E-Learning: An Evolution in Learning

    Learning is an important aspect of human life. Everything we adopt, from being a child to growing older, comes from…

社区洞察

其他会员也浏览了