SlideShare a Scribd company logo
Let’s Take A Look At The
Boost Libraries
Seoul System Programmers Network #6
@TomSmartBishop Thomas Pollak
Setup Boost (currently v1.61)
 Download and unzip (http://www.boost.org/users/download/)
 Run bootstrap(.bat|.sh)
 Run b2 to generate the libs for your toolchain
 Without parameters b2 will try to auto-detect your toolchain
 In case you would like to build for another platform or b2 has troubles use --help to
see all options
 Libs will be in the sub directory stage/lib, you can move/install everything to the
default locations with b2 install
Let’s look at the samples
 You can find the source code here:
https://github.com/TomSmartBishop/sspn_06_lets_boost
 I picked 7 boost libraries that I found interesting and used some more as little helpers,
but there is much more: http://www.boost.org/users/history/version_1_61_0.html
 Most libraries are header only and make heavy use of templates (and macros). Samples
that need library linkage are pointed out on the slides.
 Be aware that there s a compile time overhead, also for small samples.
 Due to the fact that most boost libraries have different authors the API seems not always
homogenous (however there are core components used across all libs).
 Sometimes the API feels sometimes a bit over-engineered but does work as expected
(compared to the STL lib).
 In VS2015 /Wall produces a lot warnings so that /W4 seems like a better choice.
Boost Program Options
http://www.boost.org/doc/libs/1_61_0/doc/html/program_options.html
 In case you are writing a program with command line parameters this is quite useful.
No need to re-implement boring stuff again and again. The github sample uses the
program options also to switch between the other sample implementations.
 Needs to be linked against the program_options library.
po::options_description desc("Allowed options");
desc.add_options()
("help", "produce help message")
("compression", po::value<int>(), "set compression level");
po::variables_map vm;
po::store(po::parse_command_line(ac, av, desc), vm);
po::notify(vm);
if (vm.count("help"))
cout << desc << "n";
else if (vm.count("compression"))
cout << "Compression level was set to " << vm["compression"].as<int>() << ".n";
else
cout << "Compression level was not set.n";
Boost Any
http://www.boost.org/doc/libs/1_61_0/doc/html/any.html
 This behaves more or less what we know from Java and C# as “object”. It uses a
template class to store the exact type you using. Therefore no implicit conversions,
if you assign 5, the type will be an int and if you assign 5.0 it will be a double.
Boost Any is really handy and interestingly has been described in a paper back in
the year 2000, however it’s not part of the STL (would be nice though).
std::vector<boost::any> values;
values.push_back(std::string("Hello"));
values.push_back("World");
values.push_back(42);
values.push_back(3.14f);
Boost Variant
http://www.boost.org/doc/libs/1_61_0/doc/html/variant.html
 Similar to Any, but Variant accepts only the predefined types. So it looks more like
a union, but without the drawback of a union.
Drawbacks of a union?
 You can access a union at any time with any variation, eg. access the a float’s data as an
int and this behavior is not defined in the standard. The standard only specified
subsequent access of the same variant. Interestingly this is supported by most compilers
(at least MSVC, clang, GCC) and is actually used in real world applications to access the
bit representation of floating point number (or similar).
 Only POD types allowed, but boost Variant also allows non PODs so we can create a
variant like this: boost::variant< int, std::string > var("hello world");
Boost Lexical Cast
http://www.boost.org/doc/libs/1_61_0/doc/html/boost_lexical_cast.html
 Convenient type conversion, no more need for atoi or sprintf to convert from
int to string or the other way around.
 Supports all fundamental C++ types and much more convenient compared to
std::strtol and similar: int32_t i = lexical_cast<int32_t>("42");
 Heap allocation can be avoided if desired (when converting to string).
Boost Signals2
http://www.boost.org/doc/libs/1_61_0/doc/html/signals2.html
 Callbacks with multiple targets. Comparable with event listeners in Java (without
interfaces).
 The callback receivers are called “slots” which are invoked by the “signal”.
struct HelloWorld
{
void operator()() const { cout << "Hello, World!n"; }
};
// Signal with no arguments and a void return value
boost::signals2::signal<void ()> sig;
// Connect a HelloWorld slot
HelloWorld hello;
sig.connect(hello);
// Call all of the slots
sig();
Boost Serialization
http://www.boost.org/doc/libs/1_61_0/libs/serialization/doc/index.html
 Easy serialization, even though I cannot speak of a large scale experience, the interface
looks good and I couldn’t spot any obvious pitfalls.
 Can handle STL containers and as far as I could see also other boost classes like
boost::greogorian::date.
 Can restore pointers (serializes the content, not the pointer).
 Needs to be linked against the serialization library
(as well as the chrono/date_time library).
 Uses RTTI by default, but also can be used without RTTI (with some typing overhead).
Boost Compute
http://www.boost.org/doc/libs/1_61_0/libs/compute/doc/html/index.html
 Compute is one of the latest additions to boost. In my small samples I also got
two warning during “normal” API usage, which I could fix by myself by doing some
explicit type casts in the library’s header, so it looks like it needs still some time to
really get stable.
 However the concept is quite interesting: You can use your GPU to perform
computations and the API let’s you do that in a very convenient way without
worrying about the underlying hardware or compute shaders.
 I didn’t perform any tests how much that can speedup operations, so I still need
some more time to play around and explore…

More Related Content

What's hot

Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
Mohammed Farrag
 
Shell Script Linux
Shell Script LinuxShell Script Linux
Shell Script Linux
Wellington Oliveira
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
NETWAYS
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
Puppet
 
LibreSSL
LibreSSLLibreSSL
LibreSSL
Giovanni Bechis
 
Operating System Assignment Help
Operating System Assignment HelpOperating System Assignment Help
Operating System Assignment Help
Programming Homework Help
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
Soshi Nemoto
 
Angular 1.6 typescript application
Angular 1.6 typescript applicationAngular 1.6 typescript application
Angular 1.6 typescript application
Yitzchak Meirovich
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
Bastian Feder
 
Linux multiplexing
Linux multiplexingLinux multiplexing
Linux multiplexing
Mark Veltzer
 
Shell script-sec
Shell script-secShell script-sec
Shell script-sec
SRIKANTH ANDE
 
Shellprogramming
ShellprogrammingShellprogramming
Shellprogramming
Andrew Vandever
 
Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
julien pauli
 
unix-OS-Lab-4.doc
unix-OS-Lab-4.docunix-OS-Lab-4.doc
unix-OS-Lab-4.doc
ismailaboshatra
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
Michele Orselli
 
Runtime surgery
Runtime surgeryRuntime surgery
Runtime surgery
tobias_jenkner
 
BitTorrent on iOS
BitTorrent on iOSBitTorrent on iOS
BitTorrent on iOS
CocoaHeads France
 
Documentation with sphinx @ PyHug
Documentation with sphinx @ PyHugDocumentation with sphinx @ PyHug
Documentation with sphinx @ PyHug
Jimmy Lai
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
Puppet
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atd
Acácio Oliveira
 

What's hot (20)

Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
 
Shell Script Linux
Shell Script LinuxShell Script Linux
Shell Script Linux
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
 
LibreSSL
LibreSSLLibreSSL
LibreSSL
 
Operating System Assignment Help
Operating System Assignment HelpOperating System Assignment Help
Operating System Assignment Help
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
 
Angular 1.6 typescript application
Angular 1.6 typescript applicationAngular 1.6 typescript application
Angular 1.6 typescript application
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
 
Linux multiplexing
Linux multiplexingLinux multiplexing
Linux multiplexing
 
Shell script-sec
Shell script-secShell script-sec
Shell script-sec
 
Shellprogramming
ShellprogrammingShellprogramming
Shellprogramming
 
Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
 
unix-OS-Lab-4.doc
unix-OS-Lab-4.docunix-OS-Lab-4.doc
unix-OS-Lab-4.doc
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Runtime surgery
Runtime surgeryRuntime surgery
Runtime surgery
 
BitTorrent on iOS
BitTorrent on iOSBitTorrent on iOS
BitTorrent on iOS
 
Documentation with sphinx @ PyHug
Documentation with sphinx @ PyHugDocumentation with sphinx @ PyHug
Documentation with sphinx @ PyHug
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atd
 

Viewers also liked

Дмитрий Копляров , Потокобезопасные сигналы в C++
Дмитрий Копляров , Потокобезопасные сигналы в C++Дмитрий Копляров , Потокобезопасные сигналы в C++
Дмитрий Копляров , Потокобезопасные сигналы в C++
Sergey Platonov
 
Руслан Муллахметов, Открытый и неинтрузивный менеджер зависимостей для С++
Руслан Муллахметов, Открытый и неинтрузивный менеджер зависимостей для С++Руслан Муллахметов, Открытый и неинтрузивный менеджер зависимостей для С++
Руслан Муллахметов, Открытый и неинтрузивный менеджер зависимостей для С++
Sergey Platonov
 
Илья Шишков, Принципы создания тестируемого кода
Илья Шишков, Принципы создания тестируемого кодаИлья Шишков, Принципы создания тестируемого кода
Илья Шишков, Принципы создания тестируемого кода
Sergey Platonov
 
XPath for web scraping
XPath for web scrapingXPath for web scraping
XPath for web scraping
Scrapinghub
 
Фитнес для вашего кода: как держать его в форме
Фитнес для вашего кода: как держать его в формеФитнес для вашего кода: как держать его в форме
Фитнес для вашего кода: как держать его в форме
Ilia Shishkov
 
Search Presentation
Search  PresentationSearch  Presentation
Search Presentation
Doug Green
 
3689[1].pdf
3689[1].pdf3689[1].pdf

Viewers also liked (8)

Дмитрий Копляров , Потокобезопасные сигналы в C++
Дмитрий Копляров , Потокобезопасные сигналы в C++Дмитрий Копляров , Потокобезопасные сигналы в C++
Дмитрий Копляров , Потокобезопасные сигналы в C++
 
Boost C++ Libraries
Boost C++ LibrariesBoost C++ Libraries
Boost C++ Libraries
 
Руслан Муллахметов, Открытый и неинтрузивный менеджер зависимостей для С++
Руслан Муллахметов, Открытый и неинтрузивный менеджер зависимостей для С++Руслан Муллахметов, Открытый и неинтрузивный менеджер зависимостей для С++
Руслан Муллахметов, Открытый и неинтрузивный менеджер зависимостей для С++
 
Илья Шишков, Принципы создания тестируемого кода
Илья Шишков, Принципы создания тестируемого кодаИлья Шишков, Принципы создания тестируемого кода
Илья Шишков, Принципы создания тестируемого кода
 
XPath for web scraping
XPath for web scrapingXPath for web scraping
XPath for web scraping
 
Фитнес для вашего кода: как держать его в форме
Фитнес для вашего кода: как держать его в формеФитнес для вашего кода: как держать его в форме
Фитнес для вашего кода: как держать его в форме
 
Search Presentation
Search  PresentationSearch  Presentation
Search Presentation
 
3689[1].pdf
3689[1].pdf3689[1].pdf
3689[1].pdf
 

Similar to Let's Take A Look At The Boost Libraries

Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
guestd9065
 
C Under Linux
C Under LinuxC Under Linux
C Under Linux
mohan43u
 
Rasperry pi Part 8
Rasperry pi Part 8Rasperry pi Part 8
Rasperry pi Part 8
Techvilla
 
Readme
ReadmeReadme
Readme
rec2006
 
Book
BookBook
Book
luis_lmro
 
Mach-O Internals
Mach-O InternalsMach-O Internals
Mach-O Internals
Anthony Shoumikhin
 
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)
Advanced Rational Robot   A Tribute (http://www.geektester.blogspot.com)Advanced Rational Robot   A Tribute (http://www.geektester.blogspot.com)
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)
raj.kamal13
 
A Life of breakpoint
A Life of breakpointA Life of breakpoint
A Life of breakpoint
Hajime Morrita
 
BACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxBACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docx
wilcockiris
 
C++ development within OOo
C++ development within OOoC++ development within OOo
C++ development within OOo
Alexandro Colorado
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
Richard Lister
 
mblock_extension_guide.pdf
mblock_extension_guide.pdfmblock_extension_guide.pdf
mblock_extension_guide.pdf
DogoMaker
 
Advanced debugging  techniques in different environments
Advanced debugging  techniques in different environmentsAdvanced debugging  techniques in different environments
Advanced debugging  techniques in different environments
Andrii Soldatenko
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipse
Mike Slinn
 
GWT 2 Is Smarter Than You
GWT 2 Is Smarter Than YouGWT 2 Is Smarter Than You
GWT 2 Is Smarter Than You
Robert Cooper
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
Apaichon Punopas
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
Roman Podoliaka
 
C++ Boot Camp Part 2
C++ Boot Camp Part 2C++ Boot Camp Part 2
C++ Boot Camp Part 2
Jesse Talavera-Greenberg
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
William Lee
 
ARM Embeded_Firmware.pdf
ARM Embeded_Firmware.pdfARM Embeded_Firmware.pdf
ARM Embeded_Firmware.pdf
hakilic1
 

Similar to Let's Take A Look At The Boost Libraries (20)

Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
 
C Under Linux
C Under LinuxC Under Linux
C Under Linux
 
Rasperry pi Part 8
Rasperry pi Part 8Rasperry pi Part 8
Rasperry pi Part 8
 
Readme
ReadmeReadme
Readme
 
Book
BookBook
Book
 
Mach-O Internals
Mach-O InternalsMach-O Internals
Mach-O Internals
 
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)
Advanced Rational Robot   A Tribute (http://www.geektester.blogspot.com)Advanced Rational Robot   A Tribute (http://www.geektester.blogspot.com)
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)
 
A Life of breakpoint
A Life of breakpointA Life of breakpoint
A Life of breakpoint
 
BACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxBACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docx
 
C++ development within OOo
C++ development within OOoC++ development within OOo
C++ development within OOo
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
 
mblock_extension_guide.pdf
mblock_extension_guide.pdfmblock_extension_guide.pdf
mblock_extension_guide.pdf
 
Advanced debugging  techniques in different environments
Advanced debugging  techniques in different environmentsAdvanced debugging  techniques in different environments
Advanced debugging  techniques in different environments
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipse
 
GWT 2 Is Smarter Than You
GWT 2 Is Smarter Than YouGWT 2 Is Smarter Than You
GWT 2 Is Smarter Than You
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
C++ Boot Camp Part 2
C++ Boot Camp Part 2C++ Boot Camp Part 2
C++ Boot Camp Part 2
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
 
ARM Embeded_Firmware.pdf
ARM Embeded_Firmware.pdfARM Embeded_Firmware.pdf
ARM Embeded_Firmware.pdf
 

Recently uploaded

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

Let's Take A Look At The Boost Libraries

  • 1. Let’s Take A Look At The Boost Libraries Seoul System Programmers Network #6 @TomSmartBishop Thomas Pollak
  • 2. Setup Boost (currently v1.61)  Download and unzip (http://www.boost.org/users/download/)  Run bootstrap(.bat|.sh)  Run b2 to generate the libs for your toolchain  Without parameters b2 will try to auto-detect your toolchain  In case you would like to build for another platform or b2 has troubles use --help to see all options  Libs will be in the sub directory stage/lib, you can move/install everything to the default locations with b2 install
  • 3. Let’s look at the samples  You can find the source code here: https://github.com/TomSmartBishop/sspn_06_lets_boost  I picked 7 boost libraries that I found interesting and used some more as little helpers, but there is much more: http://www.boost.org/users/history/version_1_61_0.html  Most libraries are header only and make heavy use of templates (and macros). Samples that need library linkage are pointed out on the slides.  Be aware that there s a compile time overhead, also for small samples.  Due to the fact that most boost libraries have different authors the API seems not always homogenous (however there are core components used across all libs).  Sometimes the API feels sometimes a bit over-engineered but does work as expected (compared to the STL lib).  In VS2015 /Wall produces a lot warnings so that /W4 seems like a better choice.
  • 4. Boost Program Options http://www.boost.org/doc/libs/1_61_0/doc/html/program_options.html  In case you are writing a program with command line parameters this is quite useful. No need to re-implement boring stuff again and again. The github sample uses the program options also to switch between the other sample implementations.  Needs to be linked against the program_options library. po::options_description desc("Allowed options"); desc.add_options() ("help", "produce help message") ("compression", po::value<int>(), "set compression level"); po::variables_map vm; po::store(po::parse_command_line(ac, av, desc), vm); po::notify(vm); if (vm.count("help")) cout << desc << "n"; else if (vm.count("compression")) cout << "Compression level was set to " << vm["compression"].as<int>() << ".n"; else cout << "Compression level was not set.n";
  • 5. Boost Any http://www.boost.org/doc/libs/1_61_0/doc/html/any.html  This behaves more or less what we know from Java and C# as “object”. It uses a template class to store the exact type you using. Therefore no implicit conversions, if you assign 5, the type will be an int and if you assign 5.0 it will be a double. Boost Any is really handy and interestingly has been described in a paper back in the year 2000, however it’s not part of the STL (would be nice though). std::vector<boost::any> values; values.push_back(std::string("Hello")); values.push_back("World"); values.push_back(42); values.push_back(3.14f);
  • 6. Boost Variant http://www.boost.org/doc/libs/1_61_0/doc/html/variant.html  Similar to Any, but Variant accepts only the predefined types. So it looks more like a union, but without the drawback of a union. Drawbacks of a union?  You can access a union at any time with any variation, eg. access the a float’s data as an int and this behavior is not defined in the standard. The standard only specified subsequent access of the same variant. Interestingly this is supported by most compilers (at least MSVC, clang, GCC) and is actually used in real world applications to access the bit representation of floating point number (or similar).  Only POD types allowed, but boost Variant also allows non PODs so we can create a variant like this: boost::variant< int, std::string > var("hello world");
  • 7. Boost Lexical Cast http://www.boost.org/doc/libs/1_61_0/doc/html/boost_lexical_cast.html  Convenient type conversion, no more need for atoi or sprintf to convert from int to string or the other way around.  Supports all fundamental C++ types and much more convenient compared to std::strtol and similar: int32_t i = lexical_cast<int32_t>("42");  Heap allocation can be avoided if desired (when converting to string).
  • 8. Boost Signals2 http://www.boost.org/doc/libs/1_61_0/doc/html/signals2.html  Callbacks with multiple targets. Comparable with event listeners in Java (without interfaces).  The callback receivers are called “slots” which are invoked by the “signal”. struct HelloWorld { void operator()() const { cout << "Hello, World!n"; } }; // Signal with no arguments and a void return value boost::signals2::signal<void ()> sig; // Connect a HelloWorld slot HelloWorld hello; sig.connect(hello); // Call all of the slots sig();
  • 9. Boost Serialization http://www.boost.org/doc/libs/1_61_0/libs/serialization/doc/index.html  Easy serialization, even though I cannot speak of a large scale experience, the interface looks good and I couldn’t spot any obvious pitfalls.  Can handle STL containers and as far as I could see also other boost classes like boost::greogorian::date.  Can restore pointers (serializes the content, not the pointer).  Needs to be linked against the serialization library (as well as the chrono/date_time library).  Uses RTTI by default, but also can be used without RTTI (with some typing overhead).
  • 10. Boost Compute http://www.boost.org/doc/libs/1_61_0/libs/compute/doc/html/index.html  Compute is one of the latest additions to boost. In my small samples I also got two warning during “normal” API usage, which I could fix by myself by doing some explicit type casts in the library’s header, so it looks like it needs still some time to really get stable.  However the concept is quite interesting: You can use your GPU to perform computations and the API let’s you do that in a very convenient way without worrying about the underlying hardware or compute shaders.  I didn’t perform any tests how much that can speedup operations, so I still need some more time to play around and explore…