Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • C++ Reactive Programming
  • Toc
  • feedback
C++ Reactive Programming

C++ Reactive Programming

By : Praseed Pai, Abraham
3 (8)
close
C++ Reactive Programming

C++ Reactive Programming

3 (8)
By: Praseed Pai, Abraham

Overview of this book

Reactive programming is an effective way to build highly responsive applications with an easy-to-maintain code base. This book covers the essential functional reactive concepts that will help you build highly concurrent, event-driven, and asynchronous applications in a simpler and less error-prone way. C++ Reactive Programming begins with a discussion on how event processing was undertaken by different programming systems earlier. After a brisk introduction to modern C++ (C++17), you’ll be taken through language-level concurrency and the lock-free programming model to set the stage for our foray into the Functional Programming model. Following this, you’ll be introduced to RxCpp and its programming model. You’ll be able to gain deep insights into the RxCpp library, which facilitates reactive programming. You’ll learn how to deal with reactive programming using Qt/C++ (for the desktop) and C++ microservices for the Web. By the end of the book, you will be well versed with advanced reactive programming concepts in modern C++ (C++17).
Table of Contents (15 chapters)
close

What this book covers

Chapter 1, Reactive Programming Model – Overview and History, takes a look at the various event handling techniques implemented by GUI toolkits such as Windows API, XLib API, Qt, and MFC. This chapter also introduces some key data structures of the Rx programming model in the context of writing cross platform Console applications and GUI applications using the MFC library.

Chapter 2, A Tour of Modern C++ and its Key Idioms, covers the Modern C++ constructs necessary for writing reactive programs. The chapter focuses on new C++ features, type inference, variadic templates, rvalue references, move semantics, lambda functions, elementary functional programming, pipeable operators, implementation of iterators, and observers.

Chapter 3, Language-Level Concurrency and Parallelism in C++, discusses the threading library available with the C++ standard. You will learn how to launch and manage a thread. We will discuss different aspects of the threading library. This chapter lays a good foundation for concurrency support introduced in Modern C++.

Chapter 4, Asynchronous and Lock-Free Programming in C++, discusses the facilities provided by the standard library for implementing task-based parallelism. It also discusses the new multithreading-aware memory model that is available with the modern C++ language.

 Chapter 5, Introduction to Observables, talks about the GoF Observer pattern and explains its shortcomings. You will learn how to transform a program which implements the GoF Composite/Visitor pattern to Observable streams, using a technique devised by us, in the context of modelling an expression tree.

Chapter 6, Introduction to Event Stream Programming Using C++, focuses on the topic of Event Stream programming. We will also look at the Streamulus library, which provides a Domain Specific Embedded Language (DSEL) approach to the manipulation of event Streams.

Chapter 7, Introduction to Data Flow Computation and the RxCpp Library, starts with a conceptual overview of the data flow computing paradigm and moves quickly to writing some basic RxCpp-based programs. You will learn about the set of operators supported by the RxCpp library.

Chapter 8,  RxCpp – the Key Elements, gives you an understanding of how pieces of the Rx programming fit together in the context of Rx programming model in general and RxCpp library in particular. The topics covered in detail are Observables, Observer, Operators, Subscribers, Schedulers (five key elements of the Rx programming model).

Chapter 9, Reactive GUI Programming Using Qt/C++, deals with the topic of reactive GUI programming using the Qt framework. You will learn about concepts in the Qt framework, such as Qt object hierarchy, meta-object system, signals, and slots. Finally, you will write an application to handle mouse events and filter them in a reactive way using the RxCpp library.

Chapter 10, Creating Custom Operators in RxCpp, covers the advanced topic of how we can  create custom reactive operators in RxCpp, should an existing set of Operators not suffice for the purpose. We cover how to leverage Lift Meta Operator and adding Operators to the RxCpp library. This topic also helps you create Composite Operators by composing existing Operators.

Chapter 11, Design Patterns and Idioms for C++ Rx Programming, delves into the wonderful world of design patterns and idioms. Starting with GOF design patterns, we will move on to reactive programming patterns. We will cover Composite/Visitor/Iterator (from GoF catalogue), Active Object, Cell, Resource Loan, and the Event Bus Pattern.

Chapter 12Reactive Microservices Using C++, covers how the Rx programming model can be used to write reactive microservices using C++. It introduces you to the Microsoft C++ REST SDK and its programming model. You will learn how to leverage the RxCpp library to write aggregate services and access HTTP based services in a reactive manner.

Chapter 13, Advanced Streams and Handling Errors, discusses error handling in RxCpp, along with some of the advanced constructs and Operators that handle Streams in the RxCpp library. We will discuss how to continue Streams when an error comes, how to wait for the producer of the Stream to correct the error and continue the sequence, and how to perform common operations that are applicable to both success and error paths.

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete