Yet another JSON/YAML/BSON serialization library for C++.

Overview

ThorsSerializer

Support for

Build Status codecov.io
Code Review Code Review Code Review Code Review

Benchmark Results

Conformance mac linux
Performance max linux
For details see: JsonBenchmark

ThorStream

Yet another JSON/YAML/BSON serialization library for C++.

Unlike other libraries this one does not require you to build DOM of you object before serialization. Using a declarative C++ style you define what C++ classes (and members) you want to serialize "ThorSerializer" will generate the appropriate code automagically.

HomeBrew

Can be installed via brew on Mac and Linux

brew install thors-serializer

Header Only

To install header only version

git clone --single-branch --branch header-only https://github.com/Loki-Astari/ThorsSerializer.git

Version 2

I have deprecated the jsonImport() and jsonExport() functions. These have been replaced with jsonImporter() and jsonExporter() functions (though the original versions still exist but are marked [[deprecated]]). The main difference is that the new functions catch exceptions (by default) this makes the serialization work like normal C++ serialization and simply set the bad bit on the stream.

Contributors

Added the all-contributers bot to generate the table.


One Page

Comments
  • error when running configure

    error when running configure

    hi I'm getting this erros when running ./configure --disable-binary

    checking for wget... wget
    checking for unzip... unzip
    checking for g++... g++
    checking whether the C++ compiler works... yes
    checking for C++ compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    Submodule 'build' () registered for path 'build'
    Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
    Permission denied (publickey).
    fatal: The remote end hung up unexpectedly
    Unable to fetch in submodule path 'build'
    ./configure: line 2990: pushd: build/third: No such file or directory
    ./configure: line 2991: ./setup: No such file or directory
    configure: error: Failed to set up the test utilities
    

    am i doing something wrong !!! thanks

    opened by chfakht 22
  • Problem with Serialize Import of a string

    Problem with Serialize Import of a string

    Hello I'm having some issues to map a JSON file to a c++ object. I've simplifed the code I'm using to only show you the part of the object that has an issue being mapped to c++.

    #include "ThorSerialize/Serialize.h"
    #include "ThorSerialize/Serialize.tpp"
    #include "ThorSerialize/Traits.h"
    #include "ThorSerialize/JsonThor.h"
    #include <string>
    #include <sstream>
    #include <iostream>
    #include <vector>
    
    using namespace std;
    
    class ValhallaLeg {
    	friend class ThorsAnvil::Serialize::Traits<ValhallaLeg>;
    	private:
    		string shape;
    	public:
    		ValhallaLeg(){};
    		~ValhallaLeg(){};
    };
    
    ThorsAnvil_MakeTrait(ValhallaLeg, shape);
    
    
    int main()
    {
    	using ThorsAnvil::Serialize::jsonExport;
    	using ThorsAnvil::Serialize::PrinterInterface;
    	ValhallaLeg* result = nullptr;
    	cin >> ThorsAnvil::Serialize::jsonImport(result);
    	cout << ThorsAnvil::Serialize::jsonExport(result) << endl;
    
    	return EXIT_SUCCESS;
    }
    

    Here is the json that I'm inputing in the console (and in my real code for the shape part of the json): {"shape": "offavAdqtekCsAcFhb@yW|SiMhH{AjLzAfb@lJld@jK~g@jLhScbCvRy~BxRu`C~Hk_A~Hi`AxRg_C~Rw`ChRi~Bh\\i|DpCo]|h@jBxRjAtYjApRvCrcBn]pBMlEz@tYrFdd@zK`h@pRbe@pRpf@b[re@~]dd@~]de@l_@ng@rd@zo@lj@vg@`f@hRtPnS`Rjf@fc@fh@dd@|h@be@ba@n^~a@j_@lcA~|@lo@xk@~g@td@fSkrBlZ|^vb@ng@vjBzsB`]rZ`b@xWveBdy@faAre@lvBvaArdAfb@fdDziAxQdFh`AhVts@bRpRrEtn@dPvDya@fD{_@bUrFbWbG`Gag@dF{Ath@bQti@bPf^nIbp@lJ|D^vNeFdK]lE?lYzApGxBxRvN`HhB`v@zAdELlZjA`q@nJ~g@fCz_AfDhu@|@bViMtP{AnS\\vX`Rf|@uDxdByLz~@iW~r@oThC]tEl@~BjA~C?~XaHnIeEvIsFpGiCvDN|Yfm@lOxVrPxCtZ_@p[{Jj\\mKfDkAf]kL~HwCp\\wMze@yMtd@sPpLeEhl@cR~w@iVrZmJ|O}@`XiBlOL~HrGt_@~H|OtEfItD~CxBlOlKbcBpyAvr@dn@dPvNn{@ls@vx@`r@zt@bo@fb@p]pa@p\\ze@ha@fgAl~@hW|S`xC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fuBnyLrz@r_Fbo@tsDrFb\\wHnHTzAxHvb@fIre@{t@hW}~@xWrGjj@ms@pSiCxB?rFhCjUx`@pxCapAz`@ck@tOwl@pQwI{_@ye@dOi{Avc@i\\hL"}

    I get an error that says

    what(): ThorsAnvil::Serialize::UnicodeWrapperIterator::checkBuffer: input character can not be smaller than 0x20

    I've tried removing some part of the string and inputing this smaller chunk of my shape in the console : {"shape": "offavAdqtekCsAcFhb@yW|SiMhH{AjLzAfb@lJld@jK~g@jLhScbCvRy~BxRu`C~Hk_A~Hi`AxRg_C~Rw`ChRi~Bh\\i|DpCo]|h@jBxRjAtYjApRvCrcBn]pBMlEz@tYrFdd@zK`h@pRbe@pRpf@b[re@~]dd@~]de@l_@ng@rd@zo@lj@vg@`f@hRtPnS`Rjf@fc@fh@dd@|h@be@ba@n^~a@j_@lcA~|@lo@xk@~g@td@fSkrBlZ|^vb@ng@vjBzsB`]rZ`b@xWveBdy@faAre@lvBvaArdAfb@fdDziAxQdFh`AhVts@bRpRrEtn@dPvDya@fD{_@bUrFbWbG`Gag@dF{Ath@bQti@bPf^nIbp@lJ|D^vNeFdK]lE?lYzApGxBxRvN`HhB`v@zAdELlZjA`q@nJ~g@fCz_AfDhu@|@bViMtP{AnS\\vX`Rf|@uDxdByLz~@iW~r@oThC]tEl@~BjA~C?~XaHnIeEvIsFpGiCvDN|Yfm@lOxVrPxCtZ_@p[{Jj\\mKfDkAf]kL~HwCp\\wMze@yMtd@sPpLeEhl@cR~w@iVrZmJ|O}@`XiBlOL~HrGt_@~H|OtEfItD~CxBlOlKbcBpyAvr@dn@dPvNn{@ls@vx@`r@zt@bo@fb@p]pa@p\\ze@ha@fgAl~@hW|S`xCpdCdo@|h@fh@vb@jKnIld@~]`g@|^ld@hXbe@hW|d@zUdi@~Sj`@fM`Cl@zA^vMdD|i@hN|}@jUfCl@jLvCtJxBgD`I~Cz@rQtEvw@pR~zAn]rtA`]vHvCrAdEvCdE|EvDhHbFlc@p\\hMrG`RdOxRr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PlUiChMGzJl@vaAm@hXyLbF}DtOsFrQwDbGyRrZuN~RcQnT}EpG}I~Su@xBqC~HeEdO_D~]cA`|@?dEm@tZG`\\aBxrCcf@`HeZ{@hH||Ad@`RjAx`@|Eb{@bFrdAjFrmArGboAhB~h@d@li@gC~fAkBfkA{@to@eAro"}

    And no error is thrown and I can see the output on the console of the Export in json of the object.

    I need help figuring out what's happening when I input the entire string of my shape. I've checked with a JSON lint and it says my json is valid.

    Thank you! `

    opened by isasmarthalo 19
  • Unable to build the library, flex: unknown flag '-'

    Unable to build the library, flex: unknown flag '-'

    Hi! Could you help me please. I'm following your Build instructions. Configure step succeeds. But make fails.

    vitvlkv@sakura:~/src$ git clone [email protected]:Loki-Astari/ThorsSerializer.git
    Cloning into 'ThorsSerializer'...
    Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
    remote: Counting objects: 3062, done.
    remote: Total 3062 (delta 0), reused 0 (delta 0), pack-reused 3062
    Receiving objects: 100% (3062/3062), 875.07 KiB | 753.00 KiB/s, done.
    Resolving deltas: 100% (1966/1966), done.
    Checking connectivity... done.
    vitvlkv@sakura:~/src$ cd ThorsSerializer/
    vitvlkv@sakura:~/src/ThorsSerializer$ ./configure --disable-binary --disable-yaml
    checking for wget... wget
    checking for unzip... unzip
    checking for g++... g++
    checking whether the C++ compiler works... yes
    checking for C++ compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    Submodule 'build' (https://github.com/Loki-Astari/ThorMaker.git) registered for path 'build'
    Cloning into 'build'...
    remote: Counting objects: 745, done.
    remote: Total 745 (delta 0), reused 0 (delta 0), pack-reused 745
    Receiving objects: 100% (745/745), 384.89 KiB | 479.00 KiB/s, done.
    Resolving deltas: 100% (465/465), done.
    Checking connectivity... done.
    Submodule path 'build': checked out '4b8ea1d12bf083651692086c631bf00175fb69f8'
    Submodule 'googletest' (https://github.com/google/googletest.git) registered for path 'googletest'
    Submodule 'vera-plusplus' (https://github.com/Loki-Astari/vera-plusplus.git) registered for path 'vera-plusplus'
    Cloning into 'googletest'...
    remote: Counting objects: 7439, done.
    remote: Compressing objects: 100% (13/13), done.
    remote: Total 7439 (delta 5), reused 0 (delta 0), pack-reused 7426
    Receiving objects: 100% (7439/7439), 2.51 MiB | 623.00 KiB/s, done.
    Resolving deltas: 100% (5522/5522), done.
    Checking connectivity... done.
    Submodule path 'googletest': checked out 'ed9d1e1ff92ce199de5ca2667a667cd0a368482a'
    Cloning into 'vera-plusplus'...
    remote: Counting objects: 2715, done.
    remote: Total 2715 (delta 0), reused 0 (delta 0), pack-reused 2715
    Receiving objects: 100% (2715/2715), 702.82 KiB | 349.00 KiB/s, done.
    Resolving deltas: 100% (1841/1841), done.
    Checking connectivity... done.
    Submodule path 'vera-plusplus': checked out '526e6fba9ed8d7f99b74188ee670c819bc4f895c'
    -- The C compiler identification is GNU 5.4.0
    -- The CXX compiler identification is GNU 5.4.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found Tclsh: /usr/bin/tclsh (found version "8.6") 
    -- Found TCL: /usr/lib/x86_64-linux-gnu/libtcl.so  
    -- Could NOT find TCLTK (missing:  TK_INCLUDE_PATH) 
    -- Could NOT find TK (missing:  TK_INCLUDE_PATH) 
    -- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.12", minimum required is "2.0") 
    -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2.0") 
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
    -- Boost version: 1.61.0
    -- Found the following Boost libraries:
    --   filesystem
    --   system
    --   program_options
    --   regex
    --   wave
    --   python
    --   serialization
    --   thread
    --   chrono
    --   date_time
    --   atomic
    CMake Warning at doc/CMakeLists.txt:5 (message):
      The documentation won't be built because pandoc was not found.
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/vitvlkv/src/ThorsSerializer/build/vera-plusplus/build
    Scanning dependencies of target vera
    [  3%] Building CXX object src/CMakeFiles/vera.dir/main.cpp.o
    [  6%] Building CXX object src/CMakeFiles/vera.dir/plugins/Rules.cpp.o
    [ 10%] Building CXX object src/CMakeFiles/vera.dir/plugins/tcl/TclInterpreter.cpp.o
    [ 13%] Building CXX object src/CMakeFiles/vera.dir/plugins/tcl/cpptcl-1.1.4/cpptcl.cpp.o
    [ 17%] Building CXX object src/CMakeFiles/vera.dir/plugins/Exclusions.cpp.o
    [ 20%] Building CXX object src/CMakeFiles/vera.dir/plugins/lua/LuaInterpreter.cpp.o
    [ 24%] Building CXX object src/CMakeFiles/vera.dir/plugins/Reports.cpp.o
    [ 27%] Building CXX object src/CMakeFiles/vera.dir/plugins/Interpreter.cpp.o
    [ 31%] Building CXX object src/CMakeFiles/vera.dir/plugins/RootDirectory.cpp.o
    [ 34%] Building CXX object src/CMakeFiles/vera.dir/plugins/python/PythonInterpreter.cpp.o
    [ 37%] Building CXX object src/CMakeFiles/vera.dir/plugins/Parameters.cpp.o
    [ 41%] Building CXX object src/CMakeFiles/vera.dir/plugins/Transformations.cpp.o
    [ 44%] Building CXX object src/CMakeFiles/vera.dir/plugins/Profiles.cpp.o
    [ 48%] Building CXX object src/CMakeFiles/vera.dir/legacy_main.cpp.o
    [ 51%] Building CXX object src/CMakeFiles/vera.dir/get_vera_root_default.cpp.o
    [ 55%] Building CXX object src/CMakeFiles/vera.dir/structures/Tokens.cpp.o
    [ 58%] Building CXX object src/CMakeFiles/vera.dir/structures/SourceLines.cpp.o
    [ 62%] Building CXX object src/CMakeFiles/vera.dir/structures/SourceFiles.cpp.o
    [ 65%] Building CXX object src/CMakeFiles/vera.dir/executable_path.cpp.o
    [ 68%] Building CXX object src/CMakeFiles/vera.dir/boost_main.cpp.o
    [ 72%] Linking CXX executable vera++
    [ 72%] Built target vera
    Scanning dependencies of target style_reports
    [ 75%] Checking style with vera++ in src
    [ 79%] Checking style with vera++ in src/plugins
    [ 82%] Checking style with vera++ in src/plugins/lua
    [ 86%] Checking style with vera++ in src/plugins/python
    [ 89%] Checking style with vera++ in src/plugins/tcl
    [ 93%] Checking style with vera++ in src/plugins/tcl/cpptcl-1.1.4
    [ 96%] Checking style with vera++ in src/plugins/tcl/cpptcl-1.1.4/details
    [100%] Checking style with vera++ in src/structures
    [100%] Built target style_reports
    [ 72%] Built target vera
    [100%] Built target style_reports
    Install the project...
    -- Install configuration: ""
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/bin/vera++
    -- Set runtime path of "/home/vitvlkv/src/ThorsSerializer/build/bin/vera++" to ""
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T011.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T009.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T018.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T001.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T015.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/L006.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/M002.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T010.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T002.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T008B.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/L002.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T005.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/DUMP.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/M003.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T008.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T012.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/L003.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T008A.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T019.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/L001.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T009A.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T003.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T016.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/L004.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/Doc
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T006.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T007.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T004.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/M001.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/L005.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/F001.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T014.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T013.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/F002.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/rules/T017.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/transformations/move_macros.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/transformations/to_xml.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/transformations/move_includes.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/transformations/to_lower.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/transformations/trim_right.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/transformations/to_xml2.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/transformations/move_namespace.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/transformations/fullblock.tcl
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/profiles/full
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/profiles/thor
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/profiles/moz
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/profiles/default
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/profiles/boost
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/vera++-config-version.cmake
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/vera++-config.cmake
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/use_vera++.cmake
    -- Installing: /home/vitvlkv/src/ThorsSerializer/build/lib/vera++/test_wrapper.cmake.in
    ~/src/ThorsSerializer/build/third ~/src/ThorsSerializer
    ~/src/ThorsSerializer/build/googletest/googletest ~/src/ThorsSerializer/build/third
    ar: creating libgtest.a
    a - gtest-all.o
    a - gtest_main.o
    ~/src/ThorsSerializer/build/third
    Installing google test
    ~/src/ThorsSerializer/build ~/src/ThorsSerializer/build/third
    ~/src/ThorsSerializer/build/third
    ~/src/ThorsSerializer
    checking whether we are using the GNU C++ compiler... (cached) yes
    checking whether g++ accepts -g... (cached) yes
    checking for gcc... gcc
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking whether gcc understands -c and -o together... yes
    checking for flex... flex
    checking lex output file root... lex.yy
    checking lex library... -lfl
    checking whether yytext is a pointer... yes
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking how to print strings... printf
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 1572864
    checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
    checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking for gawk... gawk
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for a working dd... /bin/dd
    checking how to truncate binary pipes... /bin/dd bs=4096 count=1
    checking for mt... mt
    checking if mt is a manifest tool... no
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC -DPIC
    checking if gcc PIC flag -fPIC -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    checking how to run the C++ preprocessor... g++ -E
    checking for ld used by g++... /usr/bin/ld -m elf_x86_64
    checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
    checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking for g++ option to produce PIC... -fPIC -DPIC
    checking if g++ PIC flag -fPIC -DPIC works... yes
    checking if g++ static flag -static works... yes
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking dynamic linker characteristics... (cached) GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether C compiler accepts -ansi... yes
    checking whether C++ compiler accepts -std=c++11... yes
    checking whether C++ compiler accepts -std=c++14... yes
    checking whether C++ compiler accepts -std=c++17... yes
    checking whether C++ compiler accepts -std=c++1x... no
    checking whether C++ compiler accepts -std=c++1y... yes
    checking whether C++ compiler accepts -std=c++1z... yes
    checking Checking Compiler Compatibility g++ -std=c++17... good
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking whether make sets $(MAKE)... yes
    checking for style of include used by make... GNU
    checking whether make supports nested variables... yes
    checking dependency style of gcc... none
    checking dependency style of g++... none
    checking that generated files are newer than configure... done
    configure: creating ./config.status
    config.status: creating Makefile.extra
    config.status: creating Makefile.config
    config.status: creating src/Serialize/SerializeConfig.h
    config.status: creating src/BinaryRep/BinaryRepConfig.h
    config.status: executing libtool commands
    config.status: executing depfiles commands
    vitvlkv@sakura:~/src/ThorsSerializer$ make 
    Buiding src Start
    make -C src build PREFIX=/home/vitvlkv/src/ThorsSerializer/build CXXSTDVER=17
    make[1]: Entering directory '/home/vitvlkv/src/ThorsSerializer/src'
    Buiding Serialize Start
    make -C Serialize build PREFIX=/home/vitvlkv/src/ThorsSerializer/build CXXSTDVER=17
    make[2]: Entering directory '/home/vitvlkv/src/ThorsSerializer/src/Serialize'
    Building Objects for Testing and Coverage
    make[3]: Entering directory '/home/vitvlkv/src/ThorsSerializer/src/Serialize'
    Failed in Lexer Generator
    ERROR
    ========================================
    flex: unknown flag '-'.  For usage, try
    	flex --help
    /home/vitvlkv/src/ThorsSerializer/build/tools/Makefile:605: recipe for target 'JsonLexer.lex.cpp' failed
    make[3]: *** [JsonLexer.lex.cpp] Error 1
    make[3]: Leaving directory '/home/vitvlkv/src/ThorsSerializer/src/Serialize'
    /home/vitvlkv/src/ThorsSerializer/build/tools/Makefile:341: recipe for target 'run_test' failed
    make[2]: *** [run_test] Error 2
    make[2]: Leaving directory '/home/vitvlkv/src/ThorsSerializer/src/Serialize'
    /home/vitvlkv/src/ThorsSerializer/build/tools/Project.Makefile:33: recipe for target 'Serialize.dir' failed
    make[1]: *** [Serialize.dir] Error 2
    make[1]: Leaving directory '/home/vitvlkv/src/ThorsSerializer/src'
    /home/vitvlkv/src/ThorsSerializer/build/tools/Project.Makefile:33: recipe for target 'src.dir' failed
    make: *** [src.dir] Error 2
    
    opened by vlkv 16
  • [Linuxbrew] Trying to prepare v2.2.0 bottle but hitting compilation issues (tried GCC-11 and LLVM)

    [Linuxbrew] Trying to prepare v2.2.0 bottle but hitting compilation issues (tried GCC-11 and LLVM)

    Describe the bug Issue is building ThorsSerializer for Linux as part of Homebrew/Linuxbrew distribution.

    Attempt here: https://github.com/Homebrew/homebrew-core/pull/81472

    Trying with GCC-11 fails on coverage test linking BsonPrinter:

    g++-11 -o coverage/unittest.app -DCOVERAGE_test -DTHOR_COVERAGE      ERROR
    export RPATH=/usr/local/lib;
    g++-11 -o coverage/unittest.app coverage/SerSetTest.o coverage/PolyMorphicSerializerUniquePointerTest.o coverage/YamlPrinterTest.o coverage/DeprecatedTest.o coverage/TemplateTypeTest.o coverage/BankAccountTest.o coverage/SerDequeTest.o coverage/IgnoreUneededDataTest.o coverage/OverrideIdentiferToKeyMapTest.o coverage/SerVectorTest.o coverage/YamlParserTest.o coverage/SerMapTest.o coverage/SerInitializerListTest.o coverage/SerMemoryTest.o coverage/CornerCaseTest.o coverage/Issue72Test.o coverage/unittest.o coverage/SerMultiMapTest.o coverage/SerUnorderedMultiSetTest.o coverage/Issue42Test.o coverage/SerTuppleTest.o coverage/BsonParserTest.o coverage/SerUnorderedSetTest.o coverage/HomeBrewTest.o coverage/Issue49Test.o coverage/EscapeControlTest.o coverage/RoundTripTest.o coverage/StaticMemberTest.o coverage/SerializeEnumTest.o coverage/Issue50Test.o coverage/LexerTest.o coverage/SerUnorderedMapTest.o coverage/SerListTest.o coverage/Logging.o coverage/ReferenceWrapperTest.o coverage/SerializeTest.o coverage/PolymorphicTest.o coverage/BsonUtilitySerializationTest.o coverage/ParserInterfaceTest.o coverage/BsonLongArrayTest.o coverage/SmartPointerTest.o coverage/PointerTest.o coverage/BsonPrinterTest.o coverage/JsonPrinterTest.o coverage/SerUnorderedMultiMapTest.o coverage/SerMultiSetTest.o coverage/Issue38Test.o coverage/JsonParserTest.o coverage/TwitterTest.o coverage/UnicodeIteratorTest.o coverage/Issue51Test.o coverage/SerArrayTest.o coverage/ExceptionWhilePrintingTest.o coverage/FilterValuesTest.o coverage/unittest.o -L./coverage -lUnitTest -L../coverage -L/tmp/thors-serializer-20210719-9466-1qqwrfl/build/dlib -L/tmp/thors-serializer-20210719-9466-1qqwrfl/build/lib -lgtest -fprofile-arcs -ftest-coverage -lpthread -L/tmp/thors-serializer-20210719-9466-1qqwrfl/build/lib -lThorsLogging17D -L/usr/local/lib -lyaml -ldl
    ===================================================
    /home/linuxbrew/.linuxbrew/bin/ld: coverage/PolyMorphicSerializerUniquePointerTest.o: in function `ThorsAnvil::Serialize::SerializeMember<PolyMorphicSerializerUniquePointerTest::AbstractTourResult, std::unique_ptr<PolyMorphicSerializerUniquePointerTest::Quantities, std::default_delete<PolyMorphicSerializerUniquePointerTest::Quantities> >, ThorsAnvil::Serialize::Traits<std::remove_cv<std::unique_ptr<PolyMorphicSerializerUniquePointerTest::Quantities, std::default_delete<PolyMorphicSerializerUniquePointerTest::Quantities> > >::type>::type> ThorsAnvil::Serialize::make_SerializeMember<PolyMorphicSerializerUniquePointerTest::AbstractTourResult, std::unique_ptr<PolyMorphicSerializerUniquePointerTest::Quantities, std::default_delete<PolyMorphicSerializerUniquePointerTest::Quantities> > >(ThorsAnvil::Serialize::Serializer&, ThorsAnvil::Serialize::PrinterInterface&, PolyMorphicSerializerUniquePointerTest::AbstractTourResult const&, std::pair<char const*, std::unique_ptr<PolyMorphicSerializerUniquePointerTest::Quantities, std::default_delete<PolyMorphicSerializerUniquePointerTest::Quantities> > PolyMorphicSerializerUniquePointerTest::AbstractTourResult::*> const&) [clone .isra.0]':
    PolyMorphicSerializerUniquePointerTest.cpp:(.text+0xa3c): undefined reference to `void ThorsAnvil::Serialize::BsonPrinter::writeInt<4ul, int>(int)'
    /home/linuxbrew/.linuxbrew/bin/ld: coverage/PolyMorphicSerializerUniquePointerTest.o: in function `ThorsAnvil::Serialize::BsonPrinter::addValue(int)':
    PolyMorphicSerializerUniquePointerTest.cpp:(.text._ZN10ThorsAnvil9Serialize11BsonPrinter8addValueEi[_ZN10ThorsAnvil9Serialize11BsonPrinter8addValueEi]+0xd): undefined reference to `void ThorsAnvil::Serialize::BsonPrinter::writeInt<4ul, int>(int)'
    /home/linuxbrew/.linuxbrew/bin/ld: coverage/Issue42Test.o: in function `ThorsAnvil::Serialize::BsonPrinter::addValue(double)':
    Issue42Test.cpp:(.text._ZN10ThorsAnvil9Serialize11BsonPrinter8addValueEd[_ZN10ThorsAnvil9Serialize11BsonPrinter8addValueEd]+0xd): undefined reference to `void ThorsAnvil::Serialize::BsonPrinter::writeFloat<8ul, double>(double)'
    /home/linuxbrew/.linuxbrew/bin/ld: coverage/Issue42Test.o: in function `void ThorsAnvil::Serialize::printPolyMorphicObject<Issue42Test::Vehicle>(ThorsAnvil::Serialize::Serializer&, ThorsAnvil::Serialize::PrinterInterface&, Issue42Test::Vehicle const&)':
    Issue42Test.cpp:(.text._ZN10ThorsAnvil9Serialize22printPolyMorphicObjectIN11Issue42Test7VehicleEEEvRNS0_10SerializerERNS0_16PrinterInterfaceERKT_[_ZN10ThorsAnvil9Serialize22printPolyMorphicObjectIN11Issue42Test7VehicleEEEvRNS0_10SerializerERNS0_16PrinterInterfaceERKT_]+0x1e1): undefined reference to `void ThorsAnvil::Serialize::BsonPrinter::writeInt<4ul, int>(int)'
    /home/linuxbrew/.linuxbrew/bin/ld: coverage/BsonPrinterTest.o: in function `BsonPrinterTest_ArrayWithArrayValues_Test::TestBody()':
    BsonPrinterTest.cpp:(.text+0x25a8): undefined reference to `void ThorsAnvil::Serialize::BsonPrinter::writeInt<4ul, int>(int)'
    /home/linuxbrew/.linuxbrew/bin/ld: BsonPrinterTest.cpp:(.text+0x25d5): undefined reference to `void ThorsAnvil::Serialize::BsonPrinter::writeFloat<8ul, double>(double)'
    /home/linuxbrew/.linuxbrew/bin/ld: BsonPrinterTest.cpp:(.text+0x25ea): undefined reference to `void ThorsAnvil::Serialize::BsonPrinter::writeInt<8ul, long>(long)'
    /home/linuxbrew/.linuxbrew/bin/ld: BsonPrinterTest.cpp:(.text+0x25ff): undefined reference to `void ThorsAnvil::Serialize::BsonPrinter::writeInt<8ul, long long>(long long)'
    

    Also, GCC doesn't like copyright character and we needed to strip that out of file:

    In file included from FrameTest.cpp:51:
    testlist.h:7:13: error: extended character © is not valid in an identifier
        7 | # Copyright © 2013 Bart Massey
          |             ^
    

    We also tried with LLVM-12, but it also had issues.

    Expected behavior Successfully build for Linux via Linuxbrew since it is documented installation method in repo. We are also trying to merge Linuxbrew into Homebrew and want to bottle (pre-build) everything for Linux.

    Environment: GitHub CI: https://github.com/Homebrew/homebrew-core/runs/3111009018

    • OS:

    uname -a

    Can't run command, but general details are:

    Kernel: Linux 5.8.0-1036-azure x86_64 GNU/Linux
    OS: Ubuntu 16.04.7 LTS (xenial)
    Host glibc: 2.23
    

    This is a Docker container running on GitHub ubuntu-latest

    • Compiler and Version

    g++ --version

    Running Homebrew/Linuxbrew GCC-11 https://github.com/Homebrew/homebrew-core/blob/master/Formula/gcc.rb

    Additional context

    Add any other context about the problem here.

    opened by cho-m 10
  • MakeTrait: error: unable to deduce 'std::initializer_list<auto>'

    MakeTrait: error: unable to deduce 'std::initializer_list'

    OK, I refreshed my code from the latest master to get the Filter implementation. I see quite a few changes since my last pull!

    Regardless, I am running into the following error now with a simple test case.

    Using the filter test code:

    struct FilterTestType
    {
        std::string     m1;
        std::string     m2;
    
        std::map<std::string, bool> filter;
    };
    
    ThorsAnvil_MakeFilter(FilterTestType, filter);
    ThorsAnvil_MakeTrait(FilterTestType, m1, m2);
    

    I am hitting the following error:

    /ThorSerialize/Traits.h:580:18: error: unable to deduce 'std::initializer_list<auto>' from '{std::make_pair<long unsigned int, long unsigned int>(0, 0), ThorsAnvil::Serialize::Traits<FilterTestType>::addSizeEachMemberItem<std::pair<const char*, std::__cxx11::basic_string<char> FilterTestType::*> >((* & printer), (* & object), (* & std::get<0, std::pair<const char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > FilterTestType::*>, std::pair<const char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > FilterTestType::*> >((* & members)))), ThorsAnvil::Serialize::Traits<FilterTestType>::addSizeEachMemberItem<std::pair<const char*, std::__cxx11::basic_string<char> FilterTestType::*> >((* & printer), (* & object), (* & std::get<1, std::pair<const char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > FilterTestType::*>, std::pair<const char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > FilterTestType::*> >((* & members))))}'
      580 |             auto sizeData = {std::make_pair(0UL, 0UL), addSizeEachMemberItem(printer, object, std::get<Seq>(members))...};              \
          |                  ^~~~~~~~
    /ThorSerialize/Traits.h:624:5: note: in expansion of macro 'ThorsAnvil_MakeTrait_Base'
      624 |     ThorsAnvil_MakeTrait_Base( , Map, 00, __VA_ARGS__, 1);              \
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~
    ../source/test_thors.h:31:1: note: in expansion of macro 'ThorsAnvil_MakeTrait'
       31 | ThorsAnvil_MakeTrait(FilterTestType, m1, m2);
          | ^~~~~~~~~~~~~~~~~~~~
    /ThorSerialize/Traits.h:580:18: note:   deduced conflicting types for parameter 'auto' ('std::pair<long unsigned int, long unsigned int>' and 'std::pair<unsigned int, unsigned int>')
      580 |             auto sizeData = {std::make_pair(0UL, 0UL), addSizeEachMemberItem(printer, object, std::get<Seq>(members))...};              \
          |                  ^~~~~~~~
    /ThorSerialize/Traits.h:624:5: note: in expansion of macro 'ThorsAnvil_MakeTrait_Base'
      624 |     ThorsAnvil_MakeTrait_Base( , Map, 00, __VA_ARGS__, 1);              \
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~
    ../source/test_thors.h:31:1: note: in expansion of macro 'ThorsAnvil_MakeTrait'
       31 | ThorsAnvil_MakeTrait(FilterTestType, m1, m2);
          | ^~~~~~~~~~~~~~~~~~~~
    

    This is way over my head, but hopefully I can get it resolved.

    opened by ripe909 9
  • Deserializing to existing object with vectors/pointers?

    Deserializing to existing object with vectors/pointers?

    This is more of a question than a bug. Hopefully it makes sense.

    If I have a pre-existing object instance which includes a nested tree of vectors and pointers (see my previous issue), can I deserialize to this existing object when some of the vector sizes and pointer locations must change because the serialized data is different than the existing object?

    For example, the existing object before deserialization has a member vector of size 2, but the incoming deserialization requires this vector to grow to size 4. In my preliminary tests, this isn’t working, and the existing vector stays at size 2. Others values (ints) are updating correctly.

    EDIT: OK, now I'm not even sure how to deserialize to an object if it is new. I don't see any examples for deserialization of objects in the docs.

    Using the code from my previous example:

    class level8_cont
    {
    public:
    	std::array<int, 3> array9 = { 1, 2, 3 };
    };
    class level7
    {
    public:
    	level7()
    	{
    		levels8.emplace_back();
    	}
    	std::vector<level8_cont> levels8;
    };
    class level6_cont
    {
    public:
    	level6_cont()
    	{
    		nextLevel7 = new level7();
    	}
    	level7 *nextLevel7;
    };
    class level5
    {
    public:
    	level5()
    	{
    		levels6.emplace_back();
    	}
    	std::vector<level6_cont> levels6;
    };
    class level4_cont
    {
    public:
    	level4_cont()
    	{
    		nextLevel5 = new level5();
    	}
    	level5 *nextLevel5;
    };
    class level3
    {
    public:
    	level3()
    	{
    		levels4.emplace_back();
    	}
    	std::vector<level4_cont> levels4;
    };
    class level2_cont
    {
    public:
    	level2_cont()
    	{
    		nextLevel3 = new level3();
    	}
    	level3 *nextLevel3;
    };
    class level1
    {
    public:
    	level1()
    	{
    		levels2.emplace_back();
    	}
    
    	std::vector<level2_cont> levels2;
    };
    
    ThorsAnvil_MakeTrait(level1, levels2);
    ThorsAnvil_MakeTrait(level2_cont, nextLevel3);
    ThorsAnvil_MakeTrait(level3, levels4);
    ThorsAnvil_MakeTrait(level4_cont, nextLevel5);
    ThorsAnvil_MakeTrait(level5, levels6);
    ThorsAnvil_MakeTrait(level6_cont, nextLevel7);
    ThorsAnvil_MakeTrait(level7, levels8);
    ThorsAnvil_MakeTrait(level8_cont, array9);
    
    using ThorsAnvil::Serialize::jsonExport;
    using ThorsAnvil::Serialize::jsonImport;
    
    // Use the export function to serialize
    level1* levelTest;
    levelTest = new level1();
    std::cout << jsonExport(*levelTest) << "\n";
    
    

    Assuming the incoming deserialized object does not have the same vector sizes as the existing object, should the deserialize for this object look like this? (Also assume the destructors of the classes existed to delete the objects pointed to by member pointers)

    delete levelTest;
    inputStream >> jsonImport(*levelTest);
    
    

    Also, I want say a huge Thank You! for this library, it has been exactly what I needed.

    opened by ripe909 8
  • Include headers in header file - multiple definition

    Include headers in header file - multiple definition

    Hello, I try to write serializer service with ThorsSerializer but I have problems with including header file. serializerService.h

    #pragma once
    
    #include <string>
    #include "ThorSerialize/SerUtil.h"
    #include "ThorSerialize/JsonThor.h"
    
    class SerializerService {
    public:
    
        template <class T>
        std::string serialize(T &entity){
            using ThorsAnvil::Serialize::jsonExport;
            using ThorsAnvil::Serialize::PrinterInterface;
    
            std::stringstream stream;
            stream << jsonExport(entity, PrinterInterface::OutputType::Stream);
            return stream.str();
        };
    };
    

    serializerService.cpp

    #include "serializerService.h"
    

    mainEndpoint.cpp

    #include <user.h>
    #include "serializerService.h"
    #include "mainEndpoint.h"
    
    
    void MainEndpoint::doMain(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
    
        User user("[email protected]");
        user.setUsername("admin");
    
        SerializerService serializer;
    
        std::string data = serializer.serialize(user);
    
    
        response.cookies()
                .add(Pistache::Http::Cookie("lang", "pl_PL"));
        response.headers()
                .add<Pistache::Http::Header::Server>("Sandbox server v0.1")
                .add<Pistache::Http::Header::ContentType>(MIME(Application, Json));
    //    response.send(Pistache::Http::Code::Ok, "{}");
        response.send(Pistache::Http::Code::Ok, data);
    }
    

    When I try to link this (with multiple include header file serializerService.h which includes ThrosSerializer headers I got errors:

    ====================[ Build | sandbox | Debug ]=================================
    /home/marcin/Programs/clion-2019.1.3/bin/cmake/linux/bin/cmake --build /home/marcin/CLionProjects/sandbox/cmake-build-debug --target sandbox -- -j 8
    [ 76%] Built target pistache
    Scanning dependencies of target sandbox
    [ 80%] Building CXX object CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o
    [ 84%] Linking CXX executable sandbox
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::ParserInterface::ignoreValue()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/Serialize.source:6: multiple definition of `ThorsAnvil::Serialize::ParserInterface::ignoreValue()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/Serialize.source:6: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::ParserInterface::ignoreTheValue()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/Serialize.source:47: multiple definition of `ThorsAnvil::Serialize::ParserInterface::ignoreTheValue()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/Serialize.source:47: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::ParserInterface::ignoreTheMap()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/Serialize.source:15: multiple definition of `ThorsAnvil::Serialize::ParserInterface::ignoreTheMap()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/Serialize.source:15: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::ParserInterface::ignoreTheArray()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/Serialize.source:27: multiple definition of `ThorsAnvil::Serialize::ParserInterface::ignoreTheArray()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/Serialize.source:27: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::JsonManualLexer(std::istream&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:10: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::JsonManualLexer(std::istream&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:10: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::JsonManualLexer(std::istream&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:10: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::JsonManualLexer(std::istream&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:10: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::yylex()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:16: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::yylex()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:16: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::readTrue()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:65: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::readTrue()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:65: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::readFalse()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:70: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::readFalse()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:70: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::readNull()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:75: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::readNull()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:75: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::readNumber(int)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:182: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::readNumber(int)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:182: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::checkFixed(char const*, unsigned long)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:240: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::checkFixed(char const*, unsigned long)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:240: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::ignoreRawValue()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:80: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::ignoreRawValue()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:80: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::error()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:251: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::error()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:251: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::getRawString[abi:cxx11]()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:98: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::getRawString[abi:cxx11]()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:98: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::getString[abi:cxx11]()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:147: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::getString[abi:cxx11]()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:147: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::getLastBool() const':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:152: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::getLastBool() const'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:152: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::isLastNull() const':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:164: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::isLastNull() const'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:164: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonManualLexer::readDigits(char)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:169: multiple definition of `ThorsAnvil::Serialize::JsonManualLexer::readDigits(char)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonManualLexer.source:169: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::JsonParser(std::istream&, ThorsAnvil::Serialize::ParserInterface::ParserConfig)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:12: multiple definition of `ThorsAnvil::Serialize::JsonParser::JsonParser(std::istream&, ThorsAnvil::Serialize::ParserInterface::ParserConfig)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:12: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::JsonParser(std::istream&, ThorsAnvil::Serialize::ParserInterface::ParserConfig)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:12: multiple definition of `ThorsAnvil::Serialize::JsonParser::JsonParser(std::istream&, ThorsAnvil::Serialize::ParserInterface::ParserConfig)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:12: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getNextToken()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:21: multiple definition of `ThorsAnvil::Serialize::JsonParser::getNextToken()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:21: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getString[abi:cxx11]()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:139: multiple definition of `ThorsAnvil::Serialize::JsonParser::getString[abi:cxx11]()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:139: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getRawString[abi:cxx11]()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:143: multiple definition of `ThorsAnvil::Serialize::JsonParser::getRawString[abi:cxx11]()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:143: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::ignoreDataValue()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:147: multiple definition of `ThorsAnvil::Serialize::JsonParser::ignoreDataValue()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:147: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getKey[abi:cxx11]()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:152: multiple definition of `ThorsAnvil::Serialize::JsonParser::getKey[abi:cxx11]()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:152: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(short&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:162: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(short&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:162: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(int&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:163: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(int&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:163: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(long&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:164: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(long&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:164: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(long long&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:165: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(long long&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:165: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(unsigned short&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:167: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(unsigned short&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:167: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(unsigned int&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:168: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(unsigned int&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:168: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(unsigned long&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:169: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(unsigned long&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:169: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(unsigned long long&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:170: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(unsigned long long&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:170: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(float&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:172: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(float&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:172: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(double&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:173: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(double&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:173: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(long double&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:174: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(long double&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:174: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(bool&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:177: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(bool&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:177: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:182: multiple definition of `ThorsAnvil::Serialize::JsonParser::getValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:182: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::isValueNull()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:187: multiple definition of `ThorsAnvil::Serialize::JsonParser::isValueNull()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:187: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonParser::getRawValue[abi:cxx11]()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:192: multiple definition of `ThorsAnvil::Serialize::JsonParser::getRawValue[abi:cxx11]()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonParser.source:192: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::JsonPrinter(std::ostream&, ThorsAnvil::Serialize::PrinterInterface::PrinterConfig)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:112: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::JsonPrinter(std::ostream&, ThorsAnvil::Serialize::PrinterInterface::PrinterConfig)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:112: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::JsonPrinter(std::ostream&, ThorsAnvil::Serialize::PrinterInterface::PrinterConfig)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:112: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::JsonPrinter(std::ostream&, ThorsAnvil::Serialize::PrinterInterface::PrinterConfig)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:112: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::openDoc()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:119: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::openDoc()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:119: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::closeDoc()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:121: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::closeDoc()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:121: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::openMap()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:124: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::openMap()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:124: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::closeMap()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:129: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::closeMap()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:129: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::openArray(unsigned long)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:138: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::openArray(unsigned long)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:138: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::closeArray()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:143: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::closeArray()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:143: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:153: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:153: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(short)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:179: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(short)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:179: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(int)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:180: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(int)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:180: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(long)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:181: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(long)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:181: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(long long)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:182: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(long long)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:182: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(unsigned short)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:184: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(unsigned short)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:184: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(unsigned int)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:185: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(unsigned int)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:185: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(unsigned long)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:186: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(unsigned long)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:186: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(unsigned long long)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:187: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(unsigned long long)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:187: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(float)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:189: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(float)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:189: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(double)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:190: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(double)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:190: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(long double)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:191: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(long double)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:191: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(bool)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:193: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(bool)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:193: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:200: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:200: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addRawValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:277: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addRawValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:277: first defined here
    /usr/bin/ld: CMakeFiles/sandbox.dir/src/Endpoint/mainEndpoint.cpp.o: in function `ThorsAnvil::Serialize::JsonPrinter::addNull()':
    /home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:279: multiple definition of `ThorsAnvil::Serialize::JsonPrinter::addNull()'; CMakeFiles/sandbox.dir/src/Service/serializerService.cpp.o:/home/marcin/CLionProjects/sandbox/lib/ThorsSerializer/ThorSerialize/JsonPrinter.source:279: first defined here
    collect2: error: ld returned 1 exit status
    

    When I change my method to return simple text, disablig include lines with serializer I can include my header file anywhere.

    opened by nicraMarcin 8
  • Derived class without new members

    Derived class without new members

    I implement the webservice for a given API and I am forced to have a derived class with no new members in it (the external API wants that). But ThorsAnvil_ExpandTrait expects to give a list of members.

    So this code

    struct Derived : public Base {
        ~Derived() override = default;
        ThorsAnvil_PolyMorphicSerializer(Derived);
    };
    
    ThorsAnvil_ExpandTrait(Base, Derived);
    

    does not compile:

    error: expected unqualified-id
    ThorsAnvil_ExpandTrait(Base, Derived);
    ^
    /usr/local/include/ThorSerialize/Traits.h:277:5: note: expanded from macro 'ThorsAnvil_ExpandTrait'
        ThorsAnvil_MakeTrait_Base(ThorsAnvil_Parent(0, ParentType, DataType, __VA_ARGS__, 1), Parent, 0, DataType, __VA_ARGS__, 1); \
    
    opened by ghost 7
  • Optional and required values

    Optional and required values

    Hi,

    I would like to use your lib with the following use-case:

    • JSON input can contain more values than the class has members
    • Some JSON values are optional, so I use pointers in the class
    • Some values are required, and I want an exception if it is missing

    How do I get the behavior that

    • class members that are pointers are imported as nullptr when missing in JSON
    • JSON values that have no class members are ignored
    • class members that are no pointers have to be present in the JSON, otherwise, an exception should be thrown

    The following code has all 4 examples I consider: Is there a way to make t1, t2 and t3 work and let import into t4 throw an exception?

    #include <iostream>
    
    #include <ThorSerialize/JsonThor.h>
    #include <ThorSerialize/Traits.h>
    
    using namespace std;
    using namespace ThorsAnvil::Serialize;
    
    struct Test {
        int num;
        int* optionalNum;
        ~Test() { delete optionalNum; }
    };
    
    ThorsAnvil_MakeTrait(Test, num, optionalNum);
    
    int main()
    {
        using PT = ParserInterface::ParseType;
        Test t1, t2, t3, t4;
    
        // should work perfectly: works
        string twoVals = R"( {"num": 42, "optionalNum": 43} )";
        istringstream(twoVals) >> jsonImport(t1, PT::Weak);
        cout << jsonExport(t1) << endl;
    
        // ignoring additional values is fine: works
        string threeVals = R"( {"num": 42, "optionalNum": 43, "tooMany": 44} )";
        istringstream(threeVals) >> jsonImport(t2, PT::Weak);
        cout << jsonExport(t2) << endl;
    
        // non-defined pointer members are nullptr: works
        string oneVal = R"( {"num": 42} )";
        istringstream(oneVal) >> jsonImport(t3, PT::Weak);
        cout << jsonExport(t3) << endl;
    
        // class T has a member "num" which is missing in the JSON -> exception?
        string zeroVals = "{}";
        istringstream(zeroVals) >> jsonImport(t4, PT::Weak);
        cout << jsonExport(t4) << endl;
    
        return 0;
    }
    

    Thanks

    Example 
    opened by ghost 7
  • Serialize.h:169:88: error: ‘std::index_sequence’ has not been declared

    Serialize.h:169:88: error: ‘std::index_sequence’ has not been declared

    Hi, I've managed to install Thor yesterday (after removing all vera++ stuff (--disable-vera didn't work)).

    Now I'm trying to use it in my project and I'm getting multiple Errors, starting with the one in the title.

    Here is the full log:

    In file included from /usr/local/include/ThorSerialize/JsonParser.h:20:0, from /usr/local/include/ThorSerialize/JsonThor.h:14, from /home/mimre/workspace/isosurfaces/json/JSONHandler.h:8, from /home/mimre/workspace/isosurfaces/json/JSONHandler.cpp:5: /usr/local/include/ThorSerialize/Serialize.h:169:88: error: ‘std::index_sequence’ has not been declared void scanEachMember(std::string const& key, T& object, Members const& member, std::index_sequence<Seq...> const&); ^~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.h:169:102: error: expected ‘,’ or ‘...’ before ‘<’ token void scanEachMember(std::string const& key, T& object, Members const& member, std::index_sequence<Seq...> const&); ^ /usr/local/include/ThorSerialize/Serialize.h:200:71: error: ‘std::index_sequence’ has not been declared void printEachMember(T const& object, Members const& member, std::index_sequence<Seq...> const&); ^~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.h:200:85: error: expected ‘,’ or ‘...’ before ‘<’ token void printEachMember(T const& object, Members const& member, std::index_sequence<Seq...> const&); ^ In file included from /usr/local/include/ThorSerialize/Serialize.h:294:0, from /usr/local/include/ThorSerialize/JsonParser.h:20, from /usr/local/include/ThorSerialize/JsonThor.h:14, from /home/mimre/workspace/isosurfaces/json/JSONHandler.h:8, from /home/mimre/workspace/isosurfaces/json/JSONHandler.cpp:5: /usr/local/include/ThorSerialize/Serialize.tpp:255:105: error: ‘std::index_sequence’ has not been declared inline void DeSerializer::scanEachMember(std::string const& key, T& object, Members const& member, std::index_sequence<Seq...> const&) ^~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:255:119: error: expected ‘,’ or ‘...’ before ‘<’ token inline void DeSerializer::scanEachMember(std::string const& key, T& object, Members const& member, std::index_sequence<Seq...> const&) ^ /usr/local/include/ThorSerialize/Serialize.tpp: In member function ‘void ThorsAnvil::Serialize::DeSerializer::scanMembers(const string&, T&, const std::tuple<_Elements ...>&)’: /usr/local/include/ThorSerialize/Serialize.tpp:264:42: error: ‘make_index_sequence’ is not a member of ‘std’ scanEachMember(key, object, members, std::make_index_sequence<sizeof...(Members)>()); ^~~ /usr/local/include/ThorSerialize/Serialize.tpp:264:87: error: expected primary-expression before ‘)’ token scanEachMember(key, object, members, std::make_index_sequence<sizeof...(Members)>()); ^ /usr/local/include/ThorSerialize/Serialize.tpp: At global scope: /usr/local/include/ThorSerialize/Serialize.tpp:421:86: error: ‘std::index_sequence’ has not been declared inline void Serializer::printEachMember(T const& object, Members const& member, std::index_sequence<Seq...> const&) ^~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:421:100: error: expected ‘,’ or ‘...’ before ‘<’ token inline void Serializer::printEachMember(T const& object, Members const& member, std::index_sequence<Seq...> const&) ^ /usr/local/include/ThorSerialize/Serialize.tpp: In member function ‘void ThorsAnvil::Serialize::Serializer::printMembers(const T&, const std::tuple<_Elements ...>&)’: /usr/local/include/ThorSerialize/Serialize.tpp:430:38: error: ‘make_index_sequence’ is not a member of ‘std’ printEachMember(object, members, std::make_index_sequence<sizeof...(Members)>()); ^~~ /usr/local/include/ThorSerialize/Serialize.tpp:430:83: error: expected primary-expression before ‘)’ token printEachMember(object, members, std::make_index_sequence<sizeof...(Members)>()); ^ In file included from /usr/local/include/ThorSerialize/Serialize.h:34:0, from /usr/local/include/ThorSerialize/JsonParser.h:20, from /usr/local/include/ThorSerialize/JsonThor.h:14, from /home/mimre/workspace/isosurfaces/json/JSONHandler.h:8, from /home/mimre/workspace/isosurfaces/json/JSONHandler.cpp:5: /home/mimre/workspace/isosurfaces/json/JSONHandler.cpp: In member function ‘void json::JSONHandler::saveJSON(RunInformation)’: /home/mimre/workspace/isosurfaces/json/JSONHandler.cpp:13:5: error: ‘namespace’ definition is not allowed here ThorsAnvil_MakeTrait(RunInformation, dimensions, variables, volumens, similarityMaps); ^ /home/mimre/workspace/isosurfaces/json/JSONHandler.cpp:13:5: error: static assertion failed: The macro ThorsAnvil_MakeTrait must be used outside all namespace. ThorsAnvil_MakeTrait(RunInformation, dimensions, variables, volumens, similarityMaps); ^ In file included from /usr/local/include/ThorSerialize/Serialize.h:294:0, from /usr/local/include/ThorSerialize/JsonParser.h:20, from /usr/local/include/ThorSerialize/JsonThor.h:14, from /home/mimre/workspace/isosurfaces/json/JSONHandler.h:8, from /home/mimre/workspace/isosurfaces/json/JSONHandler.cpp:5: /usr/local/include/ThorSerialize/Serialize.tpp: In instantiation of ‘class ThorsAnvil::Serialize::SerializerForBlock<(ThorsAnvil::Serialize::TraitType)0, RunInformation>’: /usr/local/include/ThorSerialize/Serialize.tpp:442:48: required from ‘void ThorsAnvil::Serialize::Serializer::print(const T&) [with T = RunInformation]’ /usr/local/include/ThorSerialize/Exporter.h:32:13: required from ‘std::ostream& ThorsAnvil::Serialize::operator<<(std::ostream&, const ThorsAnvil::Serialize::Exporter<ThorsAnvil::Serialize::Json, RunInformation>&)’ /home/mimre/workspace/isosurfaces/json/JSONHandler.cpp:18:35: required from here /usr/local/include/ThorSerialize/Serialize.tpp:294:5: error: static assertion failed: Invalid Serialize TraitType. This usually means you have not define ThorsAnvil::Serialize::Traits<Your Type> static_assert( ^~~~~~~~~~~~~

    I also was wondering where to put the "ThorsAnvil_MakeTrait"?

    Thanks for any help :)

    opened by mimre25 7
  • Tags with header only

    Tags with header only

    Is your feature request related to a problem? Please describe. "I'm always frustrated when..." it is said there should be a single header file and I can't find it. Even more frustrating, when there is no CMake but old Makefiles (no complains to developers, just our system is CMake centric, so it is our problem, but still...)

    Describe the solution you'd like Just make those header only version easy to download and attach to tags

    Describe alternatives you've considered Use another library

    opened by DraTeots 6
  • Invalid enum values causes undefined behavior

    Invalid enum values causes undefined behavior

    When an invalid enum class value is serialized, it doesn't throw an exception, instead undefined behavior occurs.

    Code:

    #include <iostream>
    
    #include "ThorSerialize/JsonThor.h"
    #include "ThorSerialize/Traits.h"
    
    enum class ENUM : uint8_t { AAAAA, BBBBB, CCCCC };
    struct CLASS {
      ENUM val = ENUM::AAAAA;
      int y = 5;
    };
    
    ThorsAnvil_MakeEnum(ENUM, AAAAA, BBBBB, CCCCC);
    ThorsAnvil_MakeTrait(CLASS, val, y);
    
    int main(int /*argc*/, char* argv[]) {
      using ThorsAnvil::Serialize::jsonExporter;
      CLASS a;
      a.val = static_cast<ENUM>(5);
    
      ThorsAnvil::Serialize::PrinterInterface::PrinterConfig config;
      config.catchExceptions = false;
    
      std::cout << jsonExporter(a, config) << std::endl;
      return 0;
    }
    

    Run with:

    g++ -std=c++17 -Ibuild/include -Lbuild/lib doc/example_issue.cpp -lThorSerialize17 -lThorsLogging17 -lThorsStorage17 -ldl -o example_issue
    sudo ldconfig /home/adoff/Documents/git/ThorsSerializer/build/lib
    ./example_issue
    

    Output:

    	{ 
    		"val": "", 
    		"y": 5
    	}
    

    This output was on my machine, but on an ARM platform this actually crashed the application. I would expect an exception to be thrown.

    Environment:

    16:42 $ uname -a
    Linux adoff-ThinkPad-T590 5.4.0-125-generic #141-Ubuntu SMP Wed Aug 10 13:42:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
    

    Compiler:

    16:42 $ g++ -v
    Using built-in specs.
    COLLECT_GCC=g++
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
    OFFLOAD_TARGET_NAMES=nvptx-none:hsa
    OFFLOAD_TARGET_DEFAULT=1
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    Thread model: posix
    gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
    
    opened by DonDoff 0
  • Make Trait does not work for types with static members with non-standard types

    Make Trait does not work for types with static members with non-standard types

    When I make trait for type with static memder of standard type (int, double, etc.) it works fine. When I make trait for type1 with static memder of non-standard type2 (my own class), even I previously make traits for type2, making trait fore type1 does not work.

    A minimal compilable example of that features the bug.

    main.cpp

    #include #include <ThorSerialize/JsonThor.h> #include <ThorSerialize/SerUtil.h>

    struct Type1 { int a; }; struct Type2 { static int b; static Type1 c; };

    ThorsAnvil_MakeTrait(Type1, a); ThorsAnvil_MakeTrait(Type2, b, c);

    using ThorsAnvil::Serialize::jsonExport; using ThorsAnvil::Serialize::jsonImport; int main(int argc, char* argv[]) { std::fstream fileStream; Type2 entity; fileStream >> jsonImport(entity); fileStream << jsonExport(entity); return 0; }

    A description of how to build and run the code

    g++ -std=c++14 -I/usr/local/include -L/usr/local/lib -lThorSerialize17 main.cpp
    cat stuff | ./a.out
    

    Expected behavior

    compile OK

    Environment:

    • OS:

    uname -a Linux gladijos-desktop 5.4.0-47-generic #51~18.04.1-Ubuntu SMP Sat Sep 5 14:35:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

    • Compiler and Version

    g++ --version g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 Copyright (C) 2017 Free Software Foundation, Inc.

    Additional context

    I got compile-time error In file included from /usr/local/include/ThorSerialize/Serialize.h:429:0, from /usr/local/include/ThorSerialize/JsonParser.h:20, from /usr/local/include/ThorSerialize/JsonThor.h:14, from main.cpp:2: /usr/local/include/ThorSerialize/Serialize.tpp: In instantiation of ‘ThorsAnvil::Serialize::DeSerializeMember<T, M> ThorsAnvil::Serialize::make_DeSerializeMember(ThorsAnvil::Serialize::DeSerializer&, ThorsAnvil::Serialize::ParserInterface&, const string&, T&, const std::pair<const char*, M*>&) [with T = Type2; M = Type1; std::__cxx11::string = std::__cxx11::basic_string]’: /usr/local/include/ThorSerialize/Serialize.tpp:508:73: required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanEachMember(const string&, T&, const Members&, std::index_sequence<Seq ...>&) [with T = Type2; Members = std::tuple<std::pair<const char*, int*>, std::pair<const char*, Type1*> >; long unsigned int ...Seq = {0, 1}; std::__cxx11::string = std::__cxx11::basic_string; std::index_sequence<Seq ...> = std::integer_sequence<long unsigned int, 0, 1>]’ /usr/local/include/ThorSerialize/Serialize.tpp:515:95: required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanMembers(const string&, T&, const std::tuple<_Elements ...>&) [with T = Type2; Members = {std::pair<const char*, int*>, std::pair<const char*, Type1*>}; std::__cxx11::string = std::__cxx11::basic_string]’ /usr/local/include/ThorSerialize/Serialize.tpp:531:17: required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanObjectMembers(const I&, T&) [with T = Type2; I = std::__cxx11::basic_string]’ /usr/local/include/ThorSerialize/Serialize.tpp:196:21: required from ‘void ThorsAnvil::Serialize::DeSerializationForBlock<traitType, T>::scanObject(T&) [with ThorsAnvil::Serialize::TraitType traitType = (ThorsAnvil::Serialize::TraitType)3; T = Type2]’ /usr/local/include/ThorSerialize/Serialize.tpp:541:9: required from ‘void ThorsAnvil::Serialize::DeSerializer::parse(T&) [with T = Type2]’ /usr/local/include/ThorSerialize/Importer.h:35:17: required from ‘std::istream& ThorsAnvil::Serialize::operator>>(std::istream&, const ThorsAnvil::Serialize::Importer<ThorsAnvil::Serialize::Json, Type2>&)’ main.cpp:24:34: required from here /usr/local/include/ThorSerialize/Serialize.tpp:494:12: error: no matching function for call to ‘ThorsAnvil::Serialize::DeSerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>::DeSerializeMember(ThorsAnvil::Serialize::DeSerializer&, ThorsAnvil::Serialize::ParserInterface&, const string&, Type2&, const std::pair<const char*, Type1*>&)’ return DeSerializeMember<T, M>(parent, parser, key, object, memberInfo); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:450:1: note: candidate: ThorsAnvil::Serialize::DeSerializeMemberContainer<T, M>::DeSerializeMemberContainer(ThorsAnvil::Serialize::DeSerializer&, ThorsAnvil::Serialize::ParserInterface&, const string&, T&, const std::pair<const char*, M T::>&) [with T = Type2; M = Type1; std::__cxx11::string = std::__cxx11::basic_string] DeSerializeMemberContainer<T, M>::DeSerializeMemberContainer(DeSerializer&, ParserInterface& parser, std::string const& key, T& object, std::pair<char const, M T::> const& memberInfo) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:488:23: note: inherited here using Parent::Parent; ^~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:488:23: note: no known conversion for argument 5 from ‘const std::pair<const char, Type1*>’ to ‘const std::pair<const char*, Type1 Type2::>&’ In file included from /usr/local/include/ThorSerialize/JsonParser.h:20:0, from /usr/local/include/ThorSerialize/JsonThor.h:14, from main.cpp:2: /usr/local/include/ThorSerialize/Serialize.h:207:7: note: candidate: constexpr ThorsAnvil::Serialize::DeSerializeMemberContainer<Type2, Type1>::DeSerializeMemberContainer(const ThorsAnvil::Serialize::DeSerializeMemberContainer<Type2, Type1>&) class DeSerializeMemberContainer ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/ThorSerialize/Serialize.h:429:0, from /usr/local/include/ThorSerialize/JsonParser.h:20, from /usr/local/include/ThorSerialize/JsonThor.h:14, from main.cpp:2: /usr/local/include/ThorSerialize/Serialize.tpp:488:23: note: inherited here using Parent::Parent; ^~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:488:23: note: candidate expects 1 argument, 5 provided In file included from /usr/local/include/ThorSerialize/JsonParser.h:20:0, from /usr/local/include/ThorSerialize/JsonThor.h:14, from main.cpp:2: /usr/local/include/ThorSerialize/Serialize.h:207:7: note: candidate: constexpr ThorsAnvil::Serialize::DeSerializeMemberContainer<Type2, Type1>::DeSerializeMemberContainer(ThorsAnvil::Serialize::DeSerializeMemberContainer<Type2, Type1>&&) class DeSerializeMemberContainer ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/ThorSerialize/Serialize.h:429:0, from /usr/local/include/ThorSerialize/JsonParser.h:20, from /usr/local/include/ThorSerialize/JsonThor.h:14, from main.cpp:2: /usr/local/include/ThorSerialize/Serialize.tpp:488:23: note: inherited here using Parent::Parent; ^~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:488:23: note: candidate expects 1 argument, 5 provided /usr/local/include/ThorSerialize/Serialize.tpp:484:7: note: candidate: constexpr ThorsAnvil::Serialize::DeSerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>::DeSerializeMember(const ThorsAnvil::Serialize::DeSerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>&) class DeSerializeMember: public TraitsInfo<T, M, Type>::DeSerializeMember ^~~~~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:484:7: note: candidate expects 1 argument, 5 provided /usr/local/include/ThorSerialize/Serialize.tpp:484:7: note: candidate: constexpr ThorsAnvil::Serialize::DeSerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>::DeSerializeMember(ThorsAnvil::Serialize::DeSerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>&&) /usr/local/include/ThorSerialize/Serialize.tpp:484:7: note: candidate expects 1 argument, 5 provided /usr/local/include/ThorSerialize/Serialize.tpp: In instantiation of ‘ThorsAnvil::Serialize::SerializeMember<T, M> ThorsAnvil::Serialize::make_SerializeMember(ThorsAnvil::Serialize::Serializer&, ThorsAnvil::Serialize::PrinterInterface&, const T&, const std::pair<const char, M*>&) [with T = Type2; M = Type1; typename std::remove_cv::type = Type1]’: /usr/local/include/ThorSerialize/Serialize.tpp:788:45: required from ‘void ThorsAnvil::Serialize::Serializer::printEachMember(const T&, const Members&, std::index_sequence<Seq ...>&) [with T = Type2; Members = std::tuple<std::pair<const char*, int*>, std::pair<const char*, Type1*> >; long unsigned int ...Seq = {0, 1}; std::index_sequence<Seq ...> = std::integer_sequence<long unsigned int, 0, 1>]’ /usr/local/include/ThorSerialize/Serialize.tpp:795:5: required from ‘void ThorsAnvil::Serialize::Serializer::printMembers(const T&, const std::tuple<_Elements ...>&) [with T = Type2; Members = {std::pair<const char*, int*>, std::pair<const char*, Type1*>}]’ /usr/local/include/ThorSerialize/Serialize.tpp:839:5: required from ‘void ThorsAnvil::Serialize::Serializer::printObjectMembers(const T&) [with T = Type2]’ /usr/local/include/ThorSerialize/Serialize.tpp:577:13: required from ‘void ThorsAnvil::Serialize::SerializerForBlock<traitType, T>::printMembers() [with ThorsAnvil::Serialize::TraitType traitType = (ThorsAnvil::Serialize::TraitType)3; T = Type2]’ /usr/local/include/ThorSerialize/Serialize.tpp:808:5: required from ‘void ThorsAnvil::Serialize::Serializer::print(const T&) [with T = Type2]’ /usr/local/include/ThorSerialize/Exporter.h:35:17: required from ‘std::ostream& ThorsAnvil::Serialize::operator<<(std::ostream&, const ThorsAnvil::Serialize::Exporter<ThorsAnvil::Serialize::Json, Type2>&)’ main.cpp:25:34: required from here /usr/local/include/ThorSerialize/Serialize.tpp:775:12: error: no matching function for call to ‘ThorsAnvil::Serialize::SerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>::SerializeMember(ThorsAnvil::Serialize::Serializer&, ThorsAnvil::Serialize::PrinterInterface&, const Type2&, const std::pair<const char*, Type1*>&)’ return SerializeMember<T,M>(ser, printer, object, memberInfo); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:736:1: note: candidate: ThorsAnvil::Serialize::SerializeMemberContainer<T, M>::SerializeMemberContainer(ThorsAnvil::Serialize::Serializer&, ThorsAnvil::Serialize::PrinterInterface&, const T&, const std::pair<const char*, M T::>&) [with T = Type2; M = Type1] SerializeMemberContainer<T, M>::SerializeMemberContainer(Serializer&, PrinterInterface& printer, T const& object, std::pair<char const, M T::> const& memberInfo) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:769:23: note: inherited here using Parent::Parent; ^~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:769:23: note: no known conversion for argument 4 from ‘const std::pair<const char, Type1*>’ to ‘const std::pair<const char*, Type1 Type2::*>&’ In file included from /usr/local/include/ThorSerialize/JsonParser.h:20:0, from /usr/local/include/ThorSerialize/JsonThor.h:14, from main.cpp:2: /usr/local/include/ThorSerialize/Serialize.h:254:7: note: candidate: constexpr ThorsAnvil::Serialize::SerializeMemberContainer<Type2, Type1>::SerializeMemberContainer(const ThorsAnvil::Serialize::SerializeMemberContainer<Type2, Type1>&) class SerializeMemberContainer ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/ThorSerialize/Serialize.h:429:0, from /usr/local/include/ThorSerialize/JsonParser.h:20, from /usr/local/include/ThorSerialize/JsonThor.h:14, from main.cpp:2: /usr/local/include/ThorSerialize/Serialize.tpp:769:23: note: inherited here using Parent::Parent; ^~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:769:23: note: candidate expects 1 argument, 4 provided In file included from /usr/local/include/ThorSerialize/JsonParser.h:20:0, from /usr/local/include/ThorSerialize/JsonThor.h:14, from main.cpp:2: /usr/local/include/ThorSerialize/Serialize.h:254:7: note: candidate: constexpr ThorsAnvil::Serialize::SerializeMemberContainer<Type2, Type1>::SerializeMemberContainer(ThorsAnvil::Serialize::SerializeMemberContainer<Type2, Type1>&&) class SerializeMemberContainer ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/ThorSerialize/Serialize.h:429:0, from /usr/local/include/ThorSerialize/JsonParser.h:20, from /usr/local/include/ThorSerialize/JsonThor.h:14, from main.cpp:2: /usr/local/include/ThorSerialize/Serialize.tpp:769:23: note: inherited here using Parent::Parent; ^~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:769:23: note: candidate expects 1 argument, 4 provided /usr/local/include/ThorSerialize/Serialize.tpp:765:7: note: candidate: constexpr ThorsAnvil::Serialize::SerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>::SerializeMember(const ThorsAnvil::Serialize::SerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>&) class SerializeMember: public TraitsInfo<T, M, Type>::SerializeMember ^~~~~~~~~~~~~~~ /usr/local/include/ThorSerialize/Serialize.tpp:765:7: note: candidate expects 1 argument, 4 provided /usr/local/include/ThorSerialize/Serialize.tpp:765:7: note: candidate: constexpr ThorsAnvil::Serialize::SerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>::SerializeMember(ThorsAnvil::Serialize::SerializeMember<Type2, Type1, (ThorsAnvil::Serialize::TraitType)3>&&) /usr/local/include/ThorSerialize/Serialize.tpp:765:7: note: candidate expects 1 argument, 4 provided

    opened by gladijos 0
  • How to combine templates and polymorphism?

    How to combine templates and polymorphism?

    I was trying to make a game using ECS framework. It's better to use POD as components, in order to improve performance and increase stability of the game. So I decided to use some wrapper to provide virtual table and to keep my components intact. However I got some errors. I'm looking for a way to print my wrapped POD, as well as to scan POD using the library's methods.

    In file included from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.h:425,
                     from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonParser.h:21,
                     from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonThor.h:15,
                     from /home/jack/IdeaProjects/Escape/src/serialization.cpp:19:
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp: In instantiation of ‘class ThorsAnvil::Serialize::DeSerializeMember<TerrainData, TerrainType, ThorsAnvil::Serialize::TraitType::Invalid>’:
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:508:73:   required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanEachMember(const string&, T&, const Members&, std::index_sequence<_Idx ...>&) [with T = TerrainData; Members = std::tuple<std::pair<const char*, TerrainType TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*> >; long unsigned int ...Seq = {0, 1, 2, 3, 4}; std::string = std::__cxx11::basic_string<char>; std::index_sequence<_Idx ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:515:95:   required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanMembers(const string&, T&, const std::tuple<_Elements ...>&) [with T = TerrainData; Members = {std::pair<const char*, TerrainType TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>}; std::string = std::__cxx11::basic_string<char>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:531:17:   required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanObjectMembers(const I&, T&) [with T = TerrainData; I = std::__cxx11::basic_string<char>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:196:21:   required from ‘void ThorsAnvil::Serialize::DeSerializationForBlock<traitType, T>::scanObject(T&) [with ThorsAnvil::Serialize::TraitType traitType = ThorsAnvil::Serialize::TraitType::Map; T = TerrainData]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:541:9:   required from ‘void ThorsAnvil::Serialize::DeSerializer::parse(T&) [with T = TerrainData]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:456:9:   [ skipping 3 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:515:95:   required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanMembers(const string&, T&, const std::tuple<_Elements ...>&) [with T = Wrapper<TerrainData>; Members = {std::pair<const char*, TerrainData Wrapper<TerrainData>::*>}; std::string = std::__cxx11::basic_string<char>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:531:17:   required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanObjectMembers(const I&, T&) [with T = Wrapper<TerrainData>; I = std::__cxx11::basic_string<char>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:196:21:   required from ‘void ThorsAnvil::Serialize::DeSerializationForBlock<traitType, T>::scanObject(T&) [with ThorsAnvil::Serialize::TraitType traitType = ThorsAnvil::Serialize::TraitType::Parent; T = Wrapper<TerrainData>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:345:5:   required from ‘void ThorsAnvil::Serialize::parsePolyMorphicObject(ThorsAnvil::Serialize::DeSerializer&, ThorsAnvil::Serialize::ParserInterface&, T&) [with T = Wrapper<TerrainData>]’
    /home/jack/IdeaProjects/Escape/src/serialization.cpp:68:5:   required from ‘void Wrapper<T>::parsePolyMorphicObject(ThorsAnvil::Serialize::DeSerializer&, ThorsAnvil::Serialize::ParserInterface&) [with T = TerrainData]’
    /home/jack/IdeaProjects/Escape/src/serialization.cpp:68:5:   required from here
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:484:7: error: invalid use of incomplete type ‘struct ThorsAnvil::Serialize::TraitsInfo<TerrainData, TerrainType, ThorsAnvil::Serialize::TraitType::Invalid>’
      484 | class DeSerializeMember: public TraitsInfo<T, M, Type>::DeSerializeMember
          |       ^~~~~~~~~~~~~~~~~
    In file included from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonParser.h:21,
                     from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonThor.h:15,
                     from /home/jack/IdeaProjects/Escape/src/serialization.cpp:19:
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.h:301:8: note: declaration of ‘struct ThorsAnvil::Serialize::TraitsInfo<TerrainData, TerrainType, ThorsAnvil::Serialize::TraitType::Invalid>’
      301 | struct TraitsInfo;
          |        ^~~~~~~~~~
    In file included from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.h:425,
                     from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonParser.h:21,
                     from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonThor.h:15,
                     from /home/jack/IdeaProjects/Escape/src/serialization.cpp:19:
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:486:11: error: invalid use of incomplete type ‘struct ThorsAnvil::Serialize::TraitsInfo<TerrainData, TerrainType, ThorsAnvil::Serialize::TraitType::Invalid>’
      486 |     using Parent = typename TraitsInfo<T, M, Type>::DeSerializeMember;
          |           ^~~~~~
    In file included from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonParser.h:21,
                     from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonThor.h:15,
                     from /home/jack/IdeaProjects/Escape/src/serialization.cpp:19:
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.h:301:8: note: declaration of ‘struct ThorsAnvil::Serialize::TraitsInfo<TerrainData, TerrainType, ThorsAnvil::Serialize::TraitType::Invalid>’
      301 | struct TraitsInfo;
          |        ^~~~~~~~~~
    In file included from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.h:425,
                     from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonParser.h:21,
                     from /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/JsonThor.h:15,
                     from /home/jack/IdeaProjects/Escape/src/serialization.cpp:19:
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:488:23: error: using-declaration for non-member at class scope
      488 |         using Parent::Parent;
          |                       ^~~~~~
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp: In instantiation of ‘bool ThorsAnvil::Serialize::DeSerializer::scanEachMember(const string&, T&, const Members&, std::index_sequence<_Idx ...>&) [with T = TerrainData; Members = std::tuple<std::pair<const char*, TerrainType TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*> >; long unsigned int ...Seq = {0, 1, 2, 3, 4}; std::string = std::__cxx11::basic_string<char>; std::index_sequence<_Idx ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4>]’:
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:515:95:   required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanMembers(const string&, T&, const std::tuple<_Elements ...>&) [with T = TerrainData; Members = {std::pair<const char*, TerrainType TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>, std::pair<const char*, float TerrainData::*>}; std::string = std::__cxx11::basic_string<char>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:531:17:   required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanObjectMembers(const I&, T&) [with T = TerrainData; I = std::__cxx11::basic_string<char>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:196:21:   required from ‘void ThorsAnvil::Serialize::DeSerializationForBlock<traitType, T>::scanObject(T&) [with ThorsAnvil::Serialize::TraitType traitType = ThorsAnvil::Serialize::TraitType::Map; T = TerrainData]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:541:9:   required from ‘void ThorsAnvil::Serialize::DeSerializer::parse(T&) [with T = TerrainData]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:456:9:   required from ‘ThorsAnvil::Serialize::DeSerializeMemberContainer<T, M>::DeSerializeMemberContainer(ThorsAnvil::Serialize::DeSerializer&, ThorsAnvil::Serialize::ParserInterface&, const string&, T&, const std::pair<const char*, M T::*>&) [with T = Wrapper<TerrainData>; M = TerrainData; std::string = std::__cxx11::basic_string<char>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:488:23:   [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:515:95:   required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanMembers(const string&, T&, const std::tuple<_Elements ...>&) [with T = Wrapper<TerrainData>; Members = {std::pair<const char*, TerrainData Wrapper<TerrainData>::*>}; std::string = std::__cxx11::basic_string<char>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:531:17:   required from ‘bool ThorsAnvil::Serialize::DeSerializer::scanObjectMembers(const I&, T&) [with T = Wrapper<TerrainData>; I = std::__cxx11::basic_string<char>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:196:21:   required from ‘void ThorsAnvil::Serialize::DeSerializationForBlock<traitType, T>::scanObject(T&) [with ThorsAnvil::Serialize::TraitType traitType = ThorsAnvil::Serialize::TraitType::Parent; T = Wrapper<TerrainData>]’
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:345:5:   required from ‘void ThorsAnvil::Serialize::parsePolyMorphicObject(ThorsAnvil::Serialize::DeSerializer&, ThorsAnvil::Serialize::ParserInterface&, T&) [with T = Wrapper<TerrainData>]’
    /home/jack/IdeaProjects/Escape/src/serialization.cpp:68:5:   required from ‘void Wrapper<T>::parsePolyMorphicObject(ThorsAnvil::Serialize::DeSerializer&, ThorsAnvil::Serialize::ParserInterface&) [with T = TerrainData]’
    /home/jack/IdeaProjects/Escape/src/serialization.cpp:68:5:   required from here
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:508:33: error: invalid static_cast from type ‘ThorsAnvil::Serialize::DeSerializeMember<TerrainData, TerrainType, ThorsAnvil::Serialize::TraitType::Invalid>’ to type ‘bool’
      508 |     CheckMembers memberCheck = {static_cast<bool>(make_DeSerializeMember(*this, parser, key, object, std::get<Seq>(member)))...};
          |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/jack/IdeaProjects/Escape/vendor/ThorsSerializer/ThorSerialize/Serialize.tpp:508:18: error: could not convert ‘{<expression error>}’ from ‘<brace-enclosed initializer list>’ to ‘CheckMembers’ {aka ‘std::initializer_list<bool>’}
      508 |     CheckMembers memberCheck = {static_cast<bool>(make_DeSerializeMember(*this, parser, key, object, std::get<Seq>(member)))...};
          |                  ^~~~~~~~~~~
          |                  |
          |                  <brace-enclosed initializer list>
    
    
    enum class TerrainType {
        BOX,
        CIRCLE
    };
    
    struct TerrainData {
        TerrainType type;
        float argument_1;
        float argument_2;
        float argument_3;
        float argument_4;
    };
    
    ThorsAnvil_MakeTrait(TerrainData, type, argument_1, argument_2, argument_3, argument_4);
    
    struct WrapperBase {
        virtual ~WrapperBase() {};
    
        virtual void *getData() { return 0; };
    
        ThorsAnvil_PolyMorphicSerializer(WrapperBase);
    };
    
    template<typename T>
    struct Wrapper : public WrapperBase {
        Wrapper() : data() {}
    
        Wrapper(const Wrapper<T> &wrapper) : data(wrapper.data) {}
        Wrapper(const T &d) : data(d) {}
        Wrapper(T &&d) : data(std::move(d)) {}
        T data;
        Wrapper &operator=(const Wrapper &wrapper) {
            data = wrapper.data;
            return *this;
        }
    
        void *getData() {
            return &data;
        }
    // The next line will not let the compiler go
        ThorsAnvil_PolyMorphicSerializer(Wrapper<T>);
    
    
    };
    ThorsAnvil_MakeTrait(WrapperBase);
    ThorsAnvil_Template_ExpandTrait(1, WrapperBase, Wrapper , data);
    
    
    opened by qiujiangkun 7
  • Support use of shared_ptr (for polymorphic types)

    Support use of shared_ptr (for polymorphic types)

    Is your feature request related to a problem? Please describe. Currently when using polymorphic types, only unique_ptr's work. The documentation on https://lokiastari.com/ThorsSerializer/#Pointers also states that they are not supported. I think currently they already work, just not in combination with polymoprhic types.

    Sometimes they are convenient though.

    Describe the solution you'd like Support shared_ptr's, like unique_ptr.

    Describe alternatives you've considered Not support them?:) Support seems already (partly) there in the code? So I'm not sure if they are intentionally left out, or just never really needed so far?

    Additional context By adding the two missing template specializations for shared_ptr in Traits.h, line 488 and in Serialize.tpp line 281 it seems to work. (Using the header only branch)

    opened by scgroot 5
Owner
Loki Astari
Loki Astari
Yet Another Serialization

YAS Yet Another Serialization - YAS is created as a replacement of boost.serialization because of its insufficient speed of serialization (benchmark 1

niXman 455 Sep 7, 2021
C++ BSON Library

This is a standalone BSON ("binary JSON") library for C++. (See bsonspec.org for more information on the BSON format.) The library is at this time a b

Dwight Merriman 57 Dec 16, 2022
Header-only library for automatic (de)serialization of C++ types to/from JSON.

fuser 1-file header-only library for automatic (de)serialization of C++ types to/from JSON. how it works The library has a predefined set of (de)seria

null 51 Dec 17, 2022
A YAML parser and emitter in C++

yaml-cpp yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec. To get a feel for how it can be used, see the Tutorial or How to Emi

Jesse Beder 3.8k Jan 1, 2023
Your binary serialization library

Bitsery Header only C++ binary serialization library. It is designed around the networking requirements for real-time data delivery, especially for ga

Mindaugas Vinkelis 771 Jan 2, 2023
Cap'n Proto serialization/RPC system - core tools and C++ library

Cap'n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except

Cap'n Proto 9.5k Jan 1, 2023
A C++11 library for serialization

cereal - A C++11 library for serialization cereal is a header-only C++11 serialization library. cereal takes arbitrary data types and reversibly turns

iLab @ USC 3.4k Jan 3, 2023
FlatBuffers: Memory Efficient Serialization Library

FlatBuffers FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serializ

Google 19.7k Jan 9, 2023
Simple C++ 20 Serialization Library that works out of the box with aggregate types!

BinaryLove3 Simple C++ 20 Serialization Library that works out of the box with aggregate types! Requirements BinaryLove3 is a c++20 only library.

RedSkittleFox 14 Sep 2, 2022
Zmeya is a header-only C++11 binary serialization library designed for games and performance-critical applications

Zmeya Zmeya is a header-only C++11 binary serialization library designed for games and performance-critical applications. Zmeya is not even a serializ

Sergey Makeev 99 Dec 24, 2022
CppSerdes is a serialization/deserialization library designed with embedded systems in mind

A C++ serialization/deserialization library designed with embedded systems in mind

Darren V Levine 79 Nov 5, 2022
C++17 library for all your binary de-/serialization needs

blobify blobify is a header-only C++17 library to handle binary de-/serialization in your project. Given a user-defined C++ struct, blobify can encode

Tony Wasserka 247 Dec 8, 2022
Cista is a simple, high-performance, zero-copy C++ serialization & reflection library.

Simple C++ Serialization & Reflection. Cista++ is a simple, open source (MIT license) C++17 compatible way of (de-)serializing C++ data structures. Si

Felix Gündling 1.1k Jan 2, 2023
Microsoft 2.5k Dec 31, 2022
Fast Binary Encoding is ultra fast and universal serialization solution for C++, C#, Go, Java, JavaScript, Kotlin, Python, Ruby, Swift

Fast Binary Encoding (FBE) Fast Binary Encoding allows to describe any domain models, business objects, complex data structures, client/server request

Ivan Shynkarenka 654 Jan 2, 2023
Binary Serialization

Binn Binn is a binary data serialization format designed to be compact, fast and easy to use. Performance The elements are stored with their sizes to

null 383 Dec 23, 2022
An implementation of the MessagePack serialization format in C / msgpack.org[C]

CMP CMP is a C implementation of the MessagePack serialization format. It currently implements version 5 of the MessagePack Spec. CMP's goal is to be

Charlie Gunyon 290 Dec 31, 2022
MPack - A C encoder/decoder for the MessagePack serialization format / msgpack.org[C]

Introduction MPack is a C implementation of an encoder and decoder for the MessagePack serialization format. It is: Simple and easy to use Secure agai

Nicholas Fraser 419 Jan 1, 2023
Serialization framework for Unreal Engine Property System that just works!

DataConfig Serialization framework for Unreal Engine Property System that just works! Unreal Engine features a powerful Property System which implemen

null 81 Dec 19, 2022