601 Commits

Author SHA1 Message Date
Shane Grant
2f65458ddf Using clang 3.3 for travis build 2014-03-11 18:18:21 -07:00
Shane Grant
13ec02cc5d ia32-libs causing problems, trying without 2014-03-11 18:09:20 -07:00
Shane Grant
f827b5e28e Adding 32bit libs to travis 2014-03-11 18:05:44 -07:00
Shane Grant
b69ab4c0e0 Fixing compilers in travis config 2014-03-11 18:01:34 -07:00
Shane Grant
9fe5c00d4a Updating travis build 2014-03-11 17:55:33 -07:00
Shane Grant
27d47edd3d Updating scripts 2014-03-11 17:53:19 -07:00
Shane Grant
1fba852953 Trying to get travis working 2014-03-11 17:45:40 -07:00
Shane Grant
dbf6a61d19 Adding travis build file 2014-03-11 17:39:36 -07:00
Shane Grant
06255cef01 Adding 32-bit tests (not working for now) 2014-03-11 17:38:51 -07:00
Shane Grant
cf7a106515 doxygen fixes 2014-03-11 17:29:32 -07:00
Shane Grant
43855f2e5c Added update-doc target 2014-03-11 17:23:23 -07:00
Shane Grant
a6e144a5a2 Working on update-doc 2014-03-11 17:06:58 -07:00
Shane Grant
a9d711060b Adding doc target 2014-03-11 17:02:36 -07:00
Randolph Voorhies
9bd06b6118 Adding portability test 2014-03-11 16:28:37 -07:00
Randolph Voorhies
ba2ca7c94d Switching to CMake and splitting unittests 2014-03-11 14:50:04 -07:00
Shane Grant
869c543eaa tighten up long double similarity bounds 2014-03-09 23:14:08 -07:00
Shane Grant
d2bdaf3aab adding long long, unsigned long long, long double unit tests 2014-03-09 22:59:25 -07:00
Shane Grant
94cb6d3ba8 Merge branch 'develop' of github.com:USCiLab/cereal into develop 2014-03-08 23:26:01 -08:00
Shane Grant
c70f776ee5 Fixing support of final classes in polymorphic pointers
This fixes issue #65, however, this comes at a mild consequence for
anyone wishing to serialize types that inherit from std::enable_shared_from_this.
cereal no longer supports this inheritance if done using the protected access
modifier without befriending cereal::access.

For example, consider all of the following (pretend they are polymorphic)
serialized with some smart pointer:

struct A : std::enable_shared_from_this<A> {}; // OK
struct B final : protected A { friend class cereal::access; }; // OK
struct B2 final : protected A { }; // ERROR: cereal can't access enable_shared_from_this
struct C : A {}; // OK
struct D {}; // OK - a normal class with no enable_shared_from_this
2014-03-08 23:22:45 -08:00
Shane Grant
019d795685 indenting some code 2014-03-08 22:50:49 -08:00
Shane Grant
6b6f1fe383 everyone likes typename except MSVC
Apparently MSVC doesn't want typename where it makes sense to use
typename (dependent type from a template).  Preprocessor verbosely
saves the day, yet again.  Relates #68
2014-03-08 22:47:47 -08:00
Shane Grant
3e1f9cb027 fixing typo for VS compliance (see #68) 2014-03-08 22:42:16 -08:00
Shane Grant
9ca38dba65 Merge branch 'develop' of github.com:USCiLab/cereal into develop
Conflicts:
	include/cereal/types/string.hpp
2014-03-08 22:34:13 -08:00
Shane Grant
44eb532548 Making cereal play nicely when saving enable_shared_from_this
cereal no longer permanently modifies the state of internal workings of
std::enable_shared_from_this when saving.  cereal *should* be completely
compatible with both saving and loading anything that inherits from this now.
This fixes issue #68 - note that there is still a minor issue regarding
classes declared final that will run into a bug with the way we check for
enable_shared_from_this (see issue #65).

Issue #65 will be addressed in the future by changing the way we check
for derivation from enable_shared_from_this.  In the current scheme, we
can detect this even if you use protected inheritance.  In the future, cereal
will not be able to get around protected inheritance of enable_shared_from without
befriending cereal::access.  This will come at the benefit of allowing classes
declared final to be used with polymorphic serialization.
2014-03-08 22:30:20 -08:00
Shane Grant
970aa9f07d Fixes empty string serialization for debug in VS (#69)
Previously we took the address of the dereferenced begin() iterator
on a string to get the pointer to its data; we now just const_cast
the pointer that is the result of calling data().

The original reason for using the iterator over something like data()
was to avoid the const_cast and to ensure that any copy on write
mechanisms were used, but this doesn't seem necessary given that we
call resize() immediately prior to this.  Valgrind shows no problems
with the new method.  Also added unit tests for this case to string.
2014-03-08 11:08:48 -08:00
Shane Grant
196822ef9f Making valgrind a bit happier with sandboxes 2014-03-08 10:29:30 -08:00
Shane Grant
22460f6c7f indenting some code 2014-03-05 15:35:51 -08:00
Shane Grant
6b13c93a47 options struct for xml 2014-03-05 15:28:47 -08:00
Shane Grant
a7a8578d51 playing around with new options for JSON
One idea is to put all of the options in a single struct, as seen here
2014-03-05 15:11:50 -08:00
Shane Grant
7cd0c3e565 throw exception instead of assert for rapidjson
cereal will now override RAPIDJSON_ASSERT by default to throw a
runtime exception instead of failing an assertion.  This can always
be overridden by defining your own RAPIDJSON_ASSERT macro

see #67
2014-03-01 23:16:58 -08:00
Shane Grant
bd94cfbcf4 Small fix for elided empty classes
Previously if you had an archive that supported eliding empty classes
(such as binary or portable binary), and specialized that archive there would
be an ambiguity in the enable_ifs for serialization.
2014-03-01 16:52:56 -08:00
Shane Grant
fb9239bf3b Added macro to define base XML node name
Addresses concerns in issue #63

Also cleaned up a small amount of leftover commented out code, added const to some things that should be const, and a minor optimization in the JSON search to use strncmp in one instance.
2014-03-01 11:23:33 -08:00
Shane Grant
5ae926461f turning off code analysis
see #61
2014-02-27 21:53:05 -08:00
Shane Grant
048e95d966 Merge branch 'develop' of github.com:USCiLab/cereal into develop 2014-02-27 21:51:30 -08:00
Shane Grant
0d83f14fa3 Adding delay_static_assert
Closes #61
2014-02-27 21:50:58 -08:00
Shane Grant
923c3722eb minor cleanup in shared_from_this_wrapper 2014-02-26 14:10:10 -08:00
Shane Grant
89bcdc1404 32 vs 64 bit testing for portable binary
see #12
2014-02-22 23:02:12 -08:00
Shane Grant
2095c71e94 Adding warning about using std::ios::binary to doxygen 2014-02-22 19:38:05 -08:00
Shane Grant
30a22fec28 Renaming load_and_allocate to load_and_construct
Anything associated this that used the verb allocate has been replaced with construct

closes #59
2014-02-21 15:52:26 -08:00
Shane Grant
4a3c2859e6 using std::ios::binary for binary streams
see #54
2014-02-15 19:29:12 -08:00
Shane Grant
8fd965819c Adding _CEREAL_NVP for internal loads
Closes #56
2014-02-15 12:32:17 -08:00
Shane Grant
542406fba1 progress towards #56 through memory 2014-02-14 15:41:54 -08:00
Shane Grant
353252d7f9 Merge branch 'develop' of github.com:USCiLab/cereal into develop 2014-02-14 15:22:42 -08:00
Shane Grant
e9bff3a493 shared_ptr for enable_shared_from_this libc++
Addresses a libc++ only issue.  See the bug report here: http://llvm.org/bugs/show_bug.cgi?id=18843
2014-02-14 15:20:48 -08:00
Randolph Voorhies
24ce678c74 Fixes an issue with libc++ eof handling in rapidjson
The credit to this fix is due to @zittix. This closes issue #51.

This is due to a bug in the mac version of libc++ and should be fixed in
HEAD. See here for a related stackoverflow post:
http://stackoverflow.com/questions/14147667/clang-and-libc-istreampeek-does-not-set-eof-flag
2014-02-14 11:37:54 -08:00
Shane Grant
cde2d2954d Misc fixes to better MSVC support
Fixed a preprocessor define
Removed an extra semicolon
cereal::any is hidden behind an include guard now
2014-02-13 23:51:05 -08:00
Shane Grant
d89c94d7bb Adding polymorphic unit tests for enble_shared_from_this
Should fix #47
2014-02-11 16:52:57 -08:00
Shane Grant
2c618bb6d4 adding comments
see #47
2014-02-11 16:38:29 -08:00
Shane Grant
3447e059a4 cleanup junk leftover from last commit
see #47
2014-02-11 16:33:13 -08:00
Shane Grant
6bb2f28908 has_shared_from_this and get_shared_from_this_base
Functionality to figure out the type enable_shared_from_this was templated on for
any base type of the current type.

see #47
2014-02-11 16:30:53 -08:00