Muutke küpsiste eelistusi

E-raamat: C++ Software Interoperability for Windows Programmers: Connecting to C#, R, and Python Clients

  • Formaat: EPUB+DRM
  • Ilmumisaeg: 28-Jan-2022
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484279663
Teised raamatud teemal:
  • Formaat - EPUB+DRM
  • Hind: 67,91 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: EPUB+DRM
  • Ilmumisaeg: 28-Jan-2022
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484279663
Teised raamatud teemal:

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Get up-to-speed quickly and connect modern code written in C#, R, and Python to an existing codebase written in C++. This book for practitioners is about software interoperability in a Windows environment from C++ to languages such as C#, R, and Python. Using a series of example projects, the book demonstrates how to connect a simple C++ codebase packaged as a static or dynamic library to modern clients written in C#, R, and Python. The book shows you how to develop the in-between components that allow disparate languages to communicate. 


This book addresses a fundamental question in software design: given an existing C++ codebase, how does one go about connecting that codebase to clients written in C#, R, and Python? How is the C++ functionality exposed to these clients? One answer may be to rewrite the existing codebase in the target language. This is rarely, if ever, feasible and this book’s goal is to save you the pain and the high cost of throwing out valuable existing code by showing you how to make that older code function alongside and with the more modern languages that are commonly in use today. The knowledge you will gain from reading this book will help you broaden your architectural choices and take advantage of the growing amount of talent around newer languages.


What You Will Learn
  • Build components that connect C++ to other languages
  • Translate between the C++ type system and the type systems of C#, R, and Python
  • Write a managed assembly targeting the .NET framework
  • Create C++ packages for use in R/Studio
  • Develop Python modules based on high-performance C++ code
  • Overcome the difficulties and pitfalls involved in cross-language development

Who This Book Is For

Software developers who are looking for ways to extend existing systems written in C++ using modern languages. Readers should have some programming experience, particularly in C++. Readers should also be familiar with common development tools such as Visual Studio, R/Studio, Visual Studio Code, and CodeBlocks. 



Intermediate user level
About the Author ix
About the Technical Reviewer xi
Acknowledgments xiii
Introduction xv
Part I: Foundations 1(38)
Chapter 1 Preliminaries
3(8)
Introduction
3(1)
Prerequisites
3(1)
How to Use This Book
4(1)
The Software Interoperability Project
5(5)
The Projects
7(1)
Terminology
8(1)
How the Projects Fit Together
9(1)
Summary
10(1)
Chapter 2 C++ Components and C++ Clients
11(28)
Introduction
11(1)
A Tour of the Source Code
11(12)
Descriptive Statistics
12(5)
Linear Regression
17(1)
The Data Manager
18(1)
Statistical Tests
18(5)
Functions, Classes, and Type Conversion
23(1)
C++ Components
23(7)
StatsLib
23(5)
StatsDII
28(2)
C++ Clients
30(4)
Introduction
30(1)
StatsConsole
31(1)
StatsViewer
31(3)
Summary
34(1)
Additional Resources
35(1)
Exercises
35(4)
Part II: C++/CLI and .NET 39(50)
Chapter 3 Building a C++/CLI Wrapper
41(26)
Introduction
41(1)
Prerequisites
42(1)
C++/CLI support
42(1)
StatsCLR
43(11)
Project Settings
43(2)
Code Organization
45(1)
The Statistics Class
46(3)
Type Conversion
49(4)
Exception Handling
53(1)
Testing the Code
54(1)
StatsCLR.UnitTests
54(1)
Managed Wrapper Classes
55(7)
Introduction
55(1)
The DataManager
56(3)
The TTest Class
59(3)
Summary
62(2)
Additional Resources
63(1)
Exercises
64(3)
Chapter 4 C# Clients: Consuming the Managed Wrapper
67(22)
Introduction
67(1)
StatsClient
68(10)
Project Settings
68(1)
Installing Accord.NET
68(1)
Code Organization
68(5)
Using Reflection
73(5)
StatsExcel
78(7)
Installing Excel-DNA
78(1)
Project Settings
79(1)
Exposing Functions to Excel
79(2)
Type Conversion
81(1)
Build and Run
82(1)
Exception Handling
83(2)
Debugging
85(1)
Summary
85(1)
Additional Resources
85(1)
Exercises
86(3)
Part III: R and Rcpp 89(56)
Chapter 5 Building an R Package
91(22)
Introduction
91(1)
Prerequisites
92(1)
Rtools
92(1)
Installing CodeBlocks
92(1)
CodeBlocks
93(6)
Toolchain Setup
93(3)
Project Setup
96(3)
R/RStudio Packages
99(11)
Background
99(2)
Building a Package with Rcpp
101(9)
Summary
110(1)
Additional Resources
111(1)
Exercises
111(2)
Chapter 6 Exposing Functions Using Rcpp
113(32)
Introduction
113(1)
The Conversion Layer
113(1)
Code Organization
114(15)
Descriptive Statistics
114(6)
Linear Regression
120(5)
Statistical Tests
125(4)
Testing
129(2)
Measuring Performance
131(3)
Debugging
134(1)
Distribution Explorer
135(2)
Summary
137(1)
Additional Resources
138(1)
Exercises
138(7)
Part IV: Python 145(68)
Chapter 7 Building a Python Extension Module
147(26)
Introduction
147(1)
Prerequisites
148(1)
Using Visual Studio Community Edition 2019
148(1)
StatsPythonRaw
149(15)
Project Settings
149(1)
Code Organization
150(1)
Functions
150(6)
The Conversion Layer
156(4)
Error Handling
160(2)
The Module Definition
162(2)
Python Client
164(3)
Debugging
166(1)
Summary
167(1)
Additional Resources
167(1)
Exercises
168(5)
Chapter 8 Module Development with Boost.Python and PyBind
173(38)
Introduction
173(1)
Boost.Python
173(13)
Prerequisites
174(1)
Project Settings
174(2)
Code Organization
176(3)
The Conversion Layer
179(1)
The Module Definition
180(4)
Exception Handling
184(2)
PyBind
186(8)
Prerequisites
186(1)
Project Settings
186(1)
Code Organization: module.cpp
187(7)
Exception Handling
194(1)
The Python "Client"
194(8)
Performance
195(4)
The Statistics Service
199(3)
Summary
202(1)
Additional Resources
202(1)
Exercises
203(8)
Chapter 9 Conclusion
211(2)
Appendix A: Boost Libraries 213(2)
Introduction
213(1)
Installation
213(1)
Building
214(1)
References
214(1)
Appendix B: CMAKE 215(4)
Introduction
215(1)
Project Setup
215(2)
Building the Outputs
217(2)
References 219(2)
Index 221
Adam Gladstone is a software developer with more than 20 years of experience in investment banking, building software mostly in C++ and C#. For the last few years, he has been developing data science and machine learning skills, particularly in Python and R after completing a degree in Math & Statistics. He currently works at Virtu Financial Inc. in Madrid as an Analyst Programmer. In his free time, he develops tools for natural language processing.