All Our Tools Are Belong To You!

Tuesday, 19 February 2013
by Marcus Holland-Moritz
filed under Code and Announcements
Comments: 14

Welcome to the second part of our Open Source series. Today we’re releasing moost, a C++ library with all the nice little tools and utilities our MIR team has developed over the past five years. If you’re a C++ developer yourself, you might notice that moost sounds quite similar to boost, and that’s on purpose. moost is the MIR team’s boost, there is hardly a project in our codebase that doesn’t depend on one or more parts of moost.

There are a lot of different things in moost. Some are really simple, yet very helpful in day-to-day work, like the which template that allows you to use pairs (and containers storing pairs) more easily with standard algorithms; or stringify, a function template that turns complex objects into strings. Other parts are slightly more sophisticated: for example, moost contains the framework that is shared by all our backend services, and that allows you to write a daemonisable service with logging, a set of standard options and even a service shell that multiple users can connect to when the service is running, all in a few lines of code.

As our backend services are inherently multi-threaded, there’s also a bit of threading support in moost. For example, the safe_shared_ptr template is immensely useful for resources that are shared between threads and need to be updated atomically.

If you’re working with large, static datasets, you’ll probably find the memory mapped dataset classes interesting. They allow you to build large datasets (like gigabytes of data) of vectors, multimaps or dense hash maps that can be simply mapped into memory — and thus shared between different processes — and accessed very much like a constant standard container.

moost also contains an abstraction for loading shared objects and instantiating objects defined inside these shared objects. It will take care of all the magic involved to avoid resource leaks.

There are more bits and bobs in there, like a simple client for the STOMP protocol, hashing and message digest functions, wrappers for key-value stores, template metaprogramming helpers and even a complete logging framework. So check it out, play with it and if you’ve got some nice tool to add, please contribute!

There’ll be more code coming up later this week that makes use of moost, so if you’re looking for some hands-on examples, stay tuned!

To be continued…

Comments

  1. Predelnik
    19 February, 18:36

    Well, that’s pretty cool. But why in the world last.fm scrobbler is crushing so often on windows? :D

    Predelnik – 19 February, 18:36
  2. J.N.
    20 February, 05:09

    Many (only ?) very good ideas, many thanks for that contribution. It probably would help giving access to the doxygen docs for people who are just curious.

    J.N. – 20 February, 05:09
  3. Marcus Holland-Moritz
    20 February, 06:23

    @J.N. Very good point, thanks! You can now find the doxygen docs here.

    Marcus Holland-Moritz – 20 February, 06:23
  4. Arash Partow
    21 February, 06:44

    Very clean, well structured and written code base.

    Interesting and informative explanations and comments. (eg: class_logger.hpp)

    This is how C++ should be.

    Arash Partow – 21 February, 06:44
  5. Pierwsze Pozycje
    21 February, 19:19

    time to testing :)

    Pierwsze Pozycje – 21 February, 19:19
  6. Meeting C++
    21 February, 21:09

    That looks very nice.
    Would be nice if you could add some license information to the repository, seems like MIT from what is in the files.

    Meeting C++ – 21 February, 21:09
  7. Rachael
    22 February, 11:11

    I think I know some people who’d be interested in testing this out.

    Sounds promising.

    Rachael – 22 February, 11:11
  8. Marcus Holland-Moritz
    22 February, 11:55

    @Meeting C++, yes, it’s MIT, I’ve now included a LICENSE file.

    Marcus Holland-Moritz – 22 February, 11:55
  9. havryliuk
    22 February, 12:14

    Why Tools ARE Belong
    while they should just (without “are”) belong
    what an ignorance! sorry

    havryliuk – 22 February, 12:14
  10. Sehe
    23 February, 00:54

    @havryliuk MOVE ZIG! FOR GREAT JUSTICE
    (somebody didn’t get the reference…)

    Sehe – 23 February, 00:54
  11. Lilian
    24 February, 21:27

    Just a curiosity: Why in digest/sha2.cpp the functions were declared as a macro?
    Anyone knows?

    Lilian – 24 February, 21:27
  12. Pozycjonowanie
    27 February, 14:13

    Time for make some test.

    Pozycjonowanie – 27 February, 14:13
  13. otoTlumaczenie
    6 March, 12:59

    Is it working on MACs?

    otoTlumaczenie – 6 March, 12:59
  14. snyde
    11 March, 01:23

    Interesting. Thanks for giving back to FOSS.

    I need to start following this blog again. I drifted off for a while, when posts were becoming rare.

    snyde – 11 March, 01:23

Comments are closed for this entry.