What map with serialization support is there in C++? [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I need to keep my data in associative table. Something like:
typedef std::map< point, std::list<h_stat> > hm;
But STL containers do not have a ready serialization methods. It is very sad news.
I think, it is not a good idea to link a boost library to my small project.
I program on Windows. Maybe, does windows.h or MFC have a associative table class, that has a serialization method from a box? Or is there another good container for C++ on the Internet?
Thank you in advance.

With MFC you definitively have an easy way for serialisation with CMap and very easy way to make classes serializable.
However it's not so portable. An alternative is boost, which provides for serialisation also for standard containers (see also this answer to a similar question)

s11n is a C++ serialization library which claims that it...
can easily serialize all manner of PODs (Plain Old Data types), most STL containers, and user-defined Serializable types.
You could consider using it (AFAIK, it serializes containers automatically from serialization of constituents).
Otherwise, since your project is small, you should be able (without s11n) to manually add serialization operations to every class. With C++11 it should be relatively easy (thanks to ranged for loops, auto, lambda-expressions).

Related

key value flat file database simple in C or C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
For a project i am looking for a simple database which is written in C (or C++) for a cross platform aplication.
After looking into HamsterDB (which looked promissing) i had found out, that it is dependen on boost on windows.
So the alternative should not relies on STL or other libraries as the Application will be run on different Eco Systems (like arduino,symbian,android,windows) and compiled on diferent IDEs.
It will store up ton 20mil keys(but usualy below 50k keys), IO will be low.
Therefor it should be as clean C (or C++) as possible.
Can somebody show me something which will fullfill this, ready made?
LevelDB is what you're looking for. It's written in C++ but C functions are available as well.
LevelDB is a fast key-value storage library written at Google that provides
an ordered mapping from string keys to string values.
Looks like Berkeley DB is an option to you. Not sure about the embedded part (especially for arduino).
You can find a complete tutorial at standford's classes.

Policy based design in a real world open source project [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Can anybody point me to an open source C++ project(preferably not a lib), where policy based design is extensively used?
Well, I suppose that any C++ application using the STL containers (parameterized by an Allocator and, sometimes, a Comparator) extensively use Policy-Based design. It's been a corner stone of the STL even seen it saw the light at SGI.
The obvious one by Alexandrescu: Loki
It's being actively developed.
any project that is using boost :-) http://www.boost.org/community/generic_programming.html#policy
if you mean initiating policy-based objects, than it would be a lot of projects that use boost. For example, http://programmingexamples.net/wiki/CPP/Boost/BGL/DijkstraDirected
or you can look at big projects on github https://github.com/search?q=%23include+%3Cboost%2Fgraph%2Fgraph_traits.hpp%3E&type=Code&ref=searchresults
if you mean defining policy-based object, than most of the use cases would be libraries. The reason for that is that if somethings needs a lot of customization and can be generalized, it becomes a library (even if for internal use). If you just writing a straightforward program that doesn't need customization of objects and poly-morphism, than it wouldn't use much of policy-based design.
for those, you can also search on github, trying out some common policy-based syntaxes.
In my scientific work, I use boost's odeint library that relies on policies. When I code, i start with a specialized hamiltonian, than I generalize it with policies and it basically becomes a library that I use in many other projects.

Is There A C++ Wrapper / Binding For SDL? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I really have no problem with SDL in C , but it's kind of tiring. Using structs doing stuff without classes, or worse, having to wrap the functions up in a class yourself etc. I was wondering whether there was a good , mature , well-designed (i.e NO Macros , using templates and the STL) wrapper (binding?) for SDL?
You could check out https://github.com/AMDmi3/libSDL2pp. It is C++11/14 binding for SDL2 and related libraries (SDL2_ttf, SDL2_image). Seems like it also satisfies your style requirements - it makes much use of modern C++ features and seem to generally provides safe and easy way of using SDL2 primitives.
SDLmm is a C++ wrapper for SDL. I'm not sure when it was last updated though and I can't vouch for the style of C++ used either.
Pardon the personal plug, but I've been working on just such a library.
https://github.com/CYBORUS/cyborus-game-engine/tree/master/CGE
It was not my original intent to release it to the world, so it lacks documentation. However, if there were enough interest, I would be more than happy to spin off this CGE folder into its own project.
(CGE stands for CYBORUS Game Engine. It does precisely what you are asking for. For example, it keeps SDL_Surface structs safely inside a class CGE::Image.)

What is the most "standard" worthy database library for c++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
In my personal c++ studies, I've focused on projects that 1) Keep me engaged and 2) Help teach a standard principle. I want to do a project with database access. Which libraries do you think best stick with the c++ programming paradigm?
I understand that this question is open to interpretation, so please elaborate on your choice.
You might consider using the Database Template Library.
It provides a clean, iterator-based interface to access collections of records, so you can use it with all of the Standard Library algorithms. It also does a pretty good job of limiting the boilerplate you need to write to map database entities to user-defined types in your project.
I'm a fan of OTL (http://otl.sourceforge.net/) which also provides a clean, STL-like interface. It's worked for my needs and is simple to use.

Why some libraries must implement basic data structure? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Some open source libraries have tendency to re implement basic structures like string, list, stack, queue...
Why don't they use stl library? Is stl not good enough?
C++ as a language existed for many years before the STL was standardized and for several more years before the STL was implemented consistently across all compilers. Libraries that were originally written during that time may not have wanted to rely on the STL in order to be more portable.
Another reason related to portability is embedded use. Qt, for example, re-implements most of the STL because Qt applications are sometimes targeted at embedded platforms (e.g. Nokia smartphones) which may not have an STL implementation available.
Exposing STL types in headers can, in some cases, lead to nasty, nasty link times. On large projects, that can be sufficient reason to "hide" them behind a proprietary-looking API.
STL implementation differ on every platform, so exposing STL in library will have risk, for example if you expose std::map on your library, since you can not export std::map from your library, your library will be forced to use std::map implementation from your library users (the one that load your lib), this will cause some incompatibility such as different version of STL implementation, different STL allocator class, and some platform specific issues.
One of the reasons may be that STL containers are not intended to be used as base classes - STL design issues Wikipedia
To STL or NOT STL that is the question - SO