Plugins: loading code at runtime

On windows we have the .dll files, .so files on Linux, and .dylib files on Mac. They all have one thing in common: they can be loaded at runtime and provide entry points to call into. One example is an online chat client that uses plugins to add support for more protocols (Google Chat, ICQ, […]

Micro-benchmarks

I was looking for a way to benchmark a piece of code… I came up with 5 libraries that make it very easy 🙂 I’m not going to write a tutorial on how to use each one because I would basically be rewriting their documentation sections. What I will do is show you how to […]

SQL database access

When I first set out to make a post about database access from C++ I was going to write about MySQL Connector/C++. But for some reason that didn’t sit well with me. After sleeping on it I realized it didn’t appeal to me because it was 1) limited to only one database backend and 2) […]

Measuring CPU time

Measuring how long your program ran for is easy with std::chrono, but what if you need details about user and system space time? Easy! Use Boost CPU Timer library 🙂 It’s another simple library from Boost with only few classes: auto_cpu_timer is like a RAII object; it starts the clock in its constructor, stops it […]

Printing stack traces

This one will be short 🙂 If you want to add more diagnostic information to your programs make sure to check out Boost.Stacktrace library. With it you can capture and print current stack traces. It’s especially useful when combined with exception handling; it allows you to know right away where the exception originated from.

[…]

Generating Unique IDs

I like simple and well written C++ libraries, and I’m especially fond of Boost, so I’m going to blog about it some more 🙂 Today I’ll show you how to generate unique IDs using Boost::UUID header only library. There really isn’t much to be said about it other than it’s simple, consists of only few […]

RPC with Protocol Buffers

Just when I thought I covered the topic of RPC in C++ with Thrift, I came across a new and very promising RPC framework: Google’s gRPC. The more I read about it the more I like it: just like Thrift it supports many programing languages and internally uses Protocol Buffers to encode messages. So I […]

Serialize data to XML

Protocol Buffers are not always an option and you just have to serialize your data to XML. Then what? Luckily there is a serialization library available from Boost and it makes that pretty easy for us. You don’t even have to modify your existing data structures to write them out as XML: the library is […]

Thrift: or how to RPC

Just like my previous Protocol Buffers post, this one is also meant as a brief introduction that will point you in the right direction rather than an exhaustive tutorial. Here we go… Again we are in search of a portable library, this time not for serialization, but for a portable RPC mechanism. On Windows we […]

Protocol Buffers: or how to serialize data

This post is meant as a brief introduction that will point you in the right direction rather than an exhaustive tutorial. Here we go… Have you ever had to write code that serialized structured data into an efficient binary format, to be later saved to disk or sent over the network? Do you remember how […]

Well, that was no fun :(

No, not blogging, that’s still fun 🙂 moving my website to bluehost over the last 24 hours! But it’s finally done and the Vorbrodt’s C++ Blog is smooth sailing once again… on a brand spanking new domain! But have no fear, the old one will kindly redirect. So what have I learned through this exercise? […]