609 Commits

Author SHA1 Message Date
Shane Grant
93b5073c62 Mostly solution for 137
This is option 1 for #137 which I'm quite happy with.  Works across compilation units and
shared libs on linux, need to test on windows.

As for #113, it doesn't seem to be an issue on linux so just remains to sort that out on windows.
2014-11-09 14:25:45 -08:00
Shane Grant
3189f037b7 Fixed a trait relating to minimal serialization
closes #131
2014-10-31 11:07:32 -07:00
Shane Grant
53aa47fd0d Merge branch 'ustulation-Support_Non-void_Return_Type_Functions' into develop
see #135
2014-10-31 10:46:43 -07:00
Shane Grant
9addb12616 Merge branch 'Support_Non-void_Return_Type_Functions' of https://github.com/ustulation/cereal into ustulation-Support_Non-void_Return_Type_Functions
Conflicts:
	include/cereal/access.hpp
2014-10-31 10:42:23 -07:00
ustulation
929cfe6217 For non-void type deduction by decltype, the functions should have an explicit return mentioned. Not having this breaks build for codes with serializing function signatures similar to the one below:
struct Cerealizable {
  template<typename Archive>
  Archive& serialize(Archive& ref_archive) {
    return ref_archive(stuff_0, stuff_1);
  }

  int stuff_0 {}, stuff_1 {};
};

Build error in GCC with "-Wall -Werror" flags
2014-10-29 18:14:46 +05:30
Shane Grant
5dfd60063f Rename WrapperBase to ElideMinimal
Removed WrapperBase and added ElideMinimal instead, which is a trait that is checked by
text archives performing minimal serialization to see if they should go ahead and skip creating various nodes
and naming things.  Currently only used on base_class and virtual_base_class
2014-10-21 14:44:20 -07:00
Shane Grant
84fa7cd39f Merge branch 'issue_46' into develop
Accidentally did this on another branch, relates #129
2014-10-21 14:19:04 -07:00
Shane Grant
1e3190d444 Adding traits::WrapperBase to identify wrapped classes
relates #129
2014-10-21 14:14:56 -07:00
Shane Grant
dfa871d5d8 Added test to VS build, related fixes
Relates to #46, passing on VS now
2014-10-05 18:01:12 -07:00
Shane Grant
d4d433daca Fix forward decl for #46
Passing tests on linux
2014-10-04 19:31:24 -07:00
Shane Grant
e054ec1b10 Merge branch 'issue_46' into develop relates #46 2014-10-04 19:15:05 -07:00
Shane Grant
901489593f finish unit test for #46 2014-10-04 19:02:35 -07:00
Shane Grant
97fa66f34e Doxygen doc updates for #46 2014-10-04 18:58:54 -07:00
Shane Grant
5715d7ad01 Clean up UserDataAdapter
Wrapped dynamic_cast in a cereal exception,
made the rtti function private,
updated test case to expect failure on some cases
2014-10-03 14:39:21 -07:00
Shane Grant
ed755a6fc5 Consolidate non member load minimal
relates #80
2014-09-27 23:33:58 -07:00
Shane Grant
669378d93b fix a typo 2014-09-27 18:25:57 -07:00
Shane Grant
7b51126bd3 Consolidate has_member_load_minimal
Relates #80
2014-09-27 18:24:12 -07:00
Shane Grant
43da02ddcf doxygen comment fix 2014-09-27 10:35:29 -07:00
Shane Grant
851e72bd1a Some ideas on solving adapters
This is a solution for #46 that uses RTTI to allow get_user_data to work
and throw an error when used in an archive that doesn't actually have user
data.  Unfortunately this is a run-time check and uses a dummy virtual function
that is never actually called (so the overhead of this will be very low, a few bytes
for the vtable, no runtime cost).

Another solution I'm going to play around with involves re-arranging some templates and
typedefs.
2014-09-26 21:59:18 -07:00
Shane Grant
3dba7636ba Merge branch 'develop' of github.com:USCiLab/cereal into develop 2014-09-26 15:03:26 -07:00
Shane Grant
2edc936e50 Better error messages for bad serialization
Inspired by #124, we now give explicit messages if you we can't find a serialization function
or if we find more than one.
2014-09-26 15:02:02 -07:00
Shane Grant
bbfd418013 Add traits for text archive identification
Archives that output text (human readable to some extent) should now derive from the type traits class
cereal::traits::TextArchive.

Testing for this can be done with cereal::traits::is_text_archive

Relates to #80
2014-09-06 22:28:10 -07:00
Shane Grant
948a869a08 Add cereal::traits::is_same_archive
See discussion of this on issue #80
2014-09-05 16:43:23 -07:00
Randolph Voorhies
06d9fc4f8a Whoops, shouldn't have committed that CMakeLists 2014-09-02 11:51:38 -07:00
Randolph Voorhies
28f9841fdb Fixing issues with icc. refs #120
In sandbox_vs.cpp, there is a very strange issue with calling
traits::is_input_serializable that causes icc 15.0.0 to crash.
Everything else works great though.
2014-09-02 11:49:47 -07:00
Shane Grant
e6cb01e89a Addressing both ICC issues in #120 2014-09-02 11:14:18 -07:00
Shane Grant
2b8bbab316 Finalize fix for #105
Decided to go with the simple ifndef solution since the template
acrobatics to disable things just for MSVC would not ahve been worth it

Tried to add ARM build for MSVC but this turns out to be hard to do without
making a windows store/phone app, which requirse an active dev license
2014-08-29 22:31:20 -07:00
Shane Grant
fdb822f4fd Change std::is_default_constructible to traits version
Relates to fixes for issue #119
2014-08-28 21:14:14 -07:00
Randolph Voorhies
652e9b7f34 Fixed issue with private c'tors
This fixes an issue where we were not properly using cereal::access to
default construct classes.

This closes issue #119.
2014-08-26 11:45:38 -07:00
Shane Grant
2e1737ec1f Uncomment test for issue #116 2014-08-22 13:23:44 -07:00
Shane Grant
2efa919b53 Merge branch 'issue_116' into develop
Char tested on all dev environments, looks fine and passing tests.
Closes #116
2014-08-22 10:30:29 -07:00
Shane Grant
13b0c7edb5 Support for char in XML archive
-Added unit tests for char in pod
-XML archive should properly deserialize chars vs int8_t types now
see #116

still needs to be tested on VS and g49
2014-08-21 23:43:52 -07:00
Shane Grant
f6f2972cb8 Update .travis.yml
Make travis use a more recent version of boost.
2014-08-18 23:31:32 -07:00
Shane Grant
8efbc0c6f5 Merge branch 'issue_109' into develop 2014-08-18 23:17:04 -07:00
Shane Grant
9a5a7134db Temporary fix for #105 2014-08-18 23:15:29 -07:00
Shane Grant
ba63d4a093 Merge branch 'volo-zyko-master' into issue_109 2014-08-18 17:10:25 -07:00
Shane Grant
0163d6cdd6 make isWhitespace xml_detail function instead of member 2014-08-18 17:08:51 -07:00
Shane Grant
a295a3635b Merge branch 'vigsterkr-develop' into develop 2014-08-18 16:54:34 -07:00
Volo Zyko
f8a871c7ff Another attempt to fix issue #109 now for any type that can contain whitespaces 2014-08-18 14:57:07 +03:00
Volo Zyko
c068ba2405 Reverted changes in xml.hpp for issue #109. 2014-08-13 22:24:55 +03:00
Viktor Gal
3781ab3d49 Fix Boost header path inclusing if found 2014-08-07 10:59:57 +08:00
Randolph Voorhies
b405737fbf Merge pull request #111 from besser82/add-cross-test-switch
add CMake-option 'SKIP_PORTABILITY_TEST'
2014-08-05 12:38:54 -07:00
Björn Esser
869b2b2cda add CMake-option 'SKIP_PORTABILITY_TEST' 2014-08-05 19:43:15 +02:00
Volo Zyko
16bf75dedf Extended the fix for issue #109 and added a test. 2014-07-31 15:45:05 +03:00
Volo Zyko
b0d45bd565 Fixed issue #109. std::string is serialized/deserialized in XML with CDATA node. 2014-07-28 15:20:43 +03:00
Shane Grant
e423228dde Adding a clean way of dealing with #107 2014-07-07 14:26:30 -07:00
Shane Grant
ea007dafd8 Adding additional tests to cover issue #79 2014-06-06 15:24:24 -07:00
Shane Grant
f067ba6905 Fixing issue #79
Added a set of trait classes that can be used to get an input archive
from an output archive.  Requires specializing a struct for each direction or
alternatively using the new macro CEREAL_SETUP_ARCHIVE_TRAITS(InArchive, OutArchive).
This has already been added for all built in archive types.  This is currently only
used for minimal serialization.

load_minimal type traits now correctly use the output archive to check the existence of
a corresponding save_minimal and get its return type, using the new get_input_from_output
type class.

Added a test for this case into the minimal structs test.

Sandbox_vs needed the new macro to become compliant.
2014-05-22 10:59:13 -07:00
Shane Grant
5305078096 Consolidate non-member save_minimal relates #85 2014-05-21 16:20:02 -07:00
Shane Grant
6d738d7171 experimenting with a cast 2014-05-21 15:02:59 -07:00