Its usage is very narrow (being language- and version-specific).
Basically clipboard operations (undo/redo/cut/paste) within single
application and dumping objects into text or xml file or log for
debugging/problem reporting/code generation purposes.
For those things it is adequate; it does not matter if undo takes
25 or 50 milliseconds. CMW feels even more narrow in sense that
it does not look like suitable for most of named use-cases.
CMW doesn't support JSON or text formats, but I
don't think it's difficult for application written
using CMW to work with an application written in
a language other than C++. I don't have examples
of that, but there aren't difficult technical
problems behind doing that.
It is more likely that someone wanting to actually serialise
something between applications/services using boost uses
Boost.PropertyTree instead.
Yes, but what use case it is that you compare?
It's a low-level test. Applications are made up
of low-level operations ... I'm open to other
ideas of what to test.
You push that 'std::vector<std::deque<double> >' reflection?
Typically it is implementation detail that may change between
versions. It is likely that profiling shows in version 2.1 that
'std::valarray' trumps 'std::deque' but it can't be done since
that would make CMW of 2.2 not compatible with 2.1.
From a protocol perspective deque and valarray are
the same. First we marshal the size of the container
and then the elements. So it should be possible to
make the change you mention without compatibility
problem.
Telling
that it is indexed collection of indexed collections of floating
point values gives it more longevity and is neutral to
programming language.
If C++ reflection is major property for you then there is cereal.
http://uscilab.github.io/cereal/index.html (has JSON/XML and
various binary representations).
The following type is from that link:
struct SomeData
{
int32_t id;
std::shared_ptr<std::unordered_map<uint32_t, MyRecord>> data;
template <class Archive>
void save( Archive & ar ) const
{
ar( data );
}
template <class Archive>
void load( Archive & ar )
{
static int32_t idGen = 0;
id = idGen++;
ar( data );
}
};
The load function looks funny to me. In order
for something to be loaded, it has to have been
saved. How is id being set in code that's not
shown and can it be coherent with the static in
the load function?
I agree with their requiring C++ 2011 or newer.
But Cereal looks similar to the serialization
library in Boost. Users have to maintain
serialization functions and the dependence on iostream.
There are even attempts of
making reflection libraries:
https://bitbucket.org/dwilliamson/clreflect
I'm also not sure. Those seem to be on same market
between small enough for using text-based protocols
and big enough for using real binary formats (audio,
graphics, database etc.). Protobuf lacks reflection
and CMW lacks language neutrality.
I think Protobuf has some support for reflection.
I don't think support for other languages is hard
to reach. Assuming we stick with byte-level
marshalling, I don't think there are difficult
problems in making applications written with
CMW work with applications in another language.
Also assuming IEEE 754 floating point.
Switching to bit-level marshalling would make
it more work to support other languages so
probably we won't do that.
Brian
Ebenezer Enteprises - In G-d we trust.
http://webEbenezer.net