Snap! Websites
An Open Source CMS System in C++
The sitter project is a daemon, plugins, and tools that can be used to watch a computer to make sure that it runs smoothly.
The snapdev project includes a set of base classes and functions that are header only (a.k.a. inline). A form of std library, if you you wish, but mostly geared toward helper functions we use all over the place.
The following are the features available at time of writing. It is not unlikely to grow every now and then.
Change a file owner and group by name.
Compute the intersection of two sets and return true if empty. The idea is that there is an algorithm to very quickly compute such a result without having to do any copy. Computing an ...
The Snap! C++ Content Management System makes use of two databases at this point: Cassandra and Snap! Database System (sdbt).
The Cassandra system has several drawbacks which we are slowly fixing by implementing the SDBT environment. The main one at first is to have a set of journaling tables which Cassandra has a really hard time with. This is because it creates tombstones and the Cassandra files grow indefinitely rendering the whole system very slow over time. It is slow because Cassandra ends up having to scan these large files from start to finish to gather the data on a read. Such reads end up being very long. When over about 10 seconds, it tends to timeout and more or less it breaks everything. So Cassandra is not a good solution for this type of tables.
The Event Dispatcher library is a low level C++ library used to communicate between local and remote services.
For communication, the library supports TCP, UDP (direct and broadcast), Unix pipes.
The event part also supports events from Unix signals and the File System.
Each one of these objects can also be given a timeout date or an elapse time to generate ticks.
Most of the components of the Event Dispatcher library were developed in the libsnapwebsites library. It was detached from that library so we could make use of its powerful features in other projects.
The C++ Thread project is the snap_thread.cpp/.h moved in its own project.
We also will include any multi-thread related code to this project as we find it in our other libraries.
The project allows for easy thread manipulation and communication which makes it really easy to add multitasking to your projects. It also includes a thread pool with workers which we want to ameliorate to allow for concurrent programming rather than parallel programming, very much based on the Go environment.
The Snap! C++ project makes use of exceptions whenever it bumps in a problem which can't be resolved at the time it is detected.
This model means that exceptions are usually fairly rare (once in a while we have a problem and generate problematic exceptions, but we tend to fix those quickly.) In other words, our exceptions are pretty exceptional. For example, a file can't be opened when it should, we are likely to throw a Run Time Exception.
As a result, it is possible for us to do something rather slow in our exceptions:
Collect a Stack Trace
This helps us ...
Many of our C++ test make use of catch.hpp which is a standalone C++ header allowing us to very quickly develop unit tests against our code.
We also have our own extensions in the snapcatch2.hpp file so we can very quickly create new tests with our standard set of command line extensions, verbose sections, etc.
This project is a C++ library used to seamlessly handle UTF-8 strings. It offers very easy to use functions to convert characters and strings between UTF-32 and UTF-8.
The library also includes a string iterator to go through a UTF-8 string without having to first convert it to a UTF-32 string (which saves you a malloc() and free() and up to 4x the space the original string in memory saving.)
Later we intend to add support for UTF-16.
The source is available on github in our project git.
On Ubuntu, you may want to install it from our Snap! C++ Launchpad PPA. ...
We maintain the Zipios library. This is a C++ library one can use to read or create 32 bit zip files. The advantage of this library is that it offers standard C++ streams to copy the data. The main stream gives you information about each file and you can create a sub-stream for each one of those files. The input is automatically compressed and the output automatically decompressed.
Chapter 7. Mutal Exclusion — Lamport's solution, also called the Bakery Algorithm (p. 130)
The snaplock project is part of the snapwebsites environment. It is a daemon written in C++ allowing you to lock various resources on an entire cluster of computers for a small amount of time. A resource has a URL which is what we use to create the lock (we call it the Object Name.) The URL can be global to the whole cluster, specific to a website, or even specific to one special variable in a specific page of a specific website (in other words, very small granularity is ...
Snap! Websites
An Open Source CMS System in C++