595 Commits

Author SHA1 Message Date
Igor
74e0b1b698 Update static_object.hpp
removed empty extra line
2016-10-12 10:47:01 +03:00
Igor
500e7a0188 Update static_object.hpp
I cannot understand what is going on here with `static T & instance;`, I propose to do not change `create()`. But it would be better if someone explain what is happening here :)
2016-10-12 10:45:37 +03:00
Igor
e715149f4d Update static_object.hpp
fixed misprint
2016-10-12 10:35:38 +03:00
Shane Grant
383cea57eb Realized that the multimap was to catch multiple paths within a single iteration.
Instead of using a multimap, we really just want the shortest path found per iteration.
Went back to a map, if a shorter path is found before we commit the changes, stage the shorter one instead.
2016-10-11 14:57:19 -07:00
Shane Grant
e080c31867 Merge branch 'register-chainable-relations-fix' of https://github.com/dlardi/cereal into dlardi-register-chainable-relations-fix 2016-10-11 11:55:27 -07:00
Shane Grant
80c518bcfc Merge branch 'develop' of https://github.com/kklouzal/cereal into kklouzal-develop 2016-10-11 11:36:41 -07:00
Shane Grant
f414a41a76 Merge branch 'erichkeane-fix_check' into develop
relates #342
2016-10-09 21:38:36 -07:00
Enhex
e694a6311a Replaced hardcoded rapidsjon namespacing with CEREAL_RAPIDJSON_NAMESPACE 2016-10-08 22:58:31 +03:00
KKlouzal
3d5a77d2c3 Fixed Internal Cereal Includes 2016-09-20 23:29:05 -07:00
Igor
adea360c7a Use statics initialization on demand fixed #331
Fixed crash CEREAL_THREAD_SAFE=1 with polymorphic class. Crash happened because StaticObject<T>::instanceMutex not initialized when StaticObject<T>::lock() called for the first time. Basically it is better to use static vars inside static functions to have predefined order of construction like it is done in StaticObject<T>::getInstance(), which calls create and forces instantiation at pre-execution time.
Also in this commit removed static T &instance; since it is possible that there were be two instances created
1) template <class T> T & StaticObject<T>::instance = StaticObject<T>::create();
2) inside StaticObject<T>::create()
2016-09-16 20:18:49 +03:00
Erich Keane
b9c424e06a Avoid accidentally using the "check" macro on OSX
Fix for #341, #273, and #104.  Replace usages of "check(" with
"(check)(", which will prevent us from colliding with the macro defined
in OSX's Assert macros.
2016-09-07 11:55:28 -07:00
dlardi
c83a7f99e6 'auto const &' used for range-based loops 2016-09-01 18:41:15 +03:00
dlardi
cd37b64b78 Iterative searching of chainable relations added 2016-08-30 15:12:37 +03:00
dlardi
d16f88da40 Register of chainable relations fix 2016-08-25 16:12:41 +03:00
Shane Grant
1e5e648918 nan support following #300 (see #285) 2016-08-05 13:48:53 -07:00
Shane Grant
0bfa9adf27 Update rapidjson to ab791ae
relates #300
2016-08-05 11:21:42 -07:00
Shane Grant
f053576858 Add CEREAL_NOEXCEPT to destructors for gcc 4.7.3
see #311
2016-07-29 15:01:50 -07:00
Shane Grant
fb7fd75954 Changes to support thread safety
-Make CEREAL_THREAD_SAFE be 0 or 1 instead of present or not present
-Move CEREAL_NOEXCEPT to macros.hpp
-instead of individual locks, can now use StaticObject::lock() to request a lock if CEREAL_THREAD_SAFE is enabled. If
not enabled, this call returns an empty object. The lock returned acts just like std::lock_guard, but uses
std::unique_lock internally
-Made a bunch of requests to StaticObject::getInstance const
-Added first stab at multithreaded tests with versioning and polymorphism
2016-07-29 13:40:49 -07:00
Christopher Bläsius
869a132f1b missing reference 2016-07-28 12:26:35 +02:00
Christopher Bläsius
39d1b45dfc yet another missing #ifdef 2016-07-28 12:19:32 +02:00
Christopher Bläsius
d7f96ac80e missing #ifdefs 2016-07-28 12:15:31 +02:00
Christopher Bläsius
73b2f8b1ec add new compile option "THREAD_SAFE" for enabling mutex locks on static objects 2016-07-28 11:49:10 +02:00
Shane Grant
a8bd7f3368 cleanup related to #291 2016-06-29 12:37:35 -07:00
Shane Grant
6d8bdd8818 Split lookup and exists check in PolymorphicCasters into two functions.
Fixes a bug related to lookup, see #291

Also changed from bool to uint8_t for #306

Updated gitignore for MSVC junk
2016-06-29 12:32:02 -07:00
Shane Grant
ac07952e40 add string include to bitset
see #302
2016-06-16 12:24:28 -07:00
Shane Grant
74da9b6b2a change bool to uint8_t see #298 2016-06-13 14:16:01 -07:00
Shane Grant
c330000cb4 Fix problems with portable_binary for BinaryData
see #298
2016-06-13 11:28:18 -07:00
Shane Grant
4379729f78 remove undef on CEREAL_STATIC_CONSTEXPR 2016-06-12 14:07:37 -07:00
Shane Grant
62c92138a2 correctly undef STATIC_CONSTEXPR 2016-06-12 13:54:03 -07:00
Shane Grant
3bc3c2adb0 rename ALIGNOF to CEREAL_ALIGNOF 2016-06-12 13:49:49 -07:00
Shane Grant
a1e259ed84 Use /W4 in all but performance.
Ignore VS warning 4127 for assert(false) in RapidJSON
2016-06-12 13:45:48 -07:00
Shane Grant
8401da04af rename NOEXCEPT to CEREAL_NOEXCEPT
-apply MSVC related changes to #297
2016-06-07 14:19:02 -07:00
reuk
8559c68b1b added virtual destructor to PolymorphicCaster 2016-06-06 12:50:44 +01:00
Shane Grant
037cf4fe94 Fix no return val error, add MSVC2015 builds 2016-05-30 17:37:40 -07:00
Shane Grant
a95551b0ac fix spacing 2016-05-30 17:12:28 -07:00
Shane Grant
db6586e93a alignas and noexcept workarounds for MSVC2013
see #290, #279
2016-05-30 17:10:45 -07:00
Shane Grant
77e1e0be74 fix shadowing error 2016-05-18 11:23:07 -07:00
Shane Grant
1e64528310 Merge branch 'json-double-roundtrip' of https://github.com/m7thon/cereal into m7thon-json-double-roundtrip 2016-05-18 11:17:29 -07:00
Shane Grant
2a0e67a780 formatting, remove copy ctors 2016-05-18 11:15:33 -07:00
reuk
974bbc28f1 default virtual destructors and other class ops for ArchiveBase classes 2016-05-18 17:05:26 +01:00
Michael Thon
e5911ad79e rapidjson: add ability to write and parse nan/inf/-inf 2016-05-17 14:03:41 +02:00
Michael Thon
e79526ce13 json.hpp: write and parse double in full precision 2016-05-17 14:01:33 +02:00
Shane Grant
2f1725a79d Made it OK to use shared_from_this in load_and_construct
Resolves #283

Previously EnableSharedStateHelper restored the internal weak_ptr for
enable_shared_from_this after load_and_construct was called, it is now
called as soon as construct() is called, allowing a user to use shared_from_this
to initialize various member variables. See issue for more info.
2016-04-30 22:04:42 -07:00
Shane Grant
fe37e5f9c9 remove cout debug
relates #281
2016-04-29 16:42:02 -07:00
Shane Grant
aaf1ef185e Implicitly build intermediate relations for polymorphism
relates to #281

Now if someone has a hierarchy like A -> B -> C,
the A->C relation will be automatically created if A->B and B->C already exist.
This is implemented by a chain of casts to get down the inheritance.

In the case of multiple paths, the shortest one will be chosen.
2016-04-29 16:39:31 -07:00
Francesco Biscani
7409da1fb4 Implementation and testing of std::atomic serialization. 2016-04-23 01:25:55 +02:00
Shane Grant
677e7e6c8e Updates RapidJSON to 1.0.2, nests in namespace
Updated and made changes necessary for the new version of rapidjson.
Looks good on ubuntu under the compilers I can test with, needs MSVC testing.
We had some internal changes to rapidjson but these didn't seem necessary with
the new version. Haven't done any performance testing, initial estimates put it at
nearly the same speed for json serialization. Could probably optimize things.

relates #82, #121
2016-04-19 10:55:56 -07:00
Shane Grant
4fdc15ed82 remove extra linebreak 2016-03-30 11:35:19 -07:00
Shane Grant
d2bfaa93f0 Support for versioning in load_and_construct
see #216 tests to follow
2016-03-30 11:17:22 -07:00
Tomasz Dudziak
10b967c74b Fix memory leak due to alloc-free size mismatch
sizeof(aligned_storage<sizeof(T)>::type) might not be equal to sizeof(T) for
some types.
2016-03-08 15:46:55 +01:00